Viewport

There are two ways to define the map viewport:

  • Using the bbox parameter.
  • Using the ll+spn parameters.

The Static API selects the appropriate zoom level so that the entire specified area is visible on the image.

If the bbox and ll+spn parameters are omitted and the zoom level (the z parameter) isn't explicitly defined, the Static API tries to set the missing parameters automatically.

Bbox parameter

The bbox parameter sets the geographical coordinates of the corners of a rectangle bounding the viewport. The coordinates of the lower-left and upper-right corners are specified (in the order "longitude, latitude").

Note

If the bboxand ll+spn parameters are both set, the bbox parameter takes priority.

https://static.api.mappable.world/v1?bbox=29.0,40.2~29.1,41.9&lang=en_US&apikey=YOUR_API_KEY

ll+spn parameters

The ll+spn parameters set the range of the viewport relative to the map center.

The ll parameter defines the longitude and latitude of the map center (in degrees), while spn defines its range (in degrees). The range of the area is defined by two numbers: the first is the difference between the maximum and minimum longitude of the area, and the second is the difference between the maximum and minimum latitude.

Note

If the bboxand ll+spn parameters are both set, the bbox parameter takes priority.

The examples below show map image requests that differ from each other only by the viewport size (0.002 × 0.002, 0.3 × 0.3, and 10 × 10 degrees). The center of the requested map fragment is Taksim Meydanı in Istanbul. The map size is 300 × 300 pixels.

Viewport of 0.002 × 0.002 degrees

https://static.api.mappable.world/v1?lang=en_US&ll=28.98513,41.036943&spn=0.002,0.002&size=300,300&apikey=YOUR_API_KEY

Viewport of 0.3 × 0.3 degrees

https://static.api.mappable.world/v1?lang=en_US&ll=28.98513,41.036943&spn=0.3,0.3&size=300,300&apikey=YOUR_API_KEY

Viewport of 10 × 10 degrees

https://static.api.mappable.world/v1?lang=en_US&ll=28.98513,41.036943&spn=10,10&size=300,300&apikey=YOUR_API_KEY