How to customize map-with-custom-map-settings-ui-control to Satelite or Terrain View to render in Raster Tile V3?
As i am using Raster Tile V3 to render maps along with custom-map-settings-ui-control to render Satellite or Terrain view , But once i click on the list the service is invoking for deprecated service and breaking the maps to render to show Satellite or Terrain Maps.
Here is the code How its been Rendering :
//Step 1
var platform = new H.service.Platform({
'apikey': MapConfig.apikey()
});
//Step 2: initialize a map - this map is centered
var mapTileService = platform.getRasterTileService({
queryParams: {
lang: "en",
ppi: 400,
style: "explore.day",
},
});
var rasterTileProvider = new H.service.rasterTile.Provider(
mapTileService
);
var rasterTileLayer = new H.map.layer.TileLayer(rasterTileProvider);
var here_map = new H.Map(
document.getElementById(mapDivId),
rasterTileLayer,
{
zoom: zoomLevel,
pixelRatio: pixelRatio,
center: {lat:centerLat, lng:centerLng},
}
);
//Step 3: make the map interactive
behavior = new H.mapevents.Behavior(new H.mapevents.MapEvents(here_map));
// Create the default UI components
ui = H.ui.UI.createDefault(here_map, defaultLayers);
// Set the UI unit system to imperial measurement
ui.setUnitSystem(H.ui.UnitSystem.IMPERIAL);
//remove default mapsettings control
ui.removeControl("mapsettings");
// create custom one
var ms = new H.ui.MapSettingsControl( {
baseLayers : [ {
label:"Map View",layer:defaultLayers.raster.normal.map
},{
label:"Satellite",layer:**defaultLayers.raster.satellite.map**
}, {
label:"Terrain",layer:**defaultLayers.raster.terrain.map**
}
],
layers : [
{
label: "layer.incidents", layer: defaultLayers.vector.normal.trafficincidents
}
]
});
ui.addControl("customized",ms);
As soon as Either Satellite or Terrain is clicked defaultLayers.raster.satellite.map or defaultLayers.raster.terrain.map is breaking the maps and getting 429 error from network call.
The release notes of 3.1.63.0 (https://www.here.com/docs/bundle/maps-api-for-javascript-release-notes-3.1.63.0/resource/Maps_API_for_JavaScript_HLP_v3.1.63.0_Release_Notes.pdf) state:
Following the announced end-of-life of the HERE Location Services that are outside of HERE platform, the
following measures have been implemented:
With the WEBGL engine, all the layer entries in the "Map settings control" created via H.ui.UI.createDefault,
except for the vector base map, will be disabled as they make use of EOL services. Users are encouraged to
migrate based on their specific needs and requirements by choosing one of the following options:
1. Switch to the HARP engine
Please refer to the Migrate to the HARP engine page.
2. Create a custom H.ui.MapSettingsControl
The Map with custom MapSettings UI Control demo is available in our examples repository hosted
on GitHub.
Deprecated the whole H.service.extension namespace.
The following default layers were deprecated for WEBGL and P2D engines only:
raster.terrain.base
raster.terrain.map
raster.terrain.labels
The following default layers were deprecated for all the engines:
raster.terrain.xbase
raster.normal.transit