Maps API for JavaScript Developer's Guide

H.service.Platform

Class Summary

The Platform class represents central class from which all other service stubs are created. It also contains the shared settings to be passed to the individual service stubs, for example the root URL of the platform, application credentials, etc.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

configure (configurable) : {H.service.IConfigurable}

Method attempts to configure object that implements H.service.IConfigurable

setUseHTTPS (useHTTPS)

This method enables or disables HTTPS communication with the platform

setUseCIT (useCIT)

This method configures whether to use the "customer integration testing" instance of the platform.

setBaseUrl (baseUrl)

This method modifies the base URL to be used when creating service stubs.

getBaseUrl () : {H.service.Url}

This method returns the currently used base URL.

getTrafficIncidentsService () : {H.service.TrafficIncidentsService}

This method returns an instance of H.service.TrafficIncidentsService to query the Traffic API Traffic Incident Data

getMapTileService (opt_options) : {H.service.MapTileService}

This method returns an instance of H.service.MapTileService to query the Map Tile API.

getVenueService (opt_params) : {H.service.venues.Service}

This method returns an instance of H.service.venues.Service to query the Venue Maps API

getMetaInfoService (opt_params) : {H.service.metaInfo.Service}

This method returns an instance of H.service.metaInfo.Service to query the Map Tile API Metainfo Tiles

createDefaultLayers (opt_tileSize, opt_ppi, opt_lang, opt_secondaryLang, opt_style, opt_pois) : {Object<string, H.service.MapType>}

This method creates a pre-configured set of HERE tile layers for convenient use with the map.

getRoutingService (opt_options) : {H.service.RoutingService}

This method returns an instance of H.service.RoutingService to query the Routing API.

getGeocodingService (opt_options) : {H.service.GeocodingService}

This method returns an instance of H.service.GeocodingService to query the Geocoder API

getPlacesService () : {H.service.PlacesService}

This method returns an instance of H.service.PlacesService to query the Places API.

getEnterpriseRoutingService (opt_options) : {H.service.EnterpriseRoutingService}

The service was deprecated and succeeded by Routing REST API (see H.service.Platform#getRoutingService).

Class Description

The Platform class represents central class from which all other service stubs are created. It also contains the shared settings to be passed to the individual service stubs, for example the root URL of the platform, application credentials, etc.

Example

var platform = new H.service.Platform({
  app_id: [your app_id],     //set your app_id
  app_code: [your app_code],   //set your app_code
  useCIT: true         //configure all services to use the 'CIT' environment
});

var geocoder = platform.getGeocodingService();
//Now you are ready to talk to the HERE Geocoder API

Constructor Details

H.service.Platform(options)

Parameters:
 
options:
{H.service.Platform.Options}
 

Method Details

configure (configurable) : {H.service.IConfigurable}

Method attempts to configure object that implements H.service.IConfigurable

Parameters:
 
configurable:
{H.service.IConfigurable}
 
Returns:
 
{H.service.IConfigurable}

setUseHTTPS (useHTTPS)

This method enables or disables HTTPS communication with the platform

Parameters:
 
useHTTPS:
{boolean}
 
a boolean value indicating whether to communicate with the platform via HTTPS

setUseCIT (useCIT)

This method configures whether to use the "customer integration testing" instance of the platform.

Parameters:
 
useCIT:
{boolean}
 
a boolean value indicating whether the CIT platform instance is to be used

setBaseUrl (baseUrl)

This method modifies the base URL to be used when creating service stubs.

Parameters:
 
baseUrl:
{H.service.Url}
 
the new base URL to use

getBaseUrl () : {H.service.Url}

This method returns the currently used base URL.

Returns:
 
{H.service.Url}

getTrafficIncidentsService () : {H.service.TrafficIncidentsService}

This method returns an instance of H.service.TrafficIncidentsService to query the Traffic API Traffic Incident Data

Returns:
 
{H.service.TrafficIncidentsService}
a new places service instance

getMapTileService (opt_options) : {H.service.MapTileService}

This method returns an instance of H.service.MapTileService to query the Map Tile API.

Parameters:
 
opt_options:
{H.service.MapTileService.Options=} [optional]
 
Returns:
 
{H.service.MapTileService}

getVenueService (opt_params) : {H.service.venues.Service}

This method returns an instance of H.service.venues.Service to query the Venue Maps API

Parameters:
 
opt_params:
{H.service.venues.Service.Options=} [optional]
 
additional service parameters
Returns:
 
{H.service.venues.Service}

getMetaInfoService (opt_params) : {H.service.metaInfo.Service}

This method returns an instance of H.service.metaInfo.Service to query the Map Tile API Metainfo Tiles

Parameters:
 
opt_params:
{H.service.metaInfo.Service.Options=} [optional]
 
additional service parameters

createDefaultLayers (opt_tileSize, opt_ppi, opt_lang, opt_secondaryLang, opt_style, opt_pois) : {Object<string, H.service.MapType>}

This method creates a pre-configured set of HERE tile layers for convenient use with the map.

This method returns an object holding the three default map types

  • normal
  • satellite
  • terrain

Each of the map types in turn contains the following variant tile layers:

  • map
  • xbase
  • base
  • traffic
  • panorama
  • labels

In addition the normal map type contains the following variant tile layers: - transit - metaInfo - mapnight - xbasenight - basenight - trafficnight - panoramanight

Collection of default map types also includes incidents type, that provides an overlay that displays current traffic incidents, and venues type, that encapsulates indoor maps overlay.

Example

// Create the default layers
var layers = platform.createDefaultLayers({pois: true});

// Set the satellite map type's traffic variant as the map's base layer
map.setBaseLayer(layers.satellite.traffic);
Parameters:
 
opt_tileSize:
{(H.service.Platform.DefaultLayersOptions | number)=} [optional]
 
When a number – optional tile size to be queried from the HERE Map Tile API, default is 256. If the parameter is an object, then it represents options and all remaining below parameters should be omitted.
opt_ppi:
{number=} [optional]
 
optional 'ppi' parameter to use when querying tiles, default is not specified
opt_lang:
{string=} [optional]
 
optional primary language parameter, default is not specified
opt_secondaryLang:
{string=} [optional]
 
optional secondary language parameter, default is not specified
opt_style:
{string=} [optional]
 
optional 'style' parameter to use when querying map tiles, default is not specified
opt_pois:
{(string | boolean)=} [optional]
 
indicates if pois are displayed on the map. Pass true to indicate that all pois should be visible. Alternatively you can specify mask for the POI Categories as described at the Map Tile API documentation POI Categories chapter.
Returns:
 
{Object<string, H.service.MapType>}
a set of tile layers ready to use

getRoutingService (opt_options) : {H.service.RoutingService}

This method returns an instance of H.service.RoutingService to query the Routing API.

Parameters:
 
opt_options:
{H.service.RoutingService.Options=} [optional]
 
Returns:
 
{H.service.RoutingService}

getGeocodingService (opt_options) : {H.service.GeocodingService}

This method returns an instance of H.service.GeocodingService to query the Geocoder API

Parameters:
 
opt_options:
{H.service.GeocodingService.Options=} [optional]
 
an optional set of options for the new geocoding service to connect to
Returns:
 
{H.service.GeocodingService}
a new geocoding service instance

getPlacesService () : {H.service.PlacesService}

This method returns an instance of H.service.PlacesService to query the Places API.

Returns:
 
{H.service.PlacesService}
a new places service instance

getEnterpriseRoutingService (opt_options) : {H.service.EnterpriseRoutingService}

The service was deprecated and succeeded by Routing REST API (see H.service.Platform#getRoutingService).

This method returns an instance of H.service.EnterpriseRoutingService to query the Enterprise Routing API.

Deprecated:
since 3.0.12.5
Parameters:
 
opt_options:
{H.service.EnterpriseRoutingService.Options=} [optional]
 

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.