I am updating the map areas of an AmMap map, but the zoom level and position is reset whenever I do.
My function which is updating the map is:
function setData(data) {
var parsedData = JSON.parse(data);
map.dataProvider.areas = parsedData.areas;
map.validateData();
}
I have tried a bunch of things, but I can't get this to work.
Cheers for any help.
before you update your data, get the current zoom values and pass them into the dataprovider. Take a look to following sample http://www.amcharts.com/tips/retaining-map-zoom-level-position-data-update/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With