0

I have a function that allows move a point by angle and distance enter image description here

The problem is that after move the point, this doesn't show in map: enter image description here

Sometimes the line also disappears

This is a summary of the code to update the coordinates of the point:

loFL = goMap.getLayer("points_layer");
//take the first graphic (The point) and update            
loFL.graphics[0].geometry.x = newX;
loFL.graphics[0].geometry.y = newY;                   
loFL.redraw();

PD: 'loFL' it's a FeatureLayer created with a FeatureCollection

4
  • Is points_layer a FeatureLayer or GraphicsLayer? If FeatureLayer are you creating it by sending a service URL?
    – GavinR
    Commented Mar 1, 2018 at 17:20
  • it's a FeatureLayer, created with a FeatureCollection.
    – Pilgrim
    Commented Mar 1, 2018 at 21:17
  • Which version of the JavaScript API are you using?
    – GavinR
    Commented Mar 2, 2018 at 2:46
  • it's the version 3
    – Pilgrim
    Commented Mar 2, 2018 at 12:53

1 Answer 1

2

It looks like your code:

loFL = goMap.getLayer("points_layer");
//take the first graphic (The point) and update            
loFL.graphics[0].geometry.x = newX;
loFL.graphics[0].geometry.y = newY;                   
loFL.redraw();

Should indeed work fine for Feature Layers created with a FeatureCollection. Code example here.

1
  • Yes, the layer was created with a FeatureCollection
    – Pilgrim
    Commented Mar 12, 2018 at 15:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.