1

Is it possible to customize how the map options are displayed on the google map?

It seems this is an option in the API using mapTypeControlOptions wiht an array of mapTypeIDs.

Thanks to apneadiving for developing this awesome gem!!!

apneadiving
  • 114,565
  • 26
  • 219
  • 213
donsteffenski
  • 477
  • 3
  • 15

1 Answers1

1

You can add any option google map enables. From the doc here:

If you lack some options for maps and markers, you can simply pass what you need in :raw:

<%= gmaps(:markers => {:data => @json, :options => { :raw => '{ animation: google.maps.Animation.BOUNCE }' } },
          :map_options => { :raw => '{ disableDefaultUI: true, scrollwheel: false }' }) %>
apneadiving
  • 114,565
  • 26
  • 219
  • 213
  • I had tried using the `:raw` option but had the array of `mapTypeIds` wrong. Tried again and got what I wanted like this: `<%= gmaps("markers" => {"data" => @json}, "map_options" => {"type" => "TERRAIN", :raw => '{mapTypeControlOptions: {mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.TERRAIN]}}'}) %>` Did you see my other follow-up question at http://stackoverflow.com/q/11404725/1481208 ? This would require creating a new, custom `mapTypeId`. Could this be an option for a future release of your gem? Thanks for you quick answer on this one. – donsteffenski Jul 10 '12 at 20:24