while the map is in loading state i want to put a progressbar at the center of mapview.
how to get the progress?? and how to do??
give me some example..
Take a look at GoogleMap.OnMapLoadedCallback
Callback interface for when the map has finished rendering. This occurs after all tiles required to render the map have been fetched, and all labeling is complete. This event will not fire if the map never loads due to connectivity issues, or if the map is continuously changing and never completes loading due to the user constantly interacting with the map.
Usage example:
/**
* Acquire a non-null instance of the GoogleMap.
*/
mMapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
googleMap.setOnMapLoadedCallback(new OnMapLoadedCallback() {
/**
* Called when the map has finished rendering.
* This will only be called once.
* You must request another callback if you want to be notified again.
*/
@Override
public void onMapLoaded() {
//TODO: Hide ProgressBar
}
});
}
});
I don't think there is any reasonable way of doing it. Note that Google isn't doing this either in their map applications. It is pretty clear just looking at the page to see if tiles are still loading, so I don't think there is actually any need to put in a progress indicator.
The MapView has a method canCoverCenter()
which can tell you if the center tile is available, but there is nothing for the rest of the tiles.