AnsweredAssumed Answered

Add snapping to widget

Question asked by WBogren@slco.org_slco on Oct 6, 2020
Latest reply on Oct 6, 2020 by tsellste




I would like to add snapping functionality to an existing custom widget, for use in a web app built with Web AppBuilder (Developer Edition).  When starting a new feature, I'd like my cursor to snap to control points or polygon vertices, but I've not found documentation or snippets for guidance how or where to add this.



I am creating a web app using the Web AppBuilder (Developer Edition), with fairly simple but specific functionality: sketch traverses using distance and bearing courses, to be compared against existing polygons in a separate layer.  The traverse courses should be possible to save/load to/from text files.  It looks like Tom Sellsted's Traverse widget fits the bill perfectly.  Parcel Drafter would seem the obvious alternative, but I think the Traverse save/load features are actually more in line with our needs.



When choosing the traverse's starting point, I would like the cursor to snap to control points in a point layer or vertices in a separate polygon layer. Are there any examples out there for how to add this kind of snapping to the starting point cursor's behavior? It's also possible this should be set in the web map the app is based on; any help, guidance, tips, or pointers are appreciated!


Thank you,