Maps API for JavaScript Developer's Guide

H.service.Platform

Class Summary

Platform is a central class from which all other service stubs are created. It 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}

This method attempts to configure an object that implements H.service.IConfigurable.

setUseHTTPS (useHTTPS)

This method enables or disables HTTPS communication with the platform.

setUseCIT (useCIT)

This method sets a flag indicating 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 retrieves 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 retrieves an instance of H.service.MapTileService to query the Map Tile API.

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

This method retrieves 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) : {H.service.DefaultLayers}

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

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

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

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

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

getPlacesService () : {H.service.PlacesService}

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

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

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

getPlatformDataService (opt_options) : {H.service.extension.platformData.Service}

This method returns an instance of H.service.extension.platformData.Service to query the Platform Data Extension API.

Class Description

Platform is a central class from which all other service stubs are created. It 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}
 
An object containing configuration options

Method Details

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

This method attempts to configure an object that implements H.service.IConfigurable.

Parameters:
 
configurable:
{H.service.IConfigurable}
 
The object to configure
Returns:
 
{H.service.IConfigurable}
The configured object

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 (true) or not (false)

setUseCIT (useCIT)

This method sets a flag indicating 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 (true) or not (false)

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 retrieves the currently used base URL.

Returns:
 
{H.service.Url}
The current base 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 retrieves an instance of H.service.MapTileService to query the Map Tile API.

Parameters:
 
opt_options:
{H.service.MapTileService.Options=} [optional]
 
An object representing the map tile service configuration options
Returns:
 
{H.service.MapTileService}
An object representing the retrieved map tile service

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

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

Parameters:
 
opt_params:
{H.service.venues.Service.Options=} [optional]
 
An object containing service configuration parameters
Returns:
 
{H.service.venues.Service}
An object representing the 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) : {H.service.DefaultLayers}

This method creates a pre-configured set of HERE 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 contains the following variant layers:

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

In addition, the normal map type contains the following variant layers:

  • transit
  • metaInfo
  • mapnight
  • xbasenight
  • basenight
  • trafficnight
  • panoramanight

The collection also includes:

  • incidents layer that provides an overlay that displays the current traffic incidents
  • venues layer that encapsulates an indoor maps overlay contain the following variant synthetic layers: day and night

Example

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

// Set the  traffic variant of the satellite map type as the base layer for the map
map.setBaseLayer(layers.satellite.traffic);
Parameters:
 
opt_tileSize:
{(H.service.Platform.DefaultLayersOptions | number)=} [optional]
 
If this parameter is a number, it indicates the tile size to be queried from the HERE Map Tile API (the default value is 256); if this parameter is an object, it represents configuration options for the layer and all the remaining parameters (below) should be omitted
opt_ppi:
{number=} [optional]
 
optional A 'ppi' parameter to use when querying tiles, the default is not specified
opt_lang:
{string=} [optional]
 
An optional identifier of the primary language parameter, the default is not specified
opt_secondaryLang:
{string=} [optional]
 
An optional identifier of the secondary language parameter, the default is not specified
opt_style:
{string=} [optional]
 
An optional 'style' parameter to use when querying map tiles, the default is not specified
opt_pois:
{(string | boolean)=} [optional]
 
A Boolean value indicating if POIs are displayed on the map (true)or a mask for the POI Categories as described in the Map Tile API documentation POI Categories
Returns:
 
{H.service.DefaultLayers}
a set of layers ready to use

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

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

Parameters:
 
opt_options:
{H.service.RoutingService.Options=} [optional]
 
An object containing RoutingService configuration options
Returns:
 
{H.service.RoutingService}
An instance of RoutingService

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

This method retrieves 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 instance of GeocodingService

getPlacesService () : {H.service.PlacesService}

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

Returns:
 
{H.service.PlacesService}
A new PlacesService instance

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

This method retrieves 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]
 
An object containing EnterpriseRoutingService configuration options
Returns:
 
{H.service.EnterpriseRoutingService}
An object representing the service

getPlatformDataService (opt_options) : {H.service.extension.platformData.Service}

This method returns an instance of H.service.extension.platformData.Service to query the Platform Data Extension API.

Parameters:
 
opt_options:
{H.service.extension.platformData.Service.Options=} [optional]
 
The service options object

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.