Maps SDK for Web

tt.services.copyrights

The Copyrights service implementation provides a full copyrights notice in a HTML format that can be displayed to the user when the copyrights link is clicked.

The Copyrights API can take as an argument an area which concerns the copyrights. If this argument is omitted the whole world is considered.

The API handles the "edge of the world" issue. It allows the proper handling of bounding box that is outside of world extents (-180, -90, 180, 90).

Parameters need to be passed to the constructor. The method go performs the actual call.

The final response from the service is a HTML string with the copyrights information that have to be displayed. The whole respose is wrapped into a div element with the id copyrightMessage. Country names are enclosed within h4 elements and the copyrights information per each supplier is enclosed in p elements. This makes styling with CSS fairly easy. An example response may look like this:

<div id="copyrightMessage"><h4>General Copyrights:</h4>
  <p>© 1992 – 2018 TomTom. All rights reserved. This
  material is proprietary and the subject of
  copyrights protection, database right protection
  and other intellectual property rights owned
  by TomTom or its suppliers. The use of
  this material is subject to the terms of a license
  agreement. Any unauthorized copying or disclosure
  of this material will lead to criminal and civil
  liabilities.</p>
  <p>Data Source © 2018 TomTom</p>
</div>

Constructor

tt.services.copyrights([options])

Example
//a bounding box copyrights call
tt.services.copyrights({
  key: <Your API key>,
  boundingBox: '0, 0, 1, 1'
})
  .go()
  .then(function(response) {
    console.log(response);
  });

//a tile-level copyrights call
tt.services.copyrights({
  key: <Your API key>,
  zoom: 1,
  x: 1,
  y: 1
})
  .go()
  .then(function(response) {
    console.log(response);
  });
Parameters
Name Description
options
Object
default:None
options.boundingBox
Object | Number[] | Object[] | String
default:None
Bounding box area in one of the supported formats.
The bounding box is a limited area within the search results. If it is omitted then the whole world will be taken into consideration. In case the area specified exceeds the world boundaries, the following actions will be taken depending on which side was exceeded:
  • Latitudes: the exceeded values will be replaced with their maximun.
  • Longitudes: The service will split the area into two (or more) valid bounding boxes, will execute a search request for each one, and then merge the responses into a single result.
This option is able to convert a number of popular formats into the bounding box. The supported formats are listed below:
  • Maps.LngLatBounds class instance
  • {minLon: 0, minLat: 0, maxLon: 1, maxLat: 1} A plain object with the keys minLon, minLat, maxLon, maxLat.
  • [0, 0, 1, 1] An array of numbers describing the bounding box following the order: minLon, minLat, maxLon, maxLat.
  • [[0, 0], [1, 1]] A two-dimensional array with two indexes [southWest, northEast], each one with longitude and latitude values.
  • "0,0,1,1" A comma-separated string with numbers in the order: minLon, minLat, maxLon, maxLat.
  • [{lon: 0, lat: 0},{lon: 1, lat: 1}] A one-dimensional array with two objects in the order: southWest, northEast, and each object with a lat and lon key.
  • [{lng: 0, lat: 0},{lng: 1, lat: 1}] A one-dimensional array with two objects in the order: southWest, northEast and each object with a lat and lon key.
  • [Maps.LngLat, Maps.LngLat] A one-dimensional array with two Maps.LngLat instances in the order: southWest and northEast.
options.key
String
default:None
A valid API Key for the requested service.
A valid API Key is required to make use of the given service. It can be issued in the Developer Portal.
options.protocol
"http" | "https"
default:"https"
The protocol type to be used in the calls.
Represents the type of protocol used to perform a service call.
options.x
Integer
default:None
The x axis value.
This option specifies the x axis value in a slippy map format. Only used for tile-level copyright calls.
options.y
Integer
default:None
The y axis value.
This option specifies the y axis value in a slippy map format. Only used for tile-level copyright calls.
options.zoom
Integer
default:None
The zoom level.
This option specifies the zoom level in a slippy map format. Only used for tile-level copyright calls.

Methods

go( ): Promise

Executes a predefined asynchronous task using the current configuration.

Returns