HERE Maps API for JavaScript
China specific
Maps API for JavaScript Developer Guide

Overview

This documentation introduces the HERE Maps API for JavaScript, offers a quick start guide, followed by a developer's guide with articles showing the implementation of typical use cases, and ends with a detailed API reference.

The overview (this chapter):

  • defines the API
  • outlines the key benefits of the API for developers
  • explains the modular organization of the API

For the terms and conditions covering this documentation, see the HERE Documentation License.

What is the Maps API for JavaScript?

The HERE Maps API for JavaScript (also referred to as the Maps API in the following text) is a set of programming interfaces that enable developers to build Web applications with feature rich, interactive HERE Maps at their center. The API consists of libraries of classes and methods with which to implement the functionality of an interactive application.

Why use the Maps API for JavaScript?

The Maps API for JavaScript offers the following high level features and benefits to developers of Web applications with maps as a core element:

Table 1. Main features of the HERE Maps API for JavaScript
Feature Description
Efficient map rendering The API is built for HTML5-capable environments to maximize map and map object rendering efficiency on mobile devices and desktops. It also includes support for high-DPI devices to show the best maps wherever possible.
HERE Maps map data The API provides full access to world-leading map data and map images, with a choice of view modes and customization options, including three main map types: map, terrain and hybrid.
Geocoding The API provides full access to geocoding and reverse geocoding services.
Routing The API supports route calculation and display, with a variety of customization options such as public transport routing and others.
Enterprise routing The API supports advanced enterprise routing use cases such as isoline routing or truck routing.
Custom map objects The API supports the creation of both interactive and non-interactive map objects:
  • markers with SVG, HTML or bitmap images
  • geo shapes, including polygons, polylines, circles and rectangles
Mouse and touch interaction The API (via an events extension) supports mouse and touch interaction with the map, including pan, zoom and pinch-to-zoom on a broad range of devices.
Pre-built UI controls The API offers pre-built, customizable UI controls that allow users to change the base map, zoom in and out smoothly, and display the current map scale. In addition, info bubbles with arbitrary HTML content and SVG images can be placed on the map.

Browser Support

The Maps API is built specifically for modern browsers that support HTML5 on desktop as well as mobile environments. Although it is optimized for certain browsers and environments, we do our utmost to ensure the API can be used on a wide variety of platforms and browsers.

Below is a list showing support (with and without optimizations) in the Maps API for different browsers and environments:

Table 2. Browser support in HERE Maps API for JavaScript
Support Level Browser Environment
Supported with optimizations: Internet Explorer 10+ desktop, Windows Phone 8+
Firefox (latest) desktop
Google Chrome (latest) desktop, Android 4.4+ on mobile/tablet
Apple Safari 6+ desktop, iOS 6+ on mobile/tablet
Supported without optimizations: Internet Explorer 9 desktop
Android default browser / WebView Android 2.2+ on mobile/tablet [1]
iOS WebView iOS 6+
Not supported: Opera
Internet Explorer <= 8
[1] Support does not extend to all multi-touch gestures as Android 2.x does not expose multi-touch events

HERE Maps API for JavaScript Modules

The Maps API for JavaScript is organized into a number of modules. Developers can therefore use the API efficiently by selecting only the modules which their applications require.

The table below outlines the selectable modules of the Maps API for JavaScript.

Table 3. Modules of the HERE Maps API for JavaScript
Module name Module dependencies Description
core (mapsjs-core.js) none This module contains the core functionality for rendering maps, map layers and map objects as well as utilities used in other modules. This module forms the core of the API and is a dependency of all other modules.
service (mapsjs-service.js) core This module supports map tile retrieval, routing, geocoding, etc.
mapevents (mapsjs-mapevents.js) core This module provides functionality to enable user-interaction with the map, including map panning and pinch-to-zoom. The module normalizes various browser event systems (mouse events, touch events, pointer events) to offer unified events that can be used across desktop and mobile environments.
ui (mapsjs-ui.js + mapsjs-ui.css) core This module provides a set of pre-built cross-browser UI components (such as base map settings, zoom control, map scale) that can be added to the map. It also provides functionality to display location-specific info bubbles with arbitrary HTML content on the map.
clustering (mapsjs-clustering.js) core This module provides functionality for marker clustering.
data (mapsjs-data.js) core This module provides set of classes for display of KML and GeoJSON data.