0

I use a content management system (Drupal) for my work website and I was wondering if there is a way to lock the google map position so it doesn't jar over the place when the user clicks on the balloons? I'm aware that there is a very helpful suggestion here Disable mouse scroll wheel zoom on embedded Google Maps but I can't manipulate the Javascript or CSS.

any help you give will be appreciated.

Community
  • 1
  • 1
Laura Walker
  • 307
  • 2
  • 6
  • 16
  • How is the map being included in the page? A map module? – 2pha Mar 21 '15 at 00:02
  • general content module. we don't have the map capability – Laura Walker Mar 23 '15 at 00:58
  • I could give an example if I knew what code you were using to include the map. If you are using the javascript api, you can set 'draggable' to false on the mapOptions object. You can also set 'maxZoom' and 'minZoom' to effectively disable zooming. All the maoOptions are explained [HERE](https://developers.google.com/maps/documentation/javascript/reference#MapOptions) – 2pha Mar 24 '15 at 06:34

1 Answers1

0

I think you can add a event listener to listen to the event center_changed

There is a sample event example in the documentation where the map listen to the center_changed and wait for 3 seconds before it recenter the map.

I think you can implement something similar with no time delay to "Lock" the position of your map.

You can refer to the documentation regarding to the center_changed here.

kaho
  • 4,746
  • 1
  • 16
  • 24
  • It would be better to set the 'draggable' parameter to false in the mapOptions object which is why I asked how she is including the map. I could give an example if I knew that. – 2pha Mar 24 '15 at 06:33
  • Oh... Yea draggable sounds better. Just remember Drupal probably use iframes for google maps... So JavaScript might not work – kaho Mar 24 '15 at 06:38
  • Drupal has a few mapping modules including the one I made [HERE](https://www.drupal.org/project/goomap). But it does sound like she is just using an iframe. – 2pha Mar 24 '15 at 06:40
  • Oh really? it's my bad I totally didn't realized it is actually a Drupal question to begin with :( – kaho Mar 24 '15 at 06:43
  • Sorry I went MIA but I don't have access to specific Drupal Map modes. I can only edit the iframe, unfortunately. – Laura Walker Apr 09 '15 at 15:52