1

I'm using Tile Overlay feature of Google Map for Android to display custom map tiles, provided by third party service.

My problem is that, when user zooms the map, and it switches to next zoom level, already visible tiles are disappearing, and then getTile() method of my TileProvider implemetation is triggered. This causes unpleasant blinking of my map view, and moments when user can see only default map.

Standard Google Map behavior scales and "overzooms" currently visible tiles, until new ones are loaded. Is there any way I can create the same effect with Tile Overlay? I am aware that "overzoomed" tiles can be blurry, but that is ok in my case.

KrzysztofW
  • 57
  • 4

1 Answers1

0

Remove custom tiles when zoom level changed is default Android GoogleMap behavior. To "suppress" it (showing previous map when tiles for zoom±1 level still downloading ) you can:

1) create GroundOverlay with screenshot of current map view. Screenshot of google map you can do like in answers for this question of DiscDev and remove it when tiles downloaded;

2) create custom view which extends MapView class like in this answer and show in overridden dispatchDraw() method whatever you want;

3) 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.2 - create MapView-based custom view, override dispatchDraw() and show temporary map within it while new map loading.

Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79