I have plotted points to a clientside streamlayer but can't plot lines. I've tried many variations of plotting lines, but can't get it to work. Adding to my confusion, the documentation suggests it should be possible but I cannot find any examples of clientside streamlayers consisting of lines rather than points.
https://codepen.io/coxfsi/pen/JoPJEqz?editors=1001
Solved! Go to Solution.
Hi there,
There are couple of issues in the app you provided.
1. Geometries of features added to the StreamLayer must be in the spatial reference of the view, because the layer's spatialReference is always set to the spatial reference of the view. To avoid overhead, the stream layer does not do any additional processing or reprojecting on features as they arrive. This behavior is documented here. So you either need to use a basemap in WGS84 or your features need to have geometries in Web Mercator.
2. StreamLayer.sendMessageToClient() states that when sending features message then your features have to be esri JSON feature object.
Based on this, I updated your codepen: https://codepen.io/U_B_U/pen/QwLqrpd?editors=1000
Hi there,
There are couple of issues in the app you provided.
1. Geometries of features added to the StreamLayer must be in the spatial reference of the view, because the layer's spatialReference is always set to the spatial reference of the view. To avoid overhead, the stream layer does not do any additional processing or reprojecting on features as they arrive. This behavior is documented here. So you either need to use a basemap in WGS84 or your features need to have geometries in Web Mercator.
2. StreamLayer.sendMessageToClient() states that when sending features message then your features have to be esri JSON feature object.
Based on this, I updated your codepen: https://codepen.io/U_B_U/pen/QwLqrpd?editors=1000