Installation
How to install and set up the Ola Map SDK
Installation Guide
This guide will help you install and set up the Ola Map SDK in your Node.js project.
Installation
Using npm
Install the SDK using npm:
npm install ola-map-sdkUsing yarn
Alternatively, you can use yarn:
yarn add ola-map-sdkNext Steps
Now that you have the SDK installed, you'll need to:
- Get your API key - Obtain your Ola Maps API key
- Initialize the client - Create your first API client instance
- Explore the API - Learn about available endpoints
Optional: MapLibre GL Integration
If you plan to display maps, you'll also need MapLibre GL:
npm install maplibre-glLearn more about displaying maps with MapLibre.
Troubleshooting
Installation Issues
If you encounter installation issues:
- Clear your npm cache:
npm cache clean --force - Delete
node_modulesandpackage-lock.json - Reinstall:
npm install
Version Compatibility
Make sure you're using compatible versions:
# Check your Node.js version
node --version
# Check installed SDK version
npm list ola-map-sdkTypeScript Support
While the SDK is written in JavaScript, you can use it in TypeScript projects:
// @ts-ignore
import OlaMapsClient from 'ola-map-sdk';
// or
const OlaMapsClient = require('ola-map-sdk');TypeScript type definitions are planned for a future release.