I am trying to build a custom map widget in Thingsboard using Here Maps API for JavaScript, as a base map for IoT device reporting on an interactive map. The code comes back as no error, but it does not load.
I am new to JavaScript and APIs. So I'm obviously missing something.
I have exhausted the HERE Maps API examples and have tried with no luck to find an answer on any forum.
function loadMap() {
var platform = new H.service.Platform({
'apikey': 'APIKEY_HERE'
});
var defaultLayers = platform.createDefaultLayers();
var map = new H.Map(
document.getElementById('mapContainer'),
defaultLayers.vector.normal.map, {
zoom: 14,
center: {
lat: 13.72,
lng: 100.56
}
});
}
function addCircleToMap(map) {
map.addObject(new H.map.Circle(
// The center or the circle will be on
// latitude 13.72 longitude 100.56
[13.7230949, 100.5699041],
// The radius of the circle in meters
200,
{
pen: {
strokeColor: '#4287f5', // Color of the perimeter
lineWidth: 2
},
brush: {
color: '#42ddf5' // Color of the circle
}
}
));
}
No error messages, just a widget that never loads, spinning orange circle as a result.