function mapClick(e:MapMouseEvent):void
{
var latlngClicked:LatLng = e.latLng;
polyLatLngs.push(latlngClicked);
drawCoordinates();
}
function nextPoly(e:Event):void
{
polyShape = null;
polyLatLngs.length = 0;
}
function toggleDrawMode(e:Event):void
{
map.clearOverlays();
polyShape = null;
drawCoordinates();
}
function drawCoordinates():void
{
if (polyLatLngs.length > 1)
{
polygonMode = drawmode_polygon.selected;
if (polygonMode)
{
polyShape = new Polygon(polyLatLngs,
new PolygonOptions({
strokeStyle: new StrokeStyle({
color: 0x0000ff,
thickness: 10,
alpha: 0.7}),
fillStyle: new FillStyle({
color: 0x0000ff,
alpha: 0.7})
}));
}
else
{
polyShape = new Polyline(polyLatLngs, new PolylineOptions({ strokeStyle: new
StrokeStyle({
color: 0xFF0000,
thickness: 4,
alpha: 0.7})
}));
}
var pane1:IPane = map.getPaneManager().createPane(1);
pane1.addOverlay(polyShape);
}
}
Think that should work just fill in your colors (can use a ComboBox and it's
selectedItem for this task or whatever other UI you build). If this doesn't
work out let me know and I'll make a test app.
Shaun
--
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en.