-
Notifications
You must be signed in to change notification settings - Fork 382
Display Everything!
apneadiving edited this page Apr 12, 2011
·
6 revisions
##Mix different kinds of data
To display several kind of data at the same time, simply add these to the hash.
<%= gmaps({
"map_options" => { "type" => "SATELLITE", "center_longitude" => 180, "zoom" => 3, "auto_adjust" => true},
"markers" => { "data" => '[{ "description": "", "title": "", "longitude": "5.9311119", "latitude": "43.1251606", "picture": "", "width": "", "height": "" } ,{ "description": "", "title": "", "longitude": "2.3509871", "latitude": "48.8566667", "picture": "", "width": "", "height": "" } ]',
},
"polylines" => { "data" => '[[
{"longitude": -122.214897, "latitude": 37.772323},
{"longitude": -157.821856, "latitude": 21.291982},
{"longitude": 178.431, "latitude": -18.142599},
{"longitude": 153.027892, "latitude": -27.46758}
],
[
{"longitude": -120.214897, "latitude": 30.772323, "strokeColor": "#000", "strokeWeight" : 2 },
{"longitude": -10.821856, "latitude": 50.291982}
]]' },
"polygons" => { "data" => '[[
{"longitude": -80.190262, "latitude": 25.774252},
{"longitude": -66.118292, "latitude": 18.466465},
{"longitude": -64.75737, "latitude": 32.321384}
]]' },
"circles" => { "data" => '[
{"longitude": -122.214897, "latitude": 37.772323, "radius": 1000000},
{"longitude": 122.214897, "latitude": 37.772323, "radius": 1000000, "strokeColor": "#FF0000"}
]',
},
"direction" => { "data" => { "from" => "toulon, france", "to" => "paris, france"} ,
"options" => {"waypoints" => ["toulouse, france", "brest, france"], "travelMode" => "DRIVING", "display_panel" => true, "panel_id" => "instructions"}
}
}
%>