Created
August 12, 2015 15:54
-
-
Save sax1johno/bf58e523da6e67b0621b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```java | |
public class MyMap extends MapFragment { | |
GoogleMap myMap; | |
boolean mapReady = false; | |
..... | |
@Override | |
protected void onCreateView(LayoutInflater inflater, ViewGroup vg, Bundle savedInstanceState) { | |
getMapAsync(new OnMapReadyCallback() { | |
@Override | |
protected void onMapReady(GoogleMap map) { | |
myMap = map; | |
mapReady = true; | |
// Do everything related to the map in here since you now have a map | |
// or you can check the mapReady method before you go to use the map | |
// to make sure it's there, then use the reference to myMap. | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment