Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Map tiles flicker between terrain and normal types

I have a Google Maps v2 application. During rendering, the map tiles flicker between terrain-type and normal-type. You can see the tile boundaries in the screenshot below. Each tile seems to flicker between the two types, then settles on one.

Panning or zooming sets off the whole flickering again. Some tiles seem to be more prone to the flickering than others, but it's not predictable or consistent.

The map is set to terrain-type:

 map.setMapType(MAP_TYPE_TERRAIN);

This happens both on my Android 4.1 phone, and an Android 4.4 Nexus 7. I've only noticed it recently, so it may have crept in during the last update to Google Play Services (currently using update 13). Upgrading to update 15 makes no difference, the flickering continues.

Has anyone else see this behaviour before?

enter image description here

like image 498
skaffman Avatar asked Mar 02 '14 05:03

skaffman


1 Answers

Edit: Problem has been fixed as of google-play-services v16.

Sadly it's a Known Problem and I expect it might be fixed soon; That being said, there are multiple issues with tiles in maps v2.

As per this issue, you might be able to avoid the flickering with manually setting a TileOverlay and using clearTileCache() instead. The clear caveat here would be that you, for entire moments, lose the entire data you have and might see blanks as clearing the cache is on the spot and will not consider specific parts or clearing only upon new fetches.

TileOverlay docs state:

The TileProvider provides the images that are used in the tile overlay. You must specify the tile provider before it is added to the map. The tile provider cannot be changed once it has been added; however, you can modify the behavior of the tile provider to return different images for specific coordinates. If the tiles provided by the tile provider change, you must call clearTileCache() afterwards to ensure that the previous tiles are no longer rendered.

Another option, if viable, is using OpenStreetMap as overlay/source for map.

like image 77
Ben Max Rubinstein Avatar answered Nov 10 '22 10:11

Ben Max Rubinstein