Maps API for JavaScript Developer's Guide

H.service.extension.platformData.Service

Class Summary

Extends: H.service.AbstractRestService

This class encapsulates the Platform Data Extension API in a service stub, providing methods to access its resources. Refer to the REST service documentation for the description of service parameters and response objects.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

request (entryPoint, entryPointType, params, onResult, onError) : {H.util.ICancelable}

This method sends a request to a resource with the provided name and type from the Platform Data Extension API. For available types see Constructing a Request.

createTileLayer (layerConfig, options) : {(H.map.layer.TileLayer | H.map.layer.MarkerTileLayer)}

This method creates a tile layer which can be added to the map in order to continuously fetch data for the specified layer from the Platform Data Extension API.

configure (appId, appCode, useHTTPS, useCIT, opt_baseUrl) : {H.service.IConfigurable}

This method receives configuration parameters from the platform, that can be used by the object implementing the interface. The method must not be invoked directly.

Class Description

This class encapsulates the Platform Data Extension API in a service stub, providing methods to access its resources. Refer to the REST service documentation for the description of service parameters and response objects.

An instance of this class can be retrieved by calling the factory method on a platform instance. H.service.Platform#getPlatformDataService.

Example

// Assumption: the platform is instantiated
platformDataService = platform.getPlatformDataService();

Constructor Details

H.service.extension.platformData.Service(opt_options)

Parameters:
 
opt_options:
{H.service.extension.platformData.Service.Options=} [optional]
 
An optional service parameters

Method Details

request (entryPoint, entryPointType, params, onResult, onError) : {H.util.ICancelable}

This method sends a request to a resource with the provided name and type from the Platform Data Extension API. For available types see Constructing a Request.

Example

// Fetching documentation 'doc/maps' resource in txt format
// Assumption: the platform is instantiated
var service = platform.getPlatformDataService();
service.request(
  H.service.extension.platformData.Service.EntryPoint.DOC_MAPS,
  H.service.extension.platformData.Service.EntryPointType.TXT, {},
  console.log, console.error);
Parameters:
 
entryPoint:
{H.service.extension.platformData.Service.EntryPoint}
 
The entry point of the Platform Data Extension API.
entryPointType:
{H.service.extension.platformData.Service.EntryPointType}
 
The type of the response for the entry point
params:
{H.service.ServiceParameters}
 
A key-value map of query parameters to use for the request.
onResult:
{function(H.service.ServiceResult)}
 
The callback which is called when result is returned
onError:
{function(string=)}
 
The callback which is called when error occurred (i.e request timeout)
Returns:
 
{H.util.ICancelable}
request handle

createTileLayer (layerConfig, options) : {(H.map.layer.TileLayer | H.map.layer.MarkerTileLayer)}

This method creates a tile layer which can be added to the map in order to continuously fetch data for the specified layer from the Platform Data Extension API.

Example

// Assumption: the platform is instantiated
pdeService = platform.getPlatformDataService();

// Create tile layer and pass function to style map objects
pdeLayer = pdeService.createTileLayer({layerId: 'PSTLCB_MP', level: 12}, {
  resultType: H.service.extension.TileProvider.ResultType.MARKER
});

// Add layer to the map
map.addLayer(pdeLayer);
Parameters:
 
layerConfig:
{H.service.extension.platformData.LayerConfig}
 
The configuration for the layer to load.
options:
{H.service.extension.TileProvider.Options}
 
The options to use when creating the tile provider.
Returns:
 
{(H.map.layer.TileLayer | H.map.layer.MarkerTileLayer)}
An object representing the tile layer

configure (appId, appCode, useHTTPS, useCIT, opt_baseUrl) : {H.service.IConfigurable}

This method receives configuration parameters from the platform, that can be used by the object implementing the interface. The method must not be invoked directly.

Example

// assuming that the configurable object exists and the variable name is "configurable"
var platform = new H.service.Platform({
  'app_id': [your app_id],
  'app_code': [your app_code],
})
platform.configure(configurable);
Parameters:
 
appId:
{string}
 
The application ID to identify the client against the platform (mandatory)
appCode:
{string}
 
The application code to identify the client against the platform (mandatory)
useHTTPS:
{boolean}
 
The indicator whether secure communication is used (true), the default is false
useCIT:
{boolean}
 
A value indicating whether Customer Integration Testing ("CIT") is used (true), the default is false
opt_baseUrl:
{H.service.Url=} [optional]
 
The base URL of the platform, the default is http://api.here.com. Note that if the useHTTPS flag is set to true, the URL scheme specified in the opt_baseUrl is overridden to use HTTPS.
Returns:
 
{H.service.IConfigurable}
An instance of IConfigurable reflecting the new configuration

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.