Documentation menu
Developer guides

Ola Maps Web SDK v2 - Adding Shapes (Polylines & Polygons)

This documentation provides methods for adding polyline and polygons in map.

Adding Polyline

Add a GeoJSON line to map using addSource map method and style it using addLayer’s paint properties.

Example

Adding Polygon

Add a GeoJSON polygon to map using addSource map method and style it using addLayer’s paint fill layer properties.

Example