How to get mapview download progress status in android?

while the map is in loading state, I want to put the progress indicator in the center of mapview.

how to make progress and how to do it?

give me an example.

thanks.

+4
source share
2 answers

I do not think there is a reasonable way to do this. Please note that Google does not do this in its mapping applications. This is pretty clear just by looking at the page to see if all the tiles are still loading, so I don't think there really is a need to put a progress indicator.

MapView has a canCoverCenter() method that can tell you if the center tile is available, but there is nothing for the rest of the tiles.

+1
source

Take a look at GoogleMap.OnMapLoadedCallback

Callback interface for when the card has finished rendering. This happens after all the tiles necessary to display the map have been removed and all marking is completed. This event does not fire if the card never loads due to connection problems, or if the card is constantly changing and never completes loading due to a regular user interacting with the card.

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 } }); } }); 
0
source

Source: https://habr.com/ru/post/1301694/


All Articles