Maps SDK for Web

tt.services.staticImage

This Class makes it easy to generate a URL string to request a static map image using the TomTom Maps API - Static Image.

Parameters need to be passed to the constructor. The method go generates the URL string.

Constructor

tt.services.staticImage([options])

Example
// Passing an object with all the configuration
function callbackFn(urlString) {
  console.log(urlString);
}
tt.services.staticImage({
  key: <Your API key>,
  zoom: 15,
  bbox: [
    [40.712, -74.227],
    [40.774, -74.125]
  ]
})
.go()
.then(callbackFn);
Parameters
Name Description
options
Object
default:None
Options to be passed to the routing call, or an array of such options objects to perform a batch request.
options.bbox
Maps.LngLatBounds
default:None

Bounding box.


options.center
LatLng
default:None

Coordinates to the center of the view.


options.format
"png" | "jpg" | "jpeg"
default:"png"

The format of the image to be requested.


options.height
Number
default:None

Height of the image in pixels.


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.language
String
default:"NGT"

Language to use for the labels.


You can find the list of supported languages here.
options.layer
"basic" | "hybrid" | "labels"
default:"basic"

The base map's layer to be used.


options.style
"main" | "night"
default:"main"

The base map style to be used.


options.view
String
default:"Unified"

Geopolitical view.

Can be one of "Unified", "IL", "IN", "MA", "PK", "AR", "Arabic", "TR", "RU"


options.width
Number
default:None

Width of the image in pixels.


options.zoom
Number
default:12

Positive integer between 0 and 22.


Methods

go( ): Promise

Executes a predefined asynchronous task using the current configuration.

Returns