<SPAN class="comment token">////// SAMPLE JavaScript//////</SPAN>
<SPAN class="comment token">//Init stream layer</SPAN>
<SPAN class="keyword token">var</SPAN> streamLayer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">StreamLayer</SPAN><SPAN class="punctuation token">(</SPAN>streamLayerUrl<SPAN class="punctuation token">,</SPAN> streamLayerOptions<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="comment token">//Manually add graphic object into stream layer during init</SPAN>
streamLayer<SPAN class="punctuation token">.</SPAN><SPAN class="token function">add</SPAN><SPAN class="punctuation token">(</SPAN>
<SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Graphic</SPAN><SPAN class="punctuation token">(</SPAN>
<SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Point</SPAN><SPAN class="punctuation token">(</SPAN>xLoc<SPAN class="punctuation token">,</SPAN> yLoc<SPAN class="punctuation token">,</SPAN> map<SPAN class="punctuation token">.</SPAN>spatialReference<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">SimpleMarkerSymbol</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">{</SPAN>
ID<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"1"</SPAN> <SPAN class="comment token">//trackIdField</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>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)