I'm getting the following Javascript error when creating an Azure Map.
Uncaught TypeError: r[t].indexOf is not a function
at Dt (atlas.min.js:55)
at t.Vt.on (atlas.min.js:55)
at t.on (atlas.min.js:55)
at new t (atlas.min.js:55)
at new sv (atlas.min.js:55)
at GetMap (Maps.js?v=lM_CblvOkwj6DcuCQr8DIa0BiL0oTcqyIVINzcIWbKM:69)
My JS function:
function GetMap(lat, lon) {
map = new atlas.Map('Map', {
center: [lon, lat],
zoom: 14,
view: 'Auto',
authOptions: {
authType: 'subscriptionKey',
subscriptionKey: subscriptionKey,
getToken: function (resolve, reject, map) {
var tokenServiceUrl = "https://azuremapscodesamples.azurewebsites.net/Common/TokenService.ashx";
fetch(tokenServiceUrl).then(r => r.text()).then(token => resolve(token));
}
}
});
marker = new atlas.HtmlMarker({
htmlContent: '<div class="pulseIcon"></div>',
position: [lon, lat],
draggable: true
});
map.markers.add(marker);
}
The issue on the creation of the map object
map = new atlas.Map('Map', {
Any ideas why this is happening?