itemForPolygon(overlay, geoJSON)
Overrides a polygon.
Declaration
itemForPolygon?(
overlay: PolygonOverlay,
geoJSON: GeoJSONTypes.Polygon,
): PolygonOverlay | null;Parameters
- overlay:
You can customize the provided overlay before returning it, or you can completely replace the overlay.
- geoJSON:
The original GeoJSON object for the polygon.
Return Value
A map item or an array of map items.
Discussion
MapKit JS calls this method for each individual polygon geometry object. The framework breaks MultiPolygon geometry types into individual polygon types.
See Also
Overriding items
itemForFeature(item, geoJSON)itemForFeatureCollection(itemCollection, geoJSON)itemForLineString(overlay, geoJSON)itemForMultiLineString(itemCollection, geoJSON)itemForPoint(coordinate, geoJSON)itemForMultiPoint(itemCollection, geoJSON)itemForMultiPolygon(itemCollection, geoJSON)styleForOverlay(overlay, geoJSON)