Polygon
Polygon(polygon)
Description
Create a custom polygon to enter coordinate values(at least 3 points), colors and transparency.
Parameter
polygon : object
Name | Description | Parameter | Optional |
---|---|---|---|
paths | Set the paths. | number | must |
fillColor | specifies a hexadecimal HTML color of the format "#FFFFFF". The Polygon class does not support named colors. | hex | optional Default '#000000'(black) |
fillOpacity | specifies a numerical value between 0.0 and 1.0 to determine the opacity of the fill's color. The default is 1.0. | number | optional Default 1.0 |
Example
let triangleCoords = [
{lat: 25.774, lng: -80.190},
{lat: 18.466, lng: -66.118},
{lat: 32.321, lng: -64.757},
{lat: 25.774, lng: -80.190}
];
let bermudaTriangle = new fatosmap.maps.Polygon({
paths: triangleCoords,
fillColor: '#FF0000',
fillOpacity: 0.35
});
bermudaTriangle.setMap(mapInstance);
removePolygon(null)
Description
Clears the polygon drawn on the map.
Example
bermudaTriangle.setMap(null)