Maps SDK for Web



The Services library provides the necessary tools to integrate all Tomtom services with your application. We take care of all the aspects required to make the calls to the Tomtom APIs, such as the construction of the URL, validation, and error handling. It is worth noting that by using our help, you avoid making mistakes and extra calls to the service.

We provide three different bundles of the library:

  • services-web.min.js - use this file if you want to include the library directly on a web page, it can be imported in the <head> of your HTML document. The tt global object will be created and attached to the window.
  • services.min.js - use this file if you are using a module bundler. It conforms the UMD standard. In case you use ES6 imports all you need is:
    import tt from 'services.min.js'
  • services-node.min.js - use this file if you want to use our services in Node.js.
If you want to display a map on the webpage, go to Maps library documentation.

Difference between API responses and this library's responses

Services library provides an easy way to get responses from APIs like Search API, Routing API or Traffic API. In order to maintain consistency between data types returned by those APIs, and to make it more convenient to use those responses and data types with the Maps library, Services library alters original responses:

Usage of this method is presented on the documentation page of each service mentioned.

  • The getTrackingId() method is also available as part of the service response in order to obtain the Tracking-ID associated with the request.

Most services are asynchronous and return Promise except for staticImage and poiPhotos, which return URL string.