Search code examples
mapquest

How do I get the boundingBox for the MapQuest API?


The traffic incidents needs the boundingBox param (https://developer.mapquest.com/documentation/traffic-api/incidents/get/) and it docs use a location that is geocoded, I would assume to get the boundingBox info but the geocodding api doesn't return anything for it (https://developer.mapquest.com/documentation/geocoding-api/address/get/). How can I get and/or calculate the bounding box? It seems to be related to the lat/lang but it's not obvious.


Solution

  • A default bounding box can be built around a geocode result by adding/subtracting generous values around the returned lat/lng. But usually the bounding box is a result of a user looking at a map and grabbing the bounds of that map.