Select to view content in your preferred language

Confused about FeatureSnappingLayerSource in SnappingOptions

258
0
09-26-2024 12:22 PM
ToddRunstein
Emerging Contributor

I'm on version 4.30.6 of the SDK, and struggling to limit which Layers are eligible for snapping in the Sketch Widget. I'm passing in a SnappingOptions instance, and later (when the MapView is done updating), I'm setting the "featureSources" to only include the Layers I wish to include, but it seems like all that property is good for is to enable layers for picking.

Here's a pen that demonstrates the list of FeatureSnappingLayerSources passed to the SnappingOptions (or to the SnappingControls) isn't the list displayed:

https://codepen.io/toddrun/pen/XWvbmbd

This seems like a bug to me, but perhaps the “featureSources” is nothing more than a way to enable/disable layers, rather than to include/exclude layers for snapping. Besides trying to target the "Sketch Layer" with css and setting it's display to "none", how else can I remove Layers from the SnappingControls list?

0 Kudos
0 Replies