Good Day
I have a bunch of assets which are MutliLineStrings that are sent to a Stream Layer. I need to query them using the StreamLayerView and append some of them to a Feature Layer so I can dynamically work with them. The issue is when I clone the feature from the StreamLayerView, and add it to the Feature Layer, it doesn't show up correctly. The grey lines are from the StreamLayer, and they are correct. The red line is the one I cloned from the Layer View, and added to the Feature Layer.
const query = {
outFields: ['*'],
where: '1=1',
returnGeometry: true
}
this._view.map.layers.forEach((layer: StreamLayer) => {
if (layer.type === 'stream') {
this._view.whenLayerView(layer).then((layerView: StreamLayerView) => {
layerView.queryFeatures(query).then((features) => {
const newFeatures = [];
features.features.forEach((feature) => {
newFeature.push(feature.clone())
})
})
}
})
this.featureLayer =
new FeatureLayer(
this.buildFeatureLayer(
newFeatures[0].geometry.type,
fields,
newFeatures
)
)
The code above is just a sample, but what would cause the issue I'm experiencing? Is there a way to prevent it, the StreamLayer is showing the feature correctly, so I'm assuming it's a problem from the StreamLayerView query?
Thanks
Hi there,
Would you mind sharing a simple reproducible example? It would help us understand the issue more clearly and troubleshoot it faster.
There's no way to set up a simple Stream Layer example, it would involve setting up a backend, database, frontend, and hooking it altogether, If I give you a SQL file, GO Backend, Angular Frontend, would that work? Can you run each separate part?
Thanks
Can you please post the geometry (json representation) that is in question here?
I am not able to reproduce the issue in this simple test app - https://codepen.io/U_B_U/pen/MYYqErz?editors=1000
Good Evening
It seems to be a problem with the Feature Layer not redrawing the features, if I zoom in to that area above, and force it to query the layerView, the Feature Layer looks fine. I think when the initial query happens, the geometries are messed up, but get refreshed when zooming in. When those coloured features are added to the Feature Layer the map extent is rather zoomed out, is there a way to force the Feature Layer to redraw included Features?
That should not happen. Repro case would be useful in this case. Which version of the API are you using?