Updating latitude and longitude

2 posts / 0 new
Last post
ddsteig
Updating latitude and longitude

I have a click event from another api that returns the latitude and longitude. Im trying to get the map to load with the new coords each time the button is clicked. However all I get is an error msg of: mapquest.js:10 Uncaught Error: Map container is already initialized.

Any help is appreciated. All i want to do is have the coords updated each time the button is clicked.


MQBrianCoakley
It sounds like the map is
It sounds like the map is being recreated from scratch. Just set the map's new center rather than creating a new map. L.mapquest.map.setView();