Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ola-maps-node-sdk

Vishnurr2k0145ISC1.0.1TypeScript support: included

The OLA Maps SDK which uses clientId and clientSecret to generate Bearer token, provides a simple and intuitive interface for interacting with Ola Maps APIs, including Places and Routing functionalities. This SDK allows developers to easily integrate geoc

ola, ola maps, ola maps sdk, ola maps node, ola maps npm, maps, ola maps api, ola maps integration, maps integration, maps sdk, free maps, ola maps usage, integrate ola maps, npm ola maps, npm maps, npm ola

readme

OLA Maps

The OLA Maps SDK which uses clientId and clientSecret to generate Bearer token, provides a simple and intuitive interface for interacting with Ola Maps APIs, including Places and Routing functionalities. This SDK allows developers to easily integrate geocoding, reverse geocoding, autocomplete, and directions services into their applications.

This SDK supports auth with clientId and clientSecret. Get these from your ola-maps dashboard

Installation

Install the SDK using npm:

npm i --save ola-maps-node-sdk

Or using yarn:

yarn add ola-maps-node-sdk

Basic Example Usage

Create SDK

import {OlaMapsSDK} from 'ola-maps-sdk'

const options = {
    clientId:"YOUR_CLIENTID",
    clientSecret:"YOUR_CLIENT_SECRET"
}

const ola_map = new OlaMapsSDK(options);

Routing API's


ola_map.Routing.directions({
        lat: "18.76029027465273",
        long: "73.3814242364375"
    }, {
        lat: "18.73354223011708",
        long: "73.44587966939002"
    }).then(res=>console.log(res)).catch(err=>console.log(err))
// add optional params as per requirements

Places API's


ola_map.Places.geoCode("YOUR ADDRESS").then(res=>console.log(res)).catch(error=>console.log(error))

ola_map.Places.reverseGeocode("18.73354223011708","73.44587966939002").then(res=>console.log(res)).catch(error=>console.log(error))

ola_map.Places.autocomplete("kempegowda").then(res=>console.log(res)).catch(error=>console.log(error))

// add optional params as per requirements