The Web SDK v1 support ended on March 31, 2026. We will no longer be providing any support for Web SDK v1. Please migrate to our Web SDK v2 for new features and improvements, and continued support.
This documentation provides setup guide for ola maps web SDK v1 only.
Please migrate to
Web SDK v2for new features and improvements.
Setup
CDN Usage
Inject the minified script into your app using script tag
<script src="https://www.unpkg.com/olamaps-web-sdk@latest/dist/olamaps-web-sdk.umd.js"></script>
Using Package Manager
Install via npm
npm i "olamaps-web-sdk@^1.1.0 <1.2.0"
Import
OlaMaps class
import { OlaMaps } from 'olamaps-web-sdk'
If you are using Next.js then import sdk as below.
import('olamaps-web-sdk').then((module) => {
const { OlaMaps } = module
// initialize and render map here
})
Initialization
Get
Api Key from credentials and initialize
OlaMapsconst olaMaps = new OlaMaps({
apiKey: [YOUR_API_KEY],
})
Call
init method to render the map
const myMap = olaMaps.init({
style: [ADD THE LINK OF TILES STYLE JSON HERE],
container: [MAP CONTAINER ID],
center: [INITIAL LAT LAN POSITION],
zoom: [SET ZOOM NUMBER]
})
If you encounter any issues while integrating the SDK, please report them on our
GitHub Issues page.
Example
const myMap = olaMaps.init({
style: "https://api.olamaps.io/tiles/vector/v1/styles/default-light-standard/style.json",
container: 'map',
center: [77.61648476788898, 12.931423492103944],
zoom: 15,
})
If you want to render multilingual maps in local languages, check the languages we support in style json in vector map tiles APIs. You need to add
-[LANGUAGE CODE] to
styleName.
const myMap = olaMaps.init({
style: "https://api.olamaps.io/tiles/vector/v1/styles/default-light-standard-mr/style.json",
container: 'map',
center: [77.61648476788898, 12.931423492103944],
zoom: 15,
})
To initialize 3d maps, we need to use additional parameter 'mode' and need to give the tileset endpoint.
const olaMaps3D = new OlaMaps({
apiKey: [YOUR_API_KEY],
mode: "3d",
threedTileset: "https://api.olamaps.io/tiles/vector/v1/3dtiles/tileset.json",
})
const myMap = olaMaps.init({
style: "https://api.olamaps.io/tiles/vector/v1/styles/default-light-standard/style.json",
container: 'map-3d',
center: [72.84185896191035, 19.04116993331655],
zoom: 15,
})