@amedia/atlas-js
Lightweight client for Atlas geographic data services. Works in browsers, edge runtimes, and Node.js.
Install
npm install @amedia/atlas-js
Usage
import { AtlasClient } from '@amedia/atlas-js';
const atlas = new AtlasClient({
baseUrl: 'https://services.api.no/api/atlas-ng/v1'
});
const { entities } = await atlas.get('municipalities', { q: '0301' });
const resolved = await atlas.graph('municipalities', '0301',
'code,name,sitekeys:publication(name,domain)'
);
const expanded = await atlas.getExpanded('municipalities', {
embed: '(sitekeys:publication(name,domain))'
});
const result = await atlas.pip(59.9127, 10.7461);
const fc = await atlas.featureCollection('municipalities', {
code: '0301',
size: 'small'
});
API
new AtlasClient(options)
baseUrl — Atlas API base URL
version — Data version (default: 'latest')
.get(endpoint, params) → AtlasResponse
.getExpanded(endpoint, params) → T[] (embed + auto-expand)
.graph(endpoint, code, graphQuery) → T[] (in-place resolution)
.featureCollection(type, params) → GeoJSON
.query(request) → QueryService response
.pip(lat, lon) → QueryService response (shorthand)
expandEmbed(response) → T[]
Standalone function to expand _embedded references inline.