I am trying to create a client side stream layer which has the geometry type as "point". The features are not getting added in the layer. Added my code below. Any idea what am I doing wrong?
Solved! Go to Solution.
Hi there,
Please take a look at the Add an array for client-side features topic to see the requirements for creating a client side stream layer. In this section, the following is pointed out:
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.
Based on this statement, you either need to change the basemap of the map to be in WGS 84 or the StreamLayer projection to match the view's spatialReference.
In any case, I updated your app to make couple of changes: https://codepen.io/U_B_U/pen/oNmMoyy?editors=1000
1. First I updated the baseman to be WGS84 basemap
2. Then I updated the geometry of the feature you are adding to use x and y coordinates instead of latitude and longitude.
You can see these updates in the codepen I provided above.
Hi there,
Please take a look at the Add an array for client-side features topic to see the requirements for creating a client side stream layer. In this section, the following is pointed out:
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.
Based on this statement, you either need to change the basemap of the map to be in WGS 84 or the StreamLayer projection to match the view's spatialReference.
In any case, I updated your app to make couple of changes: https://codepen.io/U_B_U/pen/oNmMoyy?editors=1000
1. First I updated the baseman to be WGS84 basemap
2. Then I updated the geometry of the feature you are adding to use x and y coordinates instead of latitude and longitude.
You can see these updates in the codepen I provided above.
Thanks @UndralBatsukh.
I do not want to change the basemap , how do we change the StreamLayer projection to match the view's spatialReference?
Exist possible a bug with baseMap when only set "name" the solution it convert your geometry with tool of the geomtry read this doc. Geometry projections | Documentation | Esri Developer and usually for convert and working the point in position exact.
Nothing changes. Basically update the codepen. Update the app so that the spatialReference of the StreamLayer matches the spatialReference of the view and pass the points in the spatial reference of the view. For example, this sample https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/client-side-stream-layer-is-not-w... passes the coordinates in Web Mercator.