Skip to content

Navigation Menu

Sign up
apneadiving edited this page Sep 7, 2011 · 18 revisions

Which Apis?

Since 0.10.0, you can choose your map API from the following:

How to?

<%= gmaps("markers" => {"data" => @json},
 "map_options" => { "provider" => "openlayers"}) %> 

For bing and mapquest, you need to provide an API key. Simply pass it as an argument:

<%= gmaps("markers" => {"data" => @json},
 "map_options" => { "provider" => "mapquest", "provider_key" => MAPQUEST_KEY, "auto_adjust" => true,"center_on_user" => true }) %>

Or:

<%= gmaps("markers" => {"data" => @json},
 "map_options" => { "zoom" => 5, "provider" => "bing", "provider_key" => BING_KEY, "auto_adjust" => true,"center_on_user" => true }) %> 

Limitations

Not every method I created for google maps is implemented in the other APIs. See current state of other APIs implementation

Special options

GoogleMaps

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 }' } %> 

Bing

For Infowindows, you can have description which is raw text or htmlContent:

<%= gmaps("markers" => {"data" => @json, "options" => {"infobox" => "htmlContent" } }) %> 

For Map type, you have the choice among: aerial, auto, birdseye, collinsBart, mercator, ordnanceSurvey and road (default).

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /