Anyone know how I can draw Polygons with GPolygon from Google Map without having a map, inside other elements? Or anyone know any framework to do it with the same features like GPolygon?
I would like to have this “draw polygon” on a custom element, like div:
<div id="MyArea"></div>
Check out Raphael, a javascript library that wraps around VML in IE and SVG in standards compliant browsers. It’s fairly easy to use and quite well documented.
Granted, the
pathelement (used to draw polygon and polylines) uses the SVG path string syntax which is a bit cryptic but quite easy to understand. You can of course extend Raphael to use a more simple syntax:Which should allow you to do:
Or create your own polygon API to taste if you don’t like mine.
EDIT: fixed some small bugs.