HERE Maps API for JavaScript
Maps API for JavaScript Developer's Guide


The HERE Maps API for JavaScript provides an easy way to use the HERE Map 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 Map Tile API. All map types mentioned in this section are compatible both with the WebGL and HTML5 2D Canvas rendering engines.

Basic map types

To set the map style for a map easily, you can use the method createDefaultLayers() defined on the Platform class. The method returns an object that holds, besides vector map tiles, three different map types (normal, satellite and terrain), each containing a set of named layers (map, base, xbase, traffic, labels). The named layers represent different styles of the map type and can be directly assigned as base layers to the map.

The table below shows a list of the default map layers for each map type:

Table 1. Default map types provided by the HERE Maps API for JavaScript
  <---------------------------------------------- Map Type ---------------------------------------------->
Layer normal satellite terrain
transit N/A N/A

A map type layer can be referenced, using the standard JavaScript dot notation. For example, to indicate a transit map (layer) on a terrain map (type), you can write layers.raster.terrain.transit, where layers is the name of a variable holding the return value from Platform.createDefaultLayers().