ラスタマップタイプ

The Maps API for JavaScript provides an easy way to use the HERE Raster Tile API, which provides map images in a large choice of styles. In this respect, the Maps API for JavaScript acts as a flexible access facilitator, giving you, as a developer, not only a means to retrieve the basic map tile sets, but also the full selection of all the possible map styles provided by the HERE Raster Tile API. All map types mentioned in this section are compatible both with the with the WebGL, Harp and P2D rendering engines.

You can create a raster map by using the Maps API for JavaScript in several ways, depending on your use case and the required level of map customization.

  • createDefaultLayers() method - This is a straightforward and quick method to get default raster map layers for different map types, in use cases which do not require map customization, for example, by adding custom layers of information, markers, points of interest, and so on.

  • Custom raster tile service - This method provides more flexibility if you need specific configurations or map styles beyond the predefined defaults.

createDefaultLayers() method

The H.service.Platform object provides a convenient method called createDefaultLayers() to obtain predefined default map layers.

The method automatically creates default layers for different map types, such as normal (day), satellite, terrain, and so on. This method abstracts the complexity of manually setting up a raster tile service and provider, and eliminates the need to specify the map style, pixel per inch (ppi), or other parameters explicitly.

You can obtain the default layers by calling platform.createDefaultLayers() and getting the TileLayer instances for different map types.

The following figure shows some of the raster tile layers available as part of default layers in the Maps API for JavaScript:

Raster tile examples as part of the default map layers
Figure 1. Raster tile examples as part of the default map layers

For the list of the available raster tile layer types when using the default map layers, see the createDefaultLayers() method documentation in the API reference.

For a configuration example involving a default raster tile layer, see Render maps by using raster tiles.

Custom raster tile service

By using a custom raster tile service, you can tailor the map's appearance and behavior to match your application's design and requirements, providing a more unique and personalized map experience for your users.

Handling custom raster tile services might require more manual configuration and maintenance compared to using the predefined default layers provided by the createDefaultLayers() method. However, a custom raster tile service provides a wide range of customizations and control over the map's appearance and behavior.

For example, you can set the style, language, or geopolitical view of the map allowing you to display map information in different languages based on user preferences or your application's requirements. You can also change the tile size to customize the granularity and details displayed in each tile.

The following code prepares a custom raster tile service and a corresponding tile layer that you can add to your HERE map to display customized map tiles:

// Define the raster service
const rasterTileService = platform.getRasterTileService()
// Define the tile provider
const rasterTileProvider = new H.service.rasterTile.Provider(rasterTileService);
// Create a layer
const rasterTileLayer = new H.map.layer.TileLayer(rasterTileProvider);

The preceding example uses the default settings. To customize the tile service, you need to provide additional parameters to the platform.getRasterTileService() method.

For the list of available customizations available for custom raster tile services, see the Raster Tile API Developer Guide.

The following figure shows some example customizations available for custom raster tile services in the Maps API for JavaScript:

Raster tile examples as part of the default map layers
Figure 2. Raster tile examples as part of the default map layers

For a configuration example involving a custom raster tile service, see Render maps by using raster tiles.

」に一致する結果は 件です

    」に一致する結果はありません