[ 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 geometry response precisely describes the extent of a map returned by an equivalent map by radius request.
URL
HTTP Post to <ENDPOINT>service/viewport/by_radius
Request format
{
"height":<int>,
"width":<int>,
"centre":<point>,
"radius":<double>
}
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>. |
radius | Y | Radius in metres. The returned map will be at the maximum zoom for the specified radius, given the requested map height and width. |
Sample request
{
"height":400,
"width":400,
"centre":{"lat":-37.9,"lon":145},
"radius":1000
}
Sample response
{
"bounds": {
"left": 144.982834,
"top": -37.886454,
"right": 145.017166,
"bottom": -37.913545
},
"centre": {
"lon": 145.0,
"lat": -37.899999
},
"resolution": 9.5546285343170165305082264239899814128875732421875,
"x_distance": 3010.911677,
"y_distance": 3010.357679,
"zoom": 12
}