We are migrating our Google Maps based web application over to Esri. Our application shows locations updating on the screen.
With google maps you can use the setPosition method on a marker to move the marker position. I have not found something similar within Esri. Would I have to clear my graphic and create a new one in place of it? I'm trying to think of a way to show several different locations updating without having to redraw each graphic.
Any help is appreciated!
Are you using a GraphicsLayer, or a FeatureLayer defined with client-side Graphics? Here's a simple CodePen that shows how to apply client-side updates to either one:
There are huge huge differences in terms of how Google maps works compared to ESRI and if you're searching a direct "translation" of the functionality you had in Google into ESRI then you're looking at it wrong. Just like you can't translate every sentence directly from one language to another (might not be the best analogy).
If you'd like to achieve the functionality of dragging a point over the map to update it's location, you need to understand the fundamentals of ESRI and how to publish editable layers, which then gives you this functionality out-of-the-box. The answers you received here are just workarounds to try and mimic that behaviour based on what you already know from Google, which is very wrong in my opinion. A new product requires a new approach and different (better) solutions.