/**
* Moves the map to display over Berlin
*
* @param {H.Map} map A HERE Map instance within the application
*/
//42.0918905 13.3611389
function moveMapToBerlin(map){
//42.07098764905609, 13.358108593904555
map.setCenter({lat:42.07098764905609, lng:13.358108593904555});
map.setZoom(12);
}
/**
* Boilerplate map initialization code starts below:
*/
//Step 1: initialize communication with the platform
// In your own code, replace variable apikey with your own apikey
/***********************
//
//********* please set apiKey here *************/
window.apiKey = 'KW2udl_0sQ4zKUqARSm0IBrTCGt_8wh2yfzkTFpiluY';
//
/***********************/
var alertWarningUi = document.getElementById('alert-warning');
if(!apiKey){
alertWarningUi.style.display= 'block';
} else{
alertWarningUi.style.display = 'none';
}
var platform = new H.service.Platform({
apikey: window.apiKey
});
var defaultLayers = platform.createDefaultLayers();
//Step 2: initialize a map - this map is centered over Europe
var map = new H.Map(document.getElementById('map'),
defaultLayers.vector.normal.map,{
center: {lat:50, lng:5},
zoom: 4,
pixelRatio: window.devicePixelRatio || 1
});
// add a resize listener to make sure that the map occupies the whole container
window.addEventListener('resize', () => map.getViewPort().resize());
//Step 3: make the map interactive
// MapEvents enables the event system
// Behavior implements default interactions for pan/zoom (also on mobile touch environments)
var behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(map));
// Create the default UI components
var ui = H.ui.UI.createDefault(map, defaultLayers);
var dataPoints = [];
dataPoints.push(new H.clustering.DataPoint(42.0619483, 13.3724783));
dataPoints.push(new H.clustering.DataPoint(42.06191, 13.3725967));
dataPoints.push(new H.clustering.DataPoint(42.0940288, 13.3682179));
dataPoints.push(new H.clustering.DataPoint(42.0940261, 13.3682161));
dataPoints.push(new...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.