Hi,
I'm having a quite unexpected behaviour with sketchWidget, which performs hundreds of queries (for snapping ?) even with snappingOptions disabled.
Here is a Codepen that shows it.
https://codepen.io/christophesuter/pen/zYpjVrm
Maps loads, and after 10 seconds Sketchwidget loads after an alert.
Is there any parameter in sketchWidget that I could you to prevent this ?
Solved! Go to Solution.
Hello @ChristopheSuter ,
This is an issue with the SnappingControls widget, and is currently being worked on for 4.24. The widget is currently fetching the layer extent for all the layers on the Map, even if you disable feature snapping. This was originally reported in the following thread:
Unfortunately, the only way to resolve this is to use the SketchViewModel without Sketch and programmatically configure the SnappingOptions. This is of course not ideal for anyone working with the Sketch widget. This will be fixed for 4.24.
Thanks,
Jose
Hello @ChristopheSuter ,
This is an issue with the SnappingControls widget, and is currently being worked on for 4.24. The widget is currently fetching the layer extent for all the layers on the Map, even if you disable feature snapping. This was originally reported in the following thread:
Unfortunately, the only way to resolve this is to use the SketchViewModel without Sketch and programmatically configure the SnappingOptions. This is of course not ideal for anyone working with the Sketch widget. This will be fixed for 4.24.
Thanks,
Jose
ok thanks for the reply
Hi @ChristopheSuter, @JoseBanuelos,
I'm having the same problem using the Editor widget. We've made it an official bug in the meantime and hoping for a fix in 4.24.
Here's what I did to mitigate:
esriConfig.request.interceptors.push({
urls: flUrls,
before: (params: BeforeInterceptorCallbackParams) => {
params.requestOptions.timeout = 1;
},
});
Cancelling the requests from here doesn't seem to be possible, because we only get the AbortSignal from the RequestOptions , but not the AbortController. So I'm setting the timeout of the unwanted requests to 1 ms, causing the client to cancel the requests before anything downloads (probably still causing unwanted server load - but I didn't look into that).
Plus a bit of logic to update the interceptor regarding the "flUrls" (which are the feature layer URLs being 'blocked') when layer visibility changes (watcher on the visibility prop of every layer).
Hope this helps!
Cheers, Nik