How to set zoom level to particular zip code

2 posts / 0 new
Last post
How to set zoom level to particular zip code

I am using MapQuest API to plot multiple pins by specifiying multiple addresses. Currently the map zoom is set to best fit. Which allows us to see all the plotted pins. Is it possible to zoom in to particular area by zip code.

Edits: 01/20

After some further investigation, I found out the option to set the initial center for the map, as per the below link, [latlang] option can be specified. But, it didn't work for me.

The MapQuest api was sunset

The MapQuest api was sunset last year and is no longer supported. While the sdk does still work, this will stop working at some point in the near future. We recommend moving mapping functionality to MapQuest.js.


To zoom to a particular zip, you'll need to geocode the zip for the center or get the zip's shape points to set the zoom and center to display the entire zip.


Here is how I got the latLng option to work in a basic map: map=new MQA.TileMap({elt:document.getElementById("map"),zoom:10,latLng:{lat:39.743943,lng:-105.020089}});