I am working with google maps api 10 for some time now and there is a bug that i just cant fix because im 99.9% sure its within googles library.
I do a lot of Projection .toPixels()
to draw stuff and all works fine. I zoom with custom zoom methods mapController.setZoom(getZoom() +1)
and it all works UNTIL i use a pinch-zoom (2-finger zoom). After that, the Projection seems to be stuck within certain zoom levels.
If i pinch zoom from 12 to 11 the maps getZoomLevel()
gives me 11 (it always reports the right level). Now if i use my zoomOut method i am on level 13 and the projection calculates all right for level 13 but every subsequent zoomOut only changes the maps zoom-level (internally, remember, device has no internet so no map data). The projection continues to calculate everything as if it was still zoomlevel 13!
Should i zoomIn the projection suddenly jumps to level 11, no matter what the real level of the map is. So if i pinch zoomed to 12 the projection is stuck at 11 / 13 and will only jump between those two if i zoom out/in.
IF i pinch-zoom again, the projection is updated but stuck again at the new level to which i pinch-zoomed.
So a pinch zoom without internet completely kills the projection and the whole map becomes useless (in my case i dont really need the visual map, i just need its geoPoint translation, thats the most important part).
Does anyone know a hotfix/workaround or anything that could help me other than to disable more than 1 pointer in the on-touch ?
Map Stuff in the constructor of my customMapView
setVisibility(View.VISIBLE);
mapController = getController();
mapController.setZoom(17);
setBuiltInZoomControls(false);
getZoomButtonsController().setVisible(false);
setSatellite(false);
setTraffic(false);
setClickable(true);
preLoad();
and thats how i zoom with custom buttons
mapController.setZoom(getZoomLevel() + 1); // zoom in
mapController.setZoom(getZoomLevel() - 1); // zoom out
1) zoom buttons work
2) pinch zoom out
3) now the buttons/zoom via button shows the behaviour as described above
Additional Info:
i just used the apps "myTracks" and "Torque".
Both use googlemaps.
In both i have recorded tracks.
Now if i disable internet and use 2-finger zoom and after that zoom in/out with the usual buttons, at some point the track wanders off into some direction even if it is perfectly centered. Up to the point where the track is gone after lots of zoom out/in.
The second i reactivate internet and the map is able to load some tiles the NEXT zoom is working and all is fine... because the map seems to require some data from the internet to calculate something within the projection and this something seems to be provided by a 2-finger zoom... thats how i see it.
3 Apps, all the same issue...