0

I'm using OpenLayers with Google Layer, and I have a strange behaviour about vectors on the map.

On mobile (Android), when doing a multitouch event on the map (zoom), vectors move and zoom as the touchmove event is active. But when the touchend event is trigger, vectors are refresh at the right place and with their real size.

This is not happening with OpenstreetMap layer. I also tested some web pages implementing OpenLayers & Google Layer & a vector layer on my mobile, and they all have the same issue. Any idea why ? I tested this one, if someone want to reproduce : http://www.macfh.co.uk/Test/Google_with_OpenLayers.html With a multitouch event, marker is moving/zooming, and then go back to its initial place.

I already took care about the sphericalMercator specifity, so I think it's not the problem.

Thanks in advance !

Mel
  • 3
  • 4

1 Answers1

0

Tiles positionning for google layers is done through their api, which doesn't allow to make pinch zoom work the same way it’s done for all others layers: Pinch zooming doesn't work with google layers.

If you want pinch zoom to work, you should consider using layers with direct access to tiles (OSM, Bing, …). And your mobile will thank you for the decrease of number of scripts to load ;).

tonio
  • 2,376
  • 1
  • 22
  • 28
  • Sadly I have to use Google Layer on this project.If there is no way to fix that, how can I disable the default pinch zoom behaviour ? Pinch zooming is active, as default OpenLayers gesture navigation( double tap and tap with two fingers ) – Mel May 23 '12 at 10:00
  • when you create your map, set manually the list of controls that you want instead of letting OpenLayers add the defaults one. (see http://openlayers.org/dev/examples/controls.html) – tonio May 23 '12 at 10:04
  • I don't get it, I already use custom controls by adding explicitly "OpenLayers.Control.TouchNavigation" to controls when I create the map, but this is allowing all the gesture type. Then how can I disable pinch zooming but let double-tap and two finger tap do the job ? – Mel May 23 '12 at 10:31