Maps SDK for Web

tt.services.additionalData

Retrieve polygons (in GeoJSON format) representing administrative borders using IDs related to search results entities.

Parameters need to be passed to the constructor.

Response

The response is extended with getTrackingId() method, which returns the Tracking-ID associated with the request.

Please refer to Difference between API responses and this library's responses section.

Constructor

tt.services.additionalData([options], [additionalOptions])

Example
tt.services.fuzzySearch({
     key: <Your API key>,
     query: "Amsterdam"
}).then(function(response) {
     var geometryId = response.results[0].dataSources.geometry.id;
     tt.services.additionalData({
         key: <Your API key>,
         geometries: [geometryId]
     }).then(function(adpResponse) {
         console.log(adpResponse);
     })
  });
Parameters
Name Description
options
Object
default:None
additionalOptions
Object
default:None
Additional options to be passed to the service.
additionalOptions.abortSignal
Object
default:None

Signal created with abortController.


Use AbortController to cancel requests in progress.
Example
var abortController = new AbortController();
var options = {};
tt.services.calculateRoute(options, { abortSignal: abortController.signal })
    .then(function(response) { console.log(response) });
    .catch(function(error) {
        if (abortController.signal.aborted === true) {
            console.log('Request aborted.');
        }
    });
abortController.abort();
options.geometries
String[]
default:None

An array of geometries IDs.


This option specifies an array of geometries IDs. IDs can be retrieved from the response returned by search service, e.g., fuzzySearch.
options.geometriesZoom
Number
default:None

Geometries zoom value. Must be an integer in range of 0-22 (inclusive).


To see table of precision per zoom value, please refer to: Search API documentation.
options.key
String
default:None

A valid API Key for the requested service.


Key is required to make use of the given service. It can be issued in the Developer Portal.
options.trackingId
String
default:uuid

Sets value of "Tracking-ID" header.


Specifies an identifier for the request. If not set by the user, UUID is generated for each call.
  • It can be used to trace a call.
  • The value must match the regular expression '^[a-zA-Z0-9-]{1,100}$'.
  • An example of the format that matches this regular expression is UUID: (e.g. 9ac68072-c7a4-11e8-a8d5-f2801f1b9fd1). For details check RFC 4122.
  • If specified, it is replicated in the Tracking-ID Response header.
  • It is only meant to be used for support and does not involve tracking of you or your users in any form.