Documentation menu
Developer guides

Ola Maps Web SDK v2 - Adding Static Maps

This documentation provides methods for adding static maps in web sdk
Add a HTML img element and give id to that element.
<img id='[MAP ID]' />
Go to Map Tiles APIs, generate URL of the map you want to add from Static Map Tiles and copy the Request URL.
Use getStaticMap method to render a static map and pass the request URL and element id.
olaMaps.getStaticMap('[STATIC MAP URL]','MAP ID')

Example

Static map
olaMaps.getStaticMap(
  'https://api.olamaps.io/tiles/v1/styles/default-light-standard/static/77.61,12.93,15/800x600.png?marker=77.61%2C12.93%7Cred%7Cscale%3A0.9&path=77.61%2C12.93%7C77.61190639293811%2C12.937637130956137%7Cwidth%3A6%7Cstroke%3A%2300ff44&api_key=[API_KEY]',
  'static-map',
)