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 method, which 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]
  ]
}).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
Maps.LngLat
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.


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:None

Geopolitical view.


Can be one of "Unified", "AR", "IN", "PK", "IL, "MA", "RU", "TR" and "CN". Legend:
  • Unified - International view
  • AR - Argentina
  • IN - India
  • PK - Pakistan
  • IL - Israel
  • MA - Morocco
  • RU - Russia
  • TR - Turkey
  • CN - China
options.width
Number
default:None

Width of the image in pixels.


options.zoom
Number
default:12

Positive integer between 0 and 22.