Polygon class
November 30, 2018 ยท View on GitHub
this.map.addPolygon(options: PolygonOptions).then((polygon: Polygon) => {
});
API Reference
Instance methods
-
getId()
Returns the ID of instance.
:arrow_right: Returns
string -
getMap()
Return the map instance.
:arrow_right: Returns GoogleMap instance.
-
setPoints(points)
Changes the polygon points.
Params Type Details points Array<ILatLng> new position -
getPoints()
Returns an instance of the BaseArrayClass. You can modify the points.
:arrow_right: Returns BaseArrayClass<ILatLng>.
-
setHoles(holes)
Changes the polygon holes.
Params Type Details holes ILatLng[][] new holes -
getHoles()
Returns an instance of the BaseArrayClass. You can modify the points.
:arrow_right: Returns BaseArrayClass<ILatLng[]>.
-
setGeoDesic(geoDesic)
When true, edges of the polygon are interpreted as geodesic and will follow the curvature of the Earth.
Params Type Details geoDesic boolean true or false -
getGeodesic()
Returns true if the polygon is geodesic
:arrow_right: Returns
boolean. -
setStrokeWidth(strokeWidth)
Changes the stroke width.
Params Type Details strokeWidth number stroke width in pixel -
getStrokeWidth()
Returns the current stroke width (unit: pixel).
:arrow_right: Returns
number. -
setStrokeColor(color)
Changes the polygon color
Params Type Details color string HTML color strings -
getStrokeColor()
Returns the current stroke color.
:arrow_right: Returns
string. -
setFillColor(color)
Changes the filling color (inner color).
Params Type Details color number HTML color strings -
getFillColor()
Returns the current polygon filling color (inner color).
:arrow_right: Returns
string. -
setClickable(clickable)
Changes click-ability of the polygon
Params Type Details clickable boolean true or false -
getClickable()
Returns true if the polygon is clickable.
:arrow_right: Returns
boolean. -
setVisible(clickable)
Set polygon visibility
Params Type Details visible boolean true or false -
getVisible()
Returns true if the polygon is visible.
:arrow_right: Returns
boolean. -
setZIndex(index)
Changes the polygon zIndex order.
Params Type Details index number z-index -
getZIndex()
Returns the current polygon zIndex.
:arrow_right: Returns
number. -
remove()
Remove the polygon.