WAB - enableSnapping for all visible features

2914
6
10-13-2015 04:39 AM
OndrejFialík
New Contributor II

Hello,

i need draw line and snap it to existing feaures from map service. Now it is possible to snap only to itself.

Widget code example:

postCreate: function(){

     snapManager = this.map.enableSnapping();

     toolbar = new Draw(this.map);

     toolbar.activate(Draw["POLYLINE"]); 

}

Please help me

Thanks

Ondra

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus

Ondra,

   Snapping to a graphic that you are currently drawing is not supported at this time.

0 Kudos
OndrejFialík
New Contributor II

Hi,

maybe we do not understand.

I need to snap the line that I just draw to the features from map service (Operational layers)

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ondra,

   Are you holding the "Ctrl" key when attempting to snap?

0 Kudos
OndrejFialík
New Contributor II

Yes, but line snap only itself

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Ondra,

   Sorry for the confusion. Currently snapping to features in the map is not supported. Only snapping to other drawing geometries is supported.

ZeZhengLi
Esri Contributor

Ondrej,

It seems that you can set the `layerInfos` parameter to specify snapping layers.

SnappingManager | API Reference | ArcGIS API for JavaScript

0 Kudos