Snap to ArcGISDynamicMapServiceLayer in WAB

1942
1
01-28-2016 03:05 AM
OndrejFialík
New Contributor II

How do I enable snapping to ArcGISDynamicMapServiceLayer in WAB.

I try

var snapManager = this.map.enableSnapping();

var layerDyn = this.map.getLayer(this.map.layerIds[1]);

var layerInfos = [  {layer: layerDyn} ];

snapManager.setLayerInfos(layerInfos);

but snapping not working.

Please help me

Thanks a lot

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Ondrej,

   Snapping requires a FeatureLayer as snapping needs the geometry to exist on the client machine. A ArcGISDynamicMapServiceLayer is just an image downloaded from the server to the client so the client machine does not have the actual geometry to work with when snapping. Hope this clears this up for you.