Geographic Information Systems Asked by sumit kundan on July 6, 2021
I have latitude and longitude from a third party API and I would like to show the marker on map depending upon that latitude and longitude. When new data comes from the API I need to remove previous marker and new marker depend upon the data.
I am using below code to show the marker one time, next time no errors in console but nothing to show. Any idea to automatically move the previous marker to new location or delete the previous marker and new one as the layer of the map?
Here is the JavaScript code:
function addmarker(latt, longtt) {
polygraphlayer.clear();
var pt1 = new Point(Number(longtt), Number(latt));
var markersymbol1 = new PictureMarkerSymbol('images/marker.png', 10, 15);
polygraphlayer.add( Graphic(pt1, markersymbol1));
}
See the accepted answer from this Stack Overflow question
The API documentation includes two samples for tracking.
To tracking current location: https://developers.arcgis.com/javascript/latest/sample-code/widgets-track-basic/index.html
To simulate tracking from a set of locations: https://developers.arcgis.com/javascript/latest/sample-code/widgets-track/index.html
Answered by Superdooperhero on July 6, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP