HERE Map Tile v2 Developer's Guide

Metainfo with Labels

The user wants to make labels on the map interactive to offer, for example, several options for having the map display additional information. This requires obtaining metadata information about an image showing a map tile that includes different kinds of labels.

Note: These example use a HERE API Key to authenticate your request. For the available authentication options, see the Identity & Access Management Developer Guide.

Mountain Peak Labels Request

The first request obtains a tile with the mountain peak labels of Vesuvius Volcano in Italy:

https://2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day/17/70789/49227/256/png8
?apiKey={YOUR_API_KEY}

Mountain Peak Labels Response

The response delivers the following image:

Figure 1. Map Tile with Mountain Peak Label

Pedestrian Point Labels Request

In this request, the pedestrian.day scheme obtains the pedestrian point labels in Kiev:

https://2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/pedestrian.day/19/306646/176817/256/png8
?apiKey={YOUR_API_KEY}

Pedestrian Point Labels Response

The response to the request delivers the following image:

Figure 2. Map Tile with Pedestrian Point Label

The code block below demonstrates a complete request for a metadata map tile:

https://2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/pedestrian.day/19/306646/176817/256/png8
?apiKey={YOUR_API_KEY}
&metadata=metaonly
&mgen=2

Unclassified Labels

Objects on the map tiles that have other kinds of labels are for example:

  • land use objects (parks)
  • hydro labels (oceans, seas, rivers, lakes)
  • country or continent names

Label Type and Icon

Adding the query parameters metadata and mgen to the requests above obtains the information required to locate a label in order to make it interactive.

The response is a metadata JSON object with labels that specifies the label type using the type attribute (MOUNTAIN_PEAK for a mountain peak label in the code example below) The box 1 array for the label icon in the format [x, y, width, height] represents the icon's bounding box. box 2 represents the bounding box for the text label in the same format.

{
  "metadata": {
    "street labels": [],
    "labels": [
      {
        "name": "Mount Vesuvius",
        "type": "MOUNTAIN_PEAK",
        "bounding boxes": [
          {
            "box 1":[ 106, 226.80, 10, 10 ]
          }, 
          { 
            "box 2":[ 90, 195.80, 41.53, 31 ] 
          }
        ],
    "city center labels": [],
    "buildings": [],
    "transit stops": [],
    "POIs": []
  }
}
  
Note: The type attribute also specifies pedestrian labels (PEDESTRIAN_POINT) and unclassified labels (TEXT). But since pedestrian labels do not have a text label and unclassified labels do not have an icon, label contains only a representation of one label (box 1) for these label types.