Hi all,
I'm having an issue getting a polygon to fill when creating it
using .setPolyline.
I'm creating the polygon based on an array of markers...
here's the code:
public function makepolygon():void{
if (haspoly==true){
map.removeOverlay(polygon);
}
polygon = new Polygon([], new PolygonOptions({
strokeStyle: new StrokeStyle({color: 0x0000ff,thickness:
4,alpha: 0.2}),
fillStyle: new FillStyle({color: 0xaaaaff,alpha: 0.9})}));
for(var i=0;i<markerarray.length;i++){
var second:int=i+1
if (second<markerarray.length){
coord1 = new
LatLng(markerarray[i].getLatLng().lat(),markerarray[i].getLatLng().lng());
coord2 = new
LatLng(markerarray[second].getLatLng().lat(),markerarray[second].getLatLng().lng());
polygon.setPolyline(i,[coord1,coord2]);
}else{
coord1 = new
LatLng(markerarray[i].getLatLng().lat(),markerarray[i].getLatLng().lng());
coord2 = new
LatLng(markerarray[0].getLatLng().lat(),markerarray[0].getLatLng().lng());
polygon.setPolyline(i,[coord1,coord2]);
map.addOverlay(polygon);
polygon.setOptions(new PolygonOptions({fillStyle: new
FillStyle({color: 0x222222,alpha: 0.9})}));
haspoly=true;
}
}
}
--
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.