SketchViewModel javascript api, fires view click.

337
0
11-12-2019 08:50 PM
DavidDoyle
New Contributor

Hi,

Im using javascript api 4.13

I have created some drawing tools using the SketchViewModel.

im not using the widget.

im using sketch.create("polygon");

this works perfect and i can draw polygons.

However if i close a polygon drawing  by clicking on the first vertex created,  then  the polygon complete event fires. The problem is I then get a click event on the view for that point.

This doesnt happen if i close the polygon by double clicking to close the polygon.  I dont get a click event fire.

my problem is that on the sketch complete event i fire the sketch.create("polygon").  as i want to be able to keep drawing polygons without the need to reselect the polygon tool.  This works fine when i use double click to complete a polygon. but if i close the polygon by selecting the first point in the polgyon then i get an error as its trying to immediately  click the point as the views click event is firing and i get the following error:

dojo.js:628 Uncaught TypeError: Cannot use 'in' operator to search for 'type' in null
at Object.c.isSupportedScreenPointEvent (dojo.js:628)
at Object.c.toMap (MapView.js:463)
at Object.c._updateCursor (PolygonDrawAction.js:13)
at PolygonDrawAction.js:10
at a._callback (dojo.js:1886)
at b.a._handleEvent (dojo.js:1901)
at Object.eventCallback (dojo.js:1897)
at Object.d._doNewPropagation (MapView.js:290)
at Object.d._emitInputEvent (MapView.js:289)
at Object.d._emitInputEventFromSource (MapView.js:288)

0 Kudos
0 Replies