Initialize the Map
When the source is connected to the HTML page, you can instantiate Platform
. This defines the credentials and environment for HERE services including the Geovisualization REST API. We recommend you enable secure connections and use the HERE CIT environment. Find more details on the difference between CIT and production here.
var platform = new H.service.Platform({
app_id: '{YOUR_APP_ID}',
app_code: '{YOUR_APP_CODE}',
useCIT: true,
useHTTPS: true
});
Often your visualization will have more contrast on the dark base map scheme with reduced detail level. To use a dark scheme, create a baseLayer
:
var baseLayer = platform.getMapTileService({type: 'base'}).createTileLayer(
'maptile',
'reduced.night',
256,
'png'
);
When platform
and baseLayer
are configured you can instantiate the map
view:
var map = new H.Map(
document.getElementById('map'),
baseLayer,
{
pixelRatio: 1,
center: new H.geo.Point(40.769832, -73.974726),
zoom: 14
}
);