I am integrating amcharts4 into a meteor project to display a map with dynamic map markers. These map markers need to update themselves whenever the underlying data changes.
I have tried to customize the demo available at this link.
The only modification I made was to assign a different set of data to the imageSeries in order to update the markers on the map dynamically.
You can view and test the functionality in action using this jsfiddle. The setTimeout function is used to simulate a data change every 5 seconds.
setTimeout(function(){
$('.map-marker').remove()
imageSeries.data = [{
"zoomLevel": 5,
"scale": 0.5,
"title": "Brussels",
"latitude": 50.8371,
"longitude": 4.3676
}];
imageSeries.validateData();
}, 5000)
The data does update after 5 seconds, however, the new points do not appear on the map until manual interaction such as panning, zooming in/out occurs.
I am looking for a solution to resolve this issue.