how to detect when TileOverlay has completed downloading tiles?

不想你离开。 提交于 2019-12-12 17:04:55

问题


I'm using multiple TileOverlay objects as "frames" for my map animation. When an TileOverlay is made visible (via TileOverlay.setVisible(true)), it will start downloading the tiles. How can I detect when the tiles for the overlay have been downloaded and displayed?


回答1:


It's not possible to know from the API if all visible Tiles are downloaded and displayed.

If you want to know when a single Tile is downloaded, you may put some code before return in TileProvider.getTile. This way you can count downloaded tiles and have some estimates on your original question.




回答2:


You should use OnMapLoadedCallback

mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
        @Override
        public void onMapLoaded() {
            //Your code
        }
    });


来源:https://stackoverflow.com/questions/16380546/how-to-detect-when-tileoverlay-has-completed-downloading-tiles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!