I'm just starting with MapLibre and ESRI, and can't get it to recognize my api key.
My api key has basemap and basemap styles privileges.
With the simple tutorial code
apiKey = '<api key>';
const map = new maplibregl.Map({
container: "map", // the id of the div element
zoom: 2, // starting zoom
center: [-20, 30] // starting location [longitude, latitude]
});
const basemapStyle = maplibreArcGIS.BasemapStyle.applyStyle(map, {
style: "arcgis/outdoor",
token: apiKey
});
It generates url
https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/styles/arcgis/outdoor?f=json&echoToken=false&token=AAPT
But returns 401 / invalid_token error. The key is valid. Any ideas on how to debug this?