Select to view content in your preferred language

Cannot override SnappingOptions.featureSources when loading a WebMap

215
0
04-04-2022 07:24 AM
LucasScharenbroich
Occasional Contributor

Using the latest 4.23 release, I am trying to override the snappingOptions of the Sketch widget in order to only show a limited number of layers to the user to select for snapping.  With a regular esri/Map object, I can successfully set the featureSources as desired.  However, if I load a WebMap, then setting the featureSources property on the snappingOptions has no effect and the FeatureLayers defined in the WebMap appear to always be used.

Trying to clear the featureSource later (via sketch.snappingOptions.featureSources.removeAll()) appears to have no effect, either.

Looking for a recommendation on how to work around this issue. Codepen demonstrating the issue: https://codepen.io/lscharen/pen/oNppGdj

0 Kudos
0 Replies