Posts tagged: polygone in rails

GPolygon in Gmaps

By , August 7, 2009 3:47 am

By using Gpolygon we can display a path on gmap. You need to just define order of locations(latitude,longitude) in this.

But you have to know How to generate Gmaps in ruby on rails

Create a polygone array #From Sri Lanka to Afghanistan

polyline=GPolyline.new([[7.880794,80.507813],
[22.792388,79.497070],
[29.874945, 69.345703],
[33.757228,65.522461]],
"#ff0000",1,5.0)

Add into your map


@map.overlay_init(polyline)

You will get following output.

gmap_polygon

Panorama Theme by Themocracy