Metainfo with Road Signs
The user wants to make road signs 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 road signs.
Original Map Tile
This request obtains a map tile with a roadsign:
https://2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day/13/4410/2694/256/png8
?apiKey={YOUR_API_KEY}
The response contains a road sign for route A12 in Germany
:

The following request obtains more information about this map tile:
Metainfo Tile Request
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.
https://2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day/13/4410/2694/256/png8
?apiKey={YOUR_API_KEY}
&metadata=metaonly
&mgen=2
Processing Metainfo Tile Response
The response provides information that allows you to locate a road sign in order to make it interactive.
Road sign labels belong to the labels
array of the metadata JSON object ("type": "ROADSIGN"
). The box 1
array specifies the bounding box for a road sign icon in the following format: [x, y, width, height].
Additionally, the JSON object also provides the following information:
- country region
- road sign category
- route name
- route level
{
"metadata": {
"street labels": [],
"labels": [
{
"name": "12",
"type": "ROADSIGN",
"bounding boxes": [ { "box 1":[ 41.62, 71.52, 24, 18 ] } ],
"region": "DEU",
"category": 0,
"route name": "A12",
"route level": 2,
"uri": "http://image.maps.ls.hereapi.com/mia/1.6/roadsign?category=0®ion=DEU&label=A12&route_level=2&apiKey={YOUR_API_KEY}"
}
],
"city center labels":[],
"buildings": [],
"transit stops": [],
"POIs": []
}
}
Using the value of the uri
attribute from the above response body as a request obtains the related road sign icon:
http://image.maps.ls.hereapi.com/mia/1.6/roadsign
?category=0
®ion=DEU
&label=A12
&route_level=2
&apiKey={YOUR_API_KEY}

Filter Only Metainfo for Road Signs
Adding the parameter filter
to the request obtains only metainfo for road sign labels and excludes all other kinds of labels from the JSON response. This is useful in case of tiles that contain a lot of different labels as the one requested below:
https://2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day/11/1102/673/256/png8
?apiKey={YOUR_API_KEY}

If the request specifies "filter=1"
, this obtains only roadsign labels for the metadata tile:
https://2.base.maps.ls.hereapi.com/maptile/2.1/maptile/newest/normal.day/11/1102/673/256/png8
?apiKey={YOUR_API_KEY}
&metadata=metaonly
&mgen=2
&filter=1
The response include only information relevant to roadsign labels:
{
"metadata": {
"labels": [
{
"name": "12",
"type":"ROADSIGN",
"bounding boxes": [ { "box 1":[ 46.38, 110.68, 22, 16 ] } ],
"region": "DEU",
"category": 0,
"route name": "A12",
"route level": 2,
"uri": "http://image.maps.ls.hereapi.com/mia/1.6/roadsign?category=0®ion=DEU&label=A12&route_level=2&apiKey={YOUR_API_KEY}"
},
{
"name": "10",
"type":"ROADSIGN",
"bounding boxes": [ { "box 1":[ 7, 115.18, 22, 16 ] } ],
"region": "DEU",
"category": 0,
"route name": "A10",
"route level": 2,
"uri": "http://image.maps.ls.hereapi.com/mia/1.6/roadsign?category=0®ion=DEU&label=A10&route_level=2&apiKey={YOUR_API_KEY}"
}
]
}
}