function moveMapToBerlin(map){
map.setCenter({lat:52.5159, lng:13.3777});
map.setZoom(14);
}
const APP_ID='s6EH3Yleef6Gfi3tlIsC'
const APP_CODE='9Pu-bKeM-3um0HOJvblSQg'
/**
* Boilerplate map initialization code starts below:
*/
// Step 1: initialize communication with the platform
// In your own code, replace window.app_id with your own app_id
// and window.app_code with your own app_code
var platform = new H.service.Platform({
app_id: APP_ID,
app_code: APP_CODE,
useCIT: true,
useHTTPS: true
});
const nptBaseLayerProvider = new H.map.provider.ImageTileProvider({
// We have tiles only for zoom levels 12–15,
// so on all other zoom levels only base map will be visible
min: 0,
max: 20,
tileSize: 512,
getURL: function (column, row, zoom) {
return `https://1.base.maps.api.here.com/maptile/2.1/mapnopttile/newest/normal.night/${zoom}/${column}/${row}/512/png8?app_id=${APP_ID}&app_code=${APP_CODE}&ppi=320`
}
})
const nptBaseLayer = new H.map.layer.TileLayer(nptBaseLayerProvider, { opacity: 0.7 })
var defaultLayers = platform.createDefaultLayers();
//Step 2: initialize a map - this map is centered over Europe
var map = new H.Map(document.getElementById('map'),
defaultLayers.normal.xbasenight,
{
center: {lat:52.5126, lng:13.3979},
zoom: 14,
pixelRatio: window.devicePixelRatio,
// renderBaseBackground: {lower: 0, higher: 0}
}
);
map.addLayer(nptBaseLayer)
// 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,...
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.