Chris Harrington
Chris Harrington

Reputation: 1662

How to zoom with mouse in OpenLayers so that the mouse points to the same place before and after zooming (a la Google Maps)?

I'm having a tough time changing the zoom method of my OpenLayers map. If you were to go to Google Maps right now and double click on London on the map to zoom, the mouse cursor is pointing at London after the zoom operation has completed. In OpenLayers, if I double click on London, my mouse cursor is nowhere near London because the map now has London in the centre of the viewport. Is there an easy way of accomplishing this? Thanks!

Upvotes: 2

Views: 659

Answers (1)

igorti
igorti

Reputation: 3856

Without seeing your code I'll make an assumption that you are using OpenLayers.Control.MouseDefaults for navigation and it works the way you described(I think it will be deprecated in coming versions). To have Google Maps-like zoom in functionality you should use OpenLayers.Control.Navigation control.

Upvotes: 1

Related Questions