Search code examples
javascriptmapsgeocodingleafletmapquest

Using the MapQuest geocoding API to get the correct zoom to an area


I use the MapQuest geocoding API and the Leaflet library to create a map and let users go to a specific location. Can I use this API or library to get the correct zoom levels or the bounds for a specific area like a city, country, state, etc... I haven't tried anything yet but I have searched the web and found nothing.


Solution

  • To be straight to the point you can't. According to the specification of Mapquest's geocoding response, no bounding box is sent, only a pair of latitude/longitude coordinates.