Maps SDK for Web
tt
This object aggregates all necessary modules and classes to work with maps.
Please refer to the following documentation to check what properties and methods are included in the tt object.
Properties
Evented: Maps.Evented
FullscreenControl: Maps.FullscreenControl
GeolocateControl: Maps.GeolocateControl
LngLat: Maps.LngLat
LngLatBounds: Maps.LngLatBounds
map: Maps.Map
Marker: Maps.Marker
MercatorCoordinate: Maps.MercatorCoordinate
NavigationControl: Maps.NavigationControl
Point: Maps.Point
Popup: Maps.Popup
ScaleControl: Maps.ScaleControl
sdkInfo: Function
workerCount: Number
Methods
clearPrewarmedResources( )
Clears up resources that have previously been created by tt.prewarm()
. Note that this is
typically not necessary. You should only call this function if you expect the user of your app to not
return to a Map view at any point in your application.
prewarm( )
Initializes resources like WebWorkers that can be shared across maps to lower load times in
some situations. tt.workerCount
, if being used, must be set before tt.prewarm()
is called to have an
effect. By default, the lifecycle of these resources is managed automatically, and they are lazily initialized
when a Map is first created. By invoking tt.prewarm()
, these resources will be created ahead of time, and will
not be cleared when the last Map is removed from the page. This allows them to be re-used by new Map instances
that are created later. They can be manually cleared by calling tt.clearPrewarmedResources()
.
This is only necessary if your web page remains active but stops using maps altogether.
setProductInfo(productId, productVersion)
This method sets the content of the TomTom-User-Agent header. We are collecting anonymous data for statistics of usage of our services in order to increase the quality of our products.
Example
tt.setProductInfo('your-product-id', 'your-product-version');
supported([options]): Boolean
This method allows you to check if the user's browser is supported.
Example
tt.supported() // = true
Parameters
Returns