umap-client
JavaScript client for consuming data from uMap.
API
Create a new client:
const client = new UmapClient(); // targets umap.openstreetmap.fr by default
You can also specify the instance of uMap:
const client = new UmapClient("https://framacarte.org");
Methods
The client only supports reading public data for now.
search
Search maps on the instance:
const results = await client.search("paris");
userMaps
Gets maps from a user:
const maps = await client.userMaps("mauricesvay");
geojson
Get data for a map:
const map = await client.geojson("647993");
dataLayer
Get data for a map layer:
const dataLayer = await client.dataLayer("2326451");
dataLayerVersions
Get versions of a data layer:
const versions = await client.dataLayerVersions("2326451");
ajaxProxy
Get external data through the AJAX proxy:
const externalData = await client.ajaxProxy(
"https://overpass-api.de/api/interpreter?data=..."
);
pictogramJson
Get available icons:
const icons = await client.pictogramJson();