• HOME
  • PRODUCTS
  • PRICING
    • DOCUMENTATION
    • API REFERENCES
  • SUPPORT
  • OLA FOR ONDC
SIGN IN
    Overview
  • Authentication
  • Multilingual Language Support
  • Routing APIs
    • Directions API
    • Directions Basic API
    • Distance Matrix API
    • Distance Matrix Basic API
    • Route Optimizer API
    • Fleet Planner API
  • Roads APIs
    • Snap To Road API
    • Nearest Roads API
    • Speed Limits API
  • Places APIs
    • Autocomplete API
    • Place Details API
    • Advance Place Details API
    • Nearby Search API
    • Advance Nearby Search API
    • Photo API
    • Text Search API
    • Address Validation API
    • Geofencing API
    • Elevation API
  • Geocoding
    • Geocoding API
    • Reverse Geocoding API
  • Map Tiles
    • 2D Tiles
      • Overview
      • Vector Tiles API
      • Static Tiles API
    • 3D Tiles
      • Overview and Integration
    • Style Editor
  • Navigation SDKs
    • Navigation SDK - Android
    • Navigation SDK - iOS
  • Map SDKs
    • Map SDK - iOS
    • Map SDK - Android
  • Places SDKs
    • Places SDK - Android
    • Places SDK - iOS
  • Web SDK
    • V2 (Recommended)
      • SDK Setup
      • Adding Markers
      • Events & Controls
      • Static Maps
      • Geolocation
      • Adding Shapes
      • Marker Clustering
      • Heatmap Layer
      • Ground Overlays
      • Custom Overlays
    • V1
      • SDK Setup
      • Adding Markers
      • Events & Controls
      • Static Maps
      • Geolocation
      • Adding Shapes
      • Marker Clustering
      • Heatmap Layer
      • Ground Overlays
      • Custom Overlays
  • Ola Maps MCP
    • MCP Overview
    • Ola Maps MCP Server
  • Street View

Adding Shapes in map

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

  • Get in Touch
  • Privacy Policy
  • Terms and Conditions
  • Cookie Policy
  • Fair Usage Policy

© 2025 Ola Maps. All Rights Reserved.