<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SketchViewModel javascript api, fires view click. in .NET and the Esri JavaScript API Questions</title>
    <link>https://community.esri.com/t5/net-and-the-esri-javascript-api-questions/sketchviewmodel-javascript-api-fires-view-click/m-p/795163#M33</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im using javascript api&amp;nbsp;4.13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created some drawing tools using the SketchViewModel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im not using the widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im using sketch.create("polygon");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this works perfect and i can draw polygons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if i close a polygon drawing&amp;nbsp; by clicking on the first vertex created,&amp;nbsp; then&amp;nbsp; the polygon complete event fires. The problem is I then get a click event on the view for that point.&lt;/P&gt;&lt;P&gt;This doesnt happen if i close the polygon by double clicking to close the polygon.&amp;nbsp; I dont get a click event fire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is that on the sketch complete event i fire the sketch.create("polygon").&amp;nbsp; as i want to be able to keep drawing polygons without the need to reselect the polygon tool.&amp;nbsp; 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&amp;nbsp; click the point as the views click event is firing and i get the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dojo.js:628 Uncaught TypeError: Cannot use 'in' operator to search for 'type' in null&lt;BR /&gt; at Object.c.isSupportedScreenPointEvent (dojo.js:628)&lt;BR /&gt; at Object.c.toMap (MapView.js:463)&lt;BR /&gt; at Object.c._updateCursor (PolygonDrawAction.js:13)&lt;BR /&gt; at PolygonDrawAction.js:10&lt;BR /&gt; at a._callback (dojo.js:1886)&lt;BR /&gt; at b.a._handleEvent (dojo.js:1901)&lt;BR /&gt; at Object.eventCallback (dojo.js:1897)&lt;BR /&gt; at Object.d._doNewPropagation (MapView.js:290)&lt;BR /&gt; at Object.d._emitInputEvent (MapView.js:289)&lt;BR /&gt; at Object.d._emitInputEventFromSource (MapView.js:288)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Nov 2019 04:50:50 GMT</pubDate>
    <dc:creator>DavidDoyle</dc:creator>
    <dc:date>2019-11-13T04:50:50Z</dc:date>
    <item>
      <title>SketchViewModel javascript api, fires view click.</title>
      <link>https://community.esri.com/t5/net-and-the-esri-javascript-api-questions/sketchviewmodel-javascript-api-fires-view-click/m-p/795163#M33</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im using javascript api&amp;nbsp;4.13&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created some drawing tools using the SketchViewModel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im not using the widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;im using sketch.create("polygon");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this works perfect and i can draw polygons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However if i close a polygon drawing&amp;nbsp; by clicking on the first vertex created,&amp;nbsp; then&amp;nbsp; the polygon complete event fires. The problem is I then get a click event on the view for that point.&lt;/P&gt;&lt;P&gt;This doesnt happen if i close the polygon by double clicking to close the polygon.&amp;nbsp; I dont get a click event fire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my problem is that on the sketch complete event i fire the sketch.create("polygon").&amp;nbsp; as i want to be able to keep drawing polygons without the need to reselect the polygon tool.&amp;nbsp; 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&amp;nbsp; click the point as the views click event is firing and i get the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dojo.js:628 Uncaught TypeError: Cannot use 'in' operator to search for 'type' in null&lt;BR /&gt; at Object.c.isSupportedScreenPointEvent (dojo.js:628)&lt;BR /&gt; at Object.c.toMap (MapView.js:463)&lt;BR /&gt; at Object.c._updateCursor (PolygonDrawAction.js:13)&lt;BR /&gt; at PolygonDrawAction.js:10&lt;BR /&gt; at a._callback (dojo.js:1886)&lt;BR /&gt; at b.a._handleEvent (dojo.js:1901)&lt;BR /&gt; at Object.eventCallback (dojo.js:1897)&lt;BR /&gt; at Object.d._doNewPropagation (MapView.js:290)&lt;BR /&gt; at Object.d._emitInputEvent (MapView.js:289)&lt;BR /&gt; at Object.d._emitInputEventFromSource (MapView.js:288)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Nov 2019 04:50:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-and-the-esri-javascript-api-questions/sketchviewmodel-javascript-api-fires-view-click/m-p/795163#M33</guid>
      <dc:creator>DavidDoyle</dc:creator>
      <dc:date>2019-11-13T04:50:50Z</dc:date>
    </item>
  </channel>
</rss>

