npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ola-map-sdk

v1.3.0

Published

Complete Ola Maps API SDK for Node.js — Places, Routing, Roads, Geofencing, Elevation, Tiles

Readme

Ola Map SDK

Complete Ola Maps API client for Node.js. Covers all endpoints — Places, Routing, Roads, Geofencing, Elevation, and Tiles.

Installation

npm install ola-map-sdk

Quick Start

const OlaMapsClient = require('ola-map-sdk');
// or: import OlaMapsClient from 'ola-map-sdk';

const client = new OlaMapsClient('YOUR_API_KEY');

// Search for places
const results = await client.places.autocomplete('Koramangala, Bangalore');

// Get directions
const route = await client.routing.getDirections(
    { lat: 12.993103, lon: 77.543326 },
    { lat: 12.972006, lon: 77.580085 }
);

API Reference

Places

// Autocomplete
const results = await client.places.autocomplete('Bangalore', {
    location: '12.93,77.61', radius: 5000, language: 'en'
});

// Geocode & Reverse Geocode
const geo     = await client.places.geocode('Taj Mahal, Mumbai');
const reverse = await client.places.reverseGeocode(26.115103, 91.703239);

// Place Details
const details    = await client.places.placeDetails('ola-platform:5000039498427');
const advDetails = await client.places.placeDetailsAdvanced('ola-platform:5000039498427');

// Nearby Search
const nearby    = await client.places.nearbySearch('12.93,77.61', { types: 'restaurant', radius: 1000 });
const nearbyAdv = await client.places.nearbySearchAdvanced('12.93,77.61', { types: 'cafe' });

// Text Search
const text = await client.places.textSearch('Cafes in Koramangala');

// Address Validation
const validation = await client.places.addressValidation('7, Lok Kalyan Marg, New Delhi');

// Place Photo
const photo = await client.places.photo('photo_reference_id');

Routing

// Directions (with options)
const directions = await client.routing.getDirections(
    { lat: 12.993103, lon: 77.543326 },
    { lat: 12.972006, lon: 77.580085 },
    { mode: 'driving', steps: true, overview: 'full', traffic_metadata: true }
);

// Directions Basic (no traffic)
const basic = await client.routing.getDirectionsBasic(
    { lat: 12.993103, lon: 77.543326 },
    { lat: 12.972006, lon: 77.580085 }
);

// Distance Matrix
const matrix = await client.routing.getDistanceMatrix(
    '12.993,77.543|12.972,77.580', '12.935,77.615', { mode: 'driving' }
);

// Distance Matrix Basic
const matrixBasic = await client.routing.getDistanceMatrixBasic(
    '12.993,77.543', '12.935,77.615'
);

// Route Optimizer
const optimized = await client.routing.routeOptimizer(
    '12.993,77.543|12.972,77.580|12.935,77.615',
    { source: 'first', destination: 'last' }
);

// Fleet Planner
const fleet = await client.routing.fleetPlanner(
    { packages: [...], vehicles: [...] }, 'optimal'
);

Roads

const snapped = await client.roads.snapToRoad('12.999,77.673|12.992,77.658', true);
const nearest = await client.roads.nearestRoads('12.999,77.673|12.992,77.658', 'DRIVING', 500);
const speeds  = await client.roads.speedLimits('13.063,77.593|13.063,77.593');

Geofencing

// Create
const fence = await client.geofencing.create({
    name: 'Warehouse', type: 'circle', coordinates: [[12.931, 77.615]],
    radius: 100, status: 'active', projectId: 'my-project'
});

// Read, Update, Delete
const get    = await client.geofencing.getById('fence-id');
const update = await client.geofencing.update('fence-id', { name: 'Updated' });
const del    = await client.geofencing.deleteById('fence-id');

// List & Status Check
const list   = await client.geofencing.list('my-project', 1, 10);
const status = await client.geofencing.checkStatus('fence-id', '12.93,77.61');

Elevation

const elev  = await client.elevation.getElevation(12.93126, 77.61638);
const multi = await client.elevation.getMultiElevation(['12.93126,77.61638', '12.89731,77.65136']);

Tiles

const styles      = await client.tiles.getStyles();
const styleDetail = await client.tiles.getStyleDetail('default-light-standard');
const tileJSON    = await client.tiles.getDataTileJSON('planet');
const pbf         = await client.tiles.getPBFFile('planet', 14, 110, 1010);
const glyphs      = await client.tiles.getFontGlyphs('Noto Sans Bold', 0, 255);

// Static map images
const img  = await client.tiles.getStaticMapByCenter(
    'default-light-standard', 77.61, 12.93, 15, 800, 600, 'png',
    { marker: '77.61,12.93|red' }
);
const bbox = await client.tiles.getStaticMapByBBox(
    'default-light-standard',
    { minx: 77.5, miny: 12.9, maxx: 77.7, maxy: 13.0 }, 800, 600, 'png'
);
const auto      = await client.tiles.getStaticMapAuto('default-light-standard', 800, 600, 'png');
const tileset3d = await client.tiles.get3DTileset();

Map Display (with MapLibre GL)

The SDK includes helper methods to simplify MapLibre GL integration. Install maplibre-gl alongside:

npm install maplibre-gl

Using getMapOptions() (recommended)

import maplibregl from 'maplibre-gl';
import 'maplibre-gl/dist/maplibre-gl.css';
import OlaMapsClient from 'ola-map-sdk';

const client = new OlaMapsClient('YOUR_API_KEY');

// One-liner — handles style URL + API key injection automatically
const map = new maplibregl.Map(client.getMapOptions({
    container: 'map',
    style: 'default-light-standard',
    center: [77.61, 12.93],
    zoom: 14,
}));

Individual helpers

// Get the full style URL
client.getStyleURL('default-dark-standard');
// → "https://api.olamaps.io/tiles/vector/v1/styles/default-dark-standard/style.json"

// Get a pre-configured transformRequest function
const transformRequest = client.getTransformRequest();

// Switch styles at runtime
map.setStyle(client.getStyleURL('eclipse-light-standard'));

Available map styles

| Category | Styles | |---|---| | Default Light | default-light-lite, default-light-standard, default-ultra-light-standard, default-light-full + 11 language variants | | Default Dark | default-dark-lite, default-dark-standard, default-dark-full, default-dark-standard-satellite + language variants | | Eclipse | eclipse-light-lite, eclipse-light-standard, eclipse-light-full, eclipse-dark-lite, eclipse-dark-standard, eclipse-dark-full | | Bolt | bolt-light, bolt-dark | | Vintage | vintage-light, vintage-dark | | Earth | default-earth-lite, default-earth-standard, default-earth-full | | OSM | positron, osm-bright, osm-basic, dark-matter, fiord-color, silver-osm |


License

MIT © Kunal Kongkan Kashyap