Polygon
ThePolygon component draws filled polygons on the map. Supports custom styling and holes for complex shapes.
Props
Array<{ lat: number; lng: number }>
required
Array of coordinates defining the polygon boundary. The polygon automatically closes between the last and first point.
Array<Array<{ lat: number; lng: number }>>
Optional array of hole polygons (areas to cut out from the main polygon)
object
Polygon styling options
Basic Usage
Styled Polygon
Polygon with Hole
Create a donut-shaped polygon by defining holes:Multiple Polygons
Interactive Polygons
Dashed Border
Use Cases
Zones
Define delivery zones, service areas
Properties
Show property boundaries and parcels
Regions
Highlight geographic regions or districts
Coverage
Display coverage or accessibility areas
Drawing Complex Shapes
Circle (Approximate)
Performance Tips
Simplify complex polygons
Simplify complex polygons
Use polygon simplification algorithms for shapes with many vertices. Reduce detail for lower zoom levels.
Limit holes
Limit holes
Multiple holes can impact performance. Consider breaking complex shapes into multiple simpler polygons.
Visibility culling
Visibility culling
Don’t render polygons that are completely outside the visible map bounds.
See Also
Polyline
Draw lines without fill
Marker
Add markers to polygon vertices
Examples
Interactive examples