/**
* Adds a polygon to the map.
*Points - A list or array of LatLng points.
*StrokeWidth - Stroke width.
*StrokeColor - Stroke color.
*FillColor - Inner color.
*Opacity - Inner color opacity. Value between 0 to 1.
*/
public PolygonWrapper AddPolygon(List Points, float StrokeWidth, Paint StrokeColor, Paint FillColor, double Opacity)
{
PolygonOptions po = new PolygonOptions();
po.strokeWeight(StrokeWidth);
po.fillColor(htmlColor(FillColor));
po.strokeColor(htmlColor(StrokeColor));
po.fillOpacity(Opacity);
boolean eventExist = ba.subExists(eventName + "_polygonclick");
if (eventExist == false)
po.clickable(false);
po.paths(new MVCArray(Points.getObject().toArray()));
Polygon gon = new Polygon(po);
map.addMapShape(gon);
if (eventExist) {
map.addUIEventHandler(gon, UIEventType.click, new UIEventHandler() {
@Override
public void handle(JSObject obj) {
ba.raiseEventFromUI(GoogleMapWrapper.this, eventName + "_polygonclick",
(PolygonWrapper)AbsObjectWrapper.ConvertToWrapper(new PolygonWrapper(), gon));
}
});
}
return (PolygonWrapper)AbsObjectWrapper.ConvertToWrapper(new PolygonWrapper(), gon);
}