I'm using gmaps4rails like so:
<%= gmaps("map_options" => { "scrollwheel" => false, "zoom" => 17, "auto_zoom" => false },"markers" => { "data" => event.to_gmaps4rails }) %>
This is generating:
<script type="text/javascript" charset="utf-8">
Gmaps.map = new Gmaps4RailsGoogle();
Gmaps.load_map = function() {
Gmaps.map.map_options.scrollwheel = false;
Gmaps.map.map_options.zoom = 17;
Gmaps.map.map_options.auto_zoom = false;
Gmaps.map.initialize();
Gmaps.map.markers = [{"lat":38.6419,"lng":-90.2646}];
Gmaps.map.create_markers();
Gmaps.map.adjustMapToBounds();
Gmaps.map.callback();
};
window.onload = function() { Gmaps.loadMaps(); };
</script>
What am I doing wrong that is ignoring the scrollwheel = false
option?
"Historically", I added in the map options some features from the providers. This was a bad idea since I didn't extract everything and I started to receive some pull requests for the rest of it...
Too much code for very low added value.
In your case,
scrollwheel
isn't included in the list here. So the best options is to use theraw
key (also described in the link above).This would lead you to the following code: