I've been struggeling with Google Maps v2 and custom tiles. It works fine, but we get black squares in Google Maps very often, and they are very distruptive.
I can reproduce the problem very simply by doing this:
mapFragment = new MapFragment() {
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mapFragment.getMap().setMapType(GoogleMap.MAP_TYPE_NONE);
}
};
FragmentTransaction trans = getFragmentManager().beginTransaction();
trans.replace(R.id.map, mapFragment);
trans.commit();
I use this code and a standard activity with a framelayout. If I zoom far enough in the background on my Nexus4 it turns black. If I put tiles on top of that I will see black flashes as I zoom in.
I've seen a ton of workarounds on how to fix this, and none of them seem to work at all. It seems to only happen on certain zoom levels, but I (A) need those zoom levels, and (B) cannot seem to limit zooming (without building a custom pinch to zoom implementation anyways).
I've done some testing with custom tile providers. With MAP_TYPE_NONE
, a tile provider which simply returns 1 blue pixel and my normal map tile provider I can visually see the map changing from black -> blue -> my map. Even though my custom blue tile provider returns immediately with a 1px blue tile.
The most recent version of Google Maps beta is 10.66. 1 (up from 10.64. 1 beta on March 31), while for those running the stable build, the latest update is Google Maps 10.65.
White – Void of any vegetation, sand dunes, mountain peaks. Light Gray – Population areas, cities, suburbs. Medium Gray – Military areas.
This issue, as well as a trailing black rectangle when moving the Map view, was reported months ago and has just received a fix from Google.
This fix is unfortunately limited to compatible devices and because it's a fresh fix, may introduce new bugs on the "fixed" devices and keep the old ones (a bit different) on the other devices.
I don't see any need to copy here the conversation from Google's bug tracker since it's fully public: https://code.google.com/p/gmaps-api-issues/issues/detail?id=4659
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With