A client library for accessing Azure Maps REST services (geolocation, search, routing, traffic, weather, timezone, etc.). Current stable version: 2.1.1 (released 2023). Released quarterly with bug fixes and API updates. Supports both Node.js (>=18) and browser environments. Ships TypeScript definitions. Key differentiators: fully typed, works with Azure Maps Web Control, supports both subscription key and Azure AD authentication. v2.x is ESM-only; CJS not supported. Be aware of breaking changes from v1.x: major async patterns and auth changes.
npm install azure-maps-restNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates ESM import, subscription key and AAD auth options, and basic address search using MapsSearch.
Switch to ESM import syntax. Use bundler or Node.js >=18 with type: 'module' in package.json.
Use `new atlas.SubscriptionKeyCredential(key)` or import from '@azure/identity' for AAD tokens.
Pass a credential (SubscriptionKeyCredential or Pipeline) to SearchURL constructor.
Check updated types: `response.results` directly (no `response.parsedBody` wrapper).
Use script tag CDN for quick browser test. For prod, bundle with webpack/rollup.
Update Node.js to >=18 or ensure bundler resolves 'module' field. Add to webpack resolve.mainFields: ['module', 'main'].
Use ESM import: `import { SubscriptionKeyCredential } from 'azure-maps-rest'`.Ensure you have internet connectivity and are using the correct endpoint. For cross-cloud (gov, China), set baseUrl in pipeline options.
Check `response.error` before destructuring. Use try-catch and inspect full response.