[ Whereis® API Home ] [ JSON API Home ] [ Services ] [ Map Services ]

If you want to know the exact geographical area that will be covered by a map before you request it, use one of the viewport services. Maps are not available at all resolutions. A viewport by bounds response precisely describes the extent of a map returned by an equivalent map by bounds request.

URL

HTTP Post to <ENDPOINT>service/viewport/by_bounds

Request format

{
	"height":<int>,
	"width":<int>,
	"bounds":<bounds>
}

Rules

Parameter

Mandatory?

Description

height

Y

Image height in pixels. Min = 1, max = 1600

width

Y

Image width in pixels. Min = 1, max = 1600

<bounds>

Y

Request the bounds you require. The returned viewport will be centred on these bounds but "snapped" to the optimal zoom. Typically, therefore, the returned <viewport> covers a larger area than that requested

Sample request

{
	"height":400,
	"width":600,
	"bounds":{
   		"top":-37.813389,
   		"left":138.601685,
   		"bottom":-34.928605, 
   		"right":144.962832
   }
}

Sample response

{
  "bounds": {
    "left": 138.48636,
    "top": -34.595467,
    "right": 145.078157,
    "bottom": -38.133052
  },
  "centre": {
    "lon": 141.782259,
    "lat": -36.36426
  },
  "resolution": 1222.992452392578115905052982270717620849609375,
  "x_distance": 602856.925147,
  "y_distance": 393096.452513,
  "zoom": 5
}
NOTES
 A viewport request does not return a map.
Icon

This request uses the following objects: