user3482059
user3482059

Reputation: 11

gmaps4rails disabling zoom

I'm trying to disable scroll when I build my map, but it doesn't seem to be working.

:javascript
var handler = Gmaps.build('Google', { map_options: { scrollwheel: false, zoomControl:   false }, markers: { maxRandomDistance: null }, builders: { Marker: InfoBoxBuilder} });
  handler.buildMap({ internal: {id: 'geolocation'} }, function(){
...
});

Upvotes: 0

Views: 466

Answers (2)

apneadiving
apneadiving

Reputation: 115541

According to the doc, you can change global settings when you create the handler.

You can change object options in the build function.

So do:

var handler = Gmaps.build('Google', { markers: { maxRandomDistance: null }, builders: { Marker: InfoBoxBuilder} });

handler.buildMap({ provider: { scrollwheel: false, zoomControl: false }, internal: {id: 'geolocation'} }, function(){
...
});

Upvotes: 5

jediah
jediah

Reputation: 102

Possible duplicate of this

  <%= gmaps("map_options" => { :raw => "{scrollwheel: false}", "zoom" => 17, "auto_zoom" => false },"markers" => { "data" => event.to_gmaps4rails }) %>

This might help too..

Upvotes: 0

Related Questions