3

I have a tile overlay in Android Google Map. Everything works fine. But when I zoom in, all tiles disappear then new tiles are downloaded and only after 1-2 secs(when new tiles are downloaded) the map shows them. Therefore, the map doesn't show tiles for some time. Is there a way to update tiles only when new tiles are downloaded?

I use a basic UrlTileProvider and Aeris Overlay maps.

enter image description here

Rustam Ibragimov
  • 2,571
  • 7
  • 22
  • 33

1 Answers1

1

Anyway, you can download each tile as image to local internal or external storage with, for example, Picasso library (or separate Thread or AsyncTask) and determine "all new tiles are downloaded" event "manually" (e.g. increment downloaded tiles counter on every public void onSuccess() for Picasso or protected void onPostExecute() for AsyncTask or on end of public void run() for Thread and wait that equals all tiles quantity) then use TileProvider for downloaded tiles local storage like in this answer of Alex Vasilkov.

Update

For showing previous map when tiles for zoom+1 level still downloading it's possible to create GroundOverlay with screenshot of current map view. Screenshot of google map you can do like in answers for this question of DiscDev

Update #2

There are several ways to solve you problem: 1) you can create custom view which extends MapView class like in this answer and show in overridendispatchDraw() method whatever you want or 2) you can set ImageView over your MapView and show it with screenshot on it while zoom changed and new tiles loaded. And if necessary you can translate tap events from ImageView to MapView and so on.

I prefer p.1 - create MapView-based custom view, override dispatchDraw() and show temporary map within it while new map loading.

Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79
  • I already download the tiles locally and the problem still exist, basically what happen is whenever i zoom to the next level google map suddenly remove the current tiles from screen and show empty screen. After that it takes around a second to load the next tiles locally and show them. which is annoying as a user experience – has19 Dec 03 '18 at 19:26
  • Try to create GroundOverlay with downloaded tiles. – Andrii Omelchenko Dec 03 '18 at 20:06
  • my tiles are loaded from local storage ,i already downloaded them – has19 Dec 03 '18 at 20:41
  • if u try to zoom in google map app => the app keeps zooming through the current tile image until the next zoom tiles are loaded – has19 Dec 03 '18 at 20:48
  • i am afraid there is no solution for my problem:( ((https://stackoverflow.com/questions/28200990/android-maps-v2-tiles-disappear-when-zooming – has19 Dec 03 '18 at 20:51