Hi All,
I'm am trying to create a FeatureLayer that updates in real time in the ArcGIS API for JavaScript in 4.x. I seem to be able to update my graphic object (change the geometry) and it looks right when I print it out the console. But the graphic doesn't seem to move on the map. The only way I seem to be able to get it to move is to remove it from the layer and add a new graphic. Am I missing something? Is what I'm trying to do possible?
Gabe
Solved! Go to Solution.
Gabriel,
According to the 4.x functionality matrix:
Functionality matrix | ArcGIS API for JavaScript 4.2
Modify graphics | Coming soon | To modify a graphic that is already added to the layer: you need to clone it, make modifications, add it to the layer and remove the original graphic. In-place modification of graphic objects will not trigger display refresh. |
Gabriel,
According to the 4.x functionality matrix:
Functionality matrix | ArcGIS API for JavaScript 4.2
Modify graphics | Coming soon | To modify a graphic that is already added to the layer: you need to clone it, make modifications, add it to the layer and remove the original graphic. In-place modification of graphic objects will not trigger display refresh. |
I just wrote about this.
Quick Tip - Clone in ArcGIS JSAPI - odoenet
Here is a demo app
JS Bin - Collaborative JavaScript Debugging
It's not real editing, but can be useful.