Skip to content
Konstantin edited this page Oct 12, 2015 · 4 revisions

Data to provide

Valid json to provide should be like:

@circles_json = '[
 {"lng": -122.214897, "lat": 37.772323, "radius": 1000000},
 //you can add whatever customization within the hash
 {"lng": 122.214897, "lat": 37.772323, "radius": 1000000, "strokeColor": "#FF0000"}
]'

radius is in meters.

Default display configuration:

strokeColor: "#000",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#000",
fillOpacity: 0.35

Display circles

<%= gmaps({
       "circles"    => { "data" => @circles_json }
     })
 %>

Change default configuration for circles

Simply pass options you want to override in a hash.

<%= gmaps({
       "circles"    => { "data" => @circles    , "options" => { "fillColor" => "#FF0000" } }
     })
 %>