Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zooming in google map api 3 [ios]

According to Google Map documentation. In IPhone

Zooming is accomplished by a two finger pinch.

So when i tap my fingers on screen and move then map getting zoomed but after that when i release fingers from screen then zoom that i see before the map reloads is a lot more than the actual zoom that renders.

Currently, I am testing that on IPhone 5 with ios 7.1.2 and IPhone 4S with ios 8

I am using JQuery Mobile Framework in my app and the map is generated dynamically. (when i create map with fixed values then it works fine)

I created fiddle in which you can see same problem. Link

Some picture of my issue First picture map opens

first

Second picture when i try to zoom my map with finger pinch.

second picture

Third picture when i released my finger from screen.

third picture

So it cannot maintain its zoom level that show in second picture. How to solve this problem

like image 929
Blu Avatar asked Nov 11 '22 01:11

Blu


1 Answers

Please try replacing:

google.maps.event.addListener(mapClass.map, 'zoom_changed', function() {
    mapClass.map.panTo(myLatlng);
});

with :

google.maps.event.addListener(mapClass.map, 'zoom_changed', function() {
    mapClass.map.panTo(mapClass.map.center);
});

Hope it helps.

like image 92
Derick Fynn Avatar answered Nov 14 '22 21:11

Derick Fynn