HERE Map Tile v2 Developer's Guide

Metainfo with POIs

The user wants to make POIs on the map interactive; for example, by offering several options to have the map display additional information. This requires obtaining metadata information about an image showing a map tile that includes POIs.

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

Original Map Tile

This request obtains a map tile with a POI:

https://2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day/19/281563/171971/256/png8
?apiKey={YOUR_API_KEY}
&pois

The response contains a POI - Zoological Garden in Berlin:

Figure 1. Map Tile with POI

The following request obtains more information about this map tile:

Metainfo Tile Request

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/normal.day/19/281563/171971/256/png8
?apiKey={YOUR_API_KEY}
&metadata=metaonly
&mgen=2
&pois

Processing Metainfo Tile Response

In this request, the query parameter metadata specifies that the response is to contain only metadata and the query parameter mgen specifies what metainfo is in the response.

{
  "metadata": {
    "street labels":[ ... ],
    "labels":[ ... ],
    "city center labels":[],
    "buildings":[  ],
    "transit stops":[  ],
    "POIs":[
      {  
        "name":"Zoological Garden",
        "geoposition":{"latitude":52.508211, "longitude":13.334570},
        "bounding boxes":[
          {
            "box 1":[ 217, 35.75, 14, 14 ]
          }, 
          {
            "box 2":[ 199.86, 13.75, 48.28, 20.50 ]
          }
        ],
        "info":[
          {
            "PLACE NAME":"Zoological Garden",
            "PLACE PHONE NUMBER":"+(49)-30-254010",
            "PLACE CATEGORY":"Tourist Attraction",
            "PLACE ID":"50668488"
          }
        ]
      }
    ]
  }
}
  

This information allows you to locate the icon and label of a POI in order to make them interactive. For this, you can use elements of the bounding boxes array: box 1 describes a bounding box for the icon, box 2 describes a bounding box for the text label.

The geoposition object of the metainfo JSON object provides the geocoordinates of the POI. These can be used to obtain the address of POI, for example for Reverse Geocoding:
http://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.xml
?apiKey={YOUR_API_KEY}
&gen=7
&prox=52.508211135864258,13.334569931030273,100
&mode=retrieveAddresses
<Address>
<Label>Hardenbergplatz, 10623 Berlin, Deutschland</Label>
<Country>DEU</Country>
<State>Berlin</State>
<County>Berlin</County>
<City>Berlin</City>
<District>Charlottenburg</District>
<Street>Hardenbergplatz</Street>
<PostalCode>10623</PostalCode>
<AdditionalData key="CountryName">Deutschland</AdditionalData>
<AdditionalData key="StateName">Berlin</AdditionalData>
</Address>
It is possible to display additional information related to POIs (for example, by means of an info bubble). This information is provided by the info JSON object:
  • name (PLACE NAME attribute)
  • category (PLACE CATEGORY attribute)
  • phone number (PLACE PHONE NUMBER attribute)
  • place id (PLACE ID attribute)