AnsweredAssumed Answered

Manually drew graphic on stream layer is not removed once graphic with same fieldTrackID is plotted on the same stream layer

Question asked by vodca_valdez on Nov 3, 2016
Latest reply on Nov 3, 2016 by rscheitlin
////// SAMPLE JavaScript//////

//Init stream layer
var streamLayer = new StreamLayer(streamLayerUrl, streamLayerOptions);

//Manually add graphic object into stream layer during init
streamLayer.add(
  new Graphic(
    new Point(xLoc, yLoc, map.spatialReference),
    new SimpleMarkerSymbol(),
    {
      ID: "1" //trackIdField
    }
  )
);

For example I got sample code as above which will manually plot a point on to stream layer during page on load.

 

After stream layer is starting to publish points to the layer, how to remove the point that manually drew which with same "trackIdField" value and replace by the point pushed out by stream layer itself?

 

Currently my result is the manually plotted point is not removed and the point plotted by stream layer will stacked on top of the manually plotted point (assume the x and y for the point is the same for both manually and stream layer plotted point).

 

Anyone have similar experience that can advise?

 

p/s: streamLayerOptions.maximumTrackPoints is default(1)

Outcomes