views:

436

answers:

3

Please see the image :

alt text

Any idea how to do that? drawing an area.

+1  A: 

If you're looking to use Google Maps API, check the documentation about Polylines (should be what that is) : http://code.google.com/intl/pt-PT/apis/maps/documentation/overlays.html#Polylines%5FOverview

yoda
thanks, I reviewed the link, but it is not very clear, I could not make it :(
artmania
A: 

You need to instantiate a GPolygon object and add that (using the addOverlay method) to your GMap2 object:

var polygon = new GPolygon([new GLatLng(48.922499263758255,-94.921875),
    new GLatLng(49.03786794532641,-128.671875),
    new GLatLng(38.95940879245423,-126.38671875),
    new GLatLng(31.95216223802497,-118.30078125),
    new GLatLng(24.686952411999155,-96.50390625),
    new GLatLng(28.149503211544566,-87.1875),
    new GLatLng(23.725011735951796,-79.62890625),
    new GLatLng(44.59046718130883,-59.765625)], "#ff0000", 5, 1, "#0000ff", 0.2);
map.addOverlay (polygon);

The first parameter is an array of points (that make up your polygon), then the stroke (that is the outline)color, weight (thickness) and opacity (how transparent), then the fill color and opacity.

Here is a cut down example:

Cannonade
+2  A: 

The toolkit that allows users to draw polygons on MyMaps has been made available as the GeometryControls utility library

Mike Williams
+1 Re-reading the question. I realized I missed the point here.
Cannonade