Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Revision as of 15:58, 3 January 2013 by jasfox (Talk | contribs)

HERE Maps API - Reading and displaying Map Features

From Wiki
Jump to: navigation, search
Article Metadata
Tested with
Devices(s): Google Chrome 20.0 x, Firefox 13.0
Dependencies: Nokia Maps 2.2.3
Keywords: Nokia Maps, JavaScript, features
Created: Maveric (27 Jun 2011)
Updated: avnee.nathani (18 Jan 2012)
Last edited: jasfox (03 Jan 2013)

This article features an example on how to read, display and load Map Features



This example uses the Nokia Maps API Feature manipulation functionality, described in the API Reference here:

Please check it out for detailed description on the subject.


Nokia Maps API supported web browser (basically any modern web browser will do).

Example code

This example loops through and displays all supported features/sets and features of the current map. It also attempts to load features and handles success and failure, and in this example the load should be a success.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<title>Map Features</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript"
src="" charset="utf-8">
<div id="mapContainer" style="z-index: -1; left:0px; top:0px; width: 100%; height: 80%; position: absolute;"></div>
<script type="text/javascript">
// Don't forget to set your API credentials
// Replace with your appId and token which you can obtain when you
// register on
nokia.Settings.set( "appId", "YOUR APP ID GOES HERE");
nokia.Settings.set( "authenticationToken", "YOUR AUTHENTICATION TOKEN GOES HERE");
// This example will first display the full Feature Map components and then of those what
// are being used in the current map that is loaded and in use.
var map;
map = new"mapContainer"),
components: [ new,
new ],
zoomLevel: 4,
center: [52.51, 13.4] // default map center point (not the location retrieved)
//Retrieve Feature Map
var list = nokia.maps.Features.getFeatureMap();
// Loop through the features and show them in an alert
// Returns a map of implementations for each registered feature.
for( var i in list )
{ if ( list.hasOwnProperty(i) )
alert("Feature Map: "+list[i]);
// Retrieve Loaded Map
var list = nokia.maps.Features.getLoadedMap();
// Loop through the features and show them in an alert
// Returns a map of the names of fully loaded feature implementations per feature.
for( var i in list )
{ if ( list.hasOwnProperty(i) )
alert("Loaded Map:" +list[i]);
nokia.maps.Features.load({"map": "auto", "routing": "auto"}, load_Successful, load_Failed);
nokia.maps.Features.load({"map": "auto", "search": "auto"}, load_Successful, load_Failed);
function load_Successful(result){
function load_Failed(result){


Feel free to modify the code for your own purposes.

For more on the Nokia Maps API

Please check out the Nokia Maps API full documentation and API reference here:

You may also access the interactive API explorer

Tested with

  • Google Chrome 20.0 x
  • Firefox 13.0
37 page views in the last 30 days.