[ 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 zoom response precisely describes the extent of a map returned by an equivalent map by centre request.

URL

HTTP Post to <ENDPOINT>service/viewport/by_zoom

Request format

{
	"height":<int>,
	"width":<int>,
	"centre":<point>,
	"zoom":<int>
}

Rules

Parameter

Mandatory?

Description

height

Y

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

width

Y

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

centre

Y

The map will be centred on the specified <point>.

<zoom>

Y

Zoom level as a number 0 - 17 where 0= at country, 17 = property

Sample request

{
	"height":400,
	"width":600,
	"centre":{"lat":-37.9,"lon":145},
	"zoom":4
}

Sample response

{
  "bounds": {
    "left": 138.408203,
    "top": -34.351602,
    "right": 151.591797,
    "bottom": -41.285239
  },
  "centre": {
    "lon": 145.0,
    "lat": -37.81842
  },
  "resolution": 2445.98490478515623181010596454143524169921875,
  "x_distance": 1208605.324493,
  "y_distance": 770465.745552,
  "zoom": 4
}
NOTES
 A viewport request does not return a map.
Icon

This request uses the following objects: