Last active
May 17, 2016 16:38
-
-
Save wviana/19fb4aad618ad423bb45b0fcbd521acb 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
private boolean initMap() { | |
if (mMap == null) { | |
//mMap = new GigMobileMap(mMapView.getExtendedMap()); | |
mMapView.getExtendedMapAsync(new OnMapReadyCallback() { | |
@Override | |
public void onMapReady(GoogleMap googleMap) { | |
GigMobileMap tmpMap = new GigMobileMap(googleMap); | |
MapsInitializer.initialize(getActivity()); | |
tmpMap.initMap(getActivity(), mapListener); | |
mMap = tmpMap; | |
notifyAll(); | |
} | |
}); | |
} | |
while(mMap == null){ | |
try { | |
Log.d(this.getClass().getSimpleName(), "Esperando Map"); | |
wait(); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
} | |
return (mMap != null); | |
} |
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
private boolean initMap() { | |
final Object lock = new Object(); | |
if (mMap == null) { | |
//mMap = new GigMobileMap(mMapView.getExtendedMap()); | |
mMapView.getExtendedMapAsync(new OnMapReadyCallback() { | |
@Override | |
public void onMapReady(GoogleMap googleMap) { | |
synchronized (lock) { | |
GigMobileMap tmpMap = new GigMobileMap(googleMap); | |
MapsInitializer.initialize(getActivity()); | |
tmpMap.initMap(getActivity(), mapListener); | |
mMap = tmpMap; | |
lock.notifyAll(); | |
} | |
} | |
}); | |
} | |
while(mMap == null){ | |
try { | |
Log.d(this.getClass().getSimpleName(), "Esperando Map"); | |
lock.wait(); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
} | |
return (mMap != null); | |
} |
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
private boolean initMap() { | |
final Object lock = new Object(); | |
if (mMap == null) { | |
//mMap = new GigMobileMap(mMapView.getExtendedMap()); | |
mMapView.getExtendedMapAsync(new OnMapReadyCallback() { | |
@Override | |
public void onMapReady(GoogleMap googleMap) { | |
GigMobileMap tmpMap = new GigMobileMap(googleMap); | |
MapsInitializer.initialize(getActivity()); | |
tmpMap.initMap(getActivity(), mapListener); | |
mMap = tmpMap; | |
lock.notifyAll(); | |
} | |
}); | |
} | |
while(mMap == null){ | |
try { | |
Log.d(this.getClass().getSimpleName(), "Esperando Map"); | |
lock.wait(); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
} | |
return (mMap != null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment