Migration from MapTile v2 to Raster Tile v3
How to do in MapTile v2
Since we know that since JS SDK 3.1.40.0 the Map Tile v2 service has been deprecated. Following was the way we use to initialize the service: // Assumption: the platform is instantiated var mapTiler = platform.getMapTileService({type: 'base'}),
tileLayer = mapTiler.createTileLayer('maptile', 'hybrid.day', 256, 'jpg'); map.setBaseLayer(tileLayer);
Now as a successor to Map Tile v2 there is a need to migrate the solution to Raster Tile v3.
How to do in RTS v3//Assumption: the platform is instantiated var engineType = H.Map.EngineType['HARP']; var defaultLayers = platform.createDefaultLayers({
engineType: engineType,
pois: true,
tileSize: devicePixelRatio > 1 ? 512 : 256,
ppi: devicePixelRatio > 1 ? 320 : 72 });const rasterTileService = platform.getRasterTileService({
queryParams: {
lang: 'th',
lang2:'vi',
ppi: 400,
style: 'explore.day',
features: 'pois:all,environmental_zones:all,congestion_zones:all'
}, });const rasterTileProvider = new H.service.rasterTile.Provider(rasterTileService, {
engineType: H.Map.EngineType.HARP,
tileSize: 512 }); const rasterTileLayer = new H.map.layer.TileLayer(rasterTileProvider);<br />Please see the attached code snippet for the complete example including modifying the uiControls. <br />For documentation around RTS v3, please visit this link<br />