<?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 Re: SketchViewModel behavior change from 4.13 to 4.14 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-behavior-change-from-4-13-to-4-14/m-p/1338257#M82470</link>
    <description>&lt;P&gt;I was able to get help elsewhere and the solution was to embed the&amp;nbsp;onEditGraphicMove() method within the&amp;nbsp;&lt;SPAN&gt;SketchViewModel&amp;nbsp;on(update) event handler.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Oct 2023 15:43:23 GMT</pubDate>
    <dc:creator>TimDietz</dc:creator>
    <dc:date>2023-10-16T15:43:23Z</dc:date>
    <item>
      <title>SketchViewModel behavior change from 4.13 to 4.14</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-behavior-change-from-4-13-to-4-14/m-p/1336766#M82431</link>
      <description>&lt;P&gt;On our map, we have a crosshair symbol for the current location.&amp;nbsp; There is an Edit button that, when clicked, will allow the user to click anywhere within that crosshair and drag that crosshair to another location (without moving the map).&amp;nbsp; It works fine in 4.13, but not in 4.14.&lt;/P&gt;&lt;P&gt;When the Edit button is clicked, a function is called to update the&amp;nbsp;SketchViewModel with the crosshair symbol and set tool to 'move'.&amp;nbsp; It then creates a listener that calls a function to perform the desired actions upon update (coded in TypeScript):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  private startUpdate() {
    this.isEditing = true;
    this.editGraphic.symbol = this.featureEditSymbol;
    this.sketchViewModel.update([this.editGraphic], {
      tool: 'move',
    });

    // This commented code works in 4.13. I needed to add the .bind(this)
    // to get it to compile in 4.14.
    //this.editGraphicUpdateListener = this.sketchViewModel.on('update', this.onEditGraphicMove);
    this.editGraphicUpdateListener = this.sketchViewModel.on('update', this.onEditGraphicMove.bind(this));
  }

  // This is to re-center the map on the current position of the location marker as it is dropped.
  onEditGraphicMove(event: __esri.UpdateToolEventInfo) {
    if (event['state'] === 'active' &amp;amp;&amp;amp; event.propertyIsEnumerable('toolEventInfo')) {
      const toolEventInfo = event['toolEventInfo'];
      if (toolEventInfo.propertyIsEnumerable('type')) {
        if (toolEventInfo.type === 'move-stop') {
          this.editGraphicPoint = new Point(toolEventInfo.mover.geometry);
          this['view'].center = this.editGraphicPoint;
        }
      }
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;The 4.13 version did not immediately fire that event to call onEditGraphicMove(), but the 4.14 version fires the event right after the listener is registered.&amp;nbsp; When that occurs, the event state is 'update'.&lt;/P&gt;&lt;P&gt;So, after I click the Edit button, if I hover over the crosshair, the cursor does not change to a hand and if I click and drag the crosshair, it moves the entire map instead of just the marker.&lt;/P&gt;&lt;P&gt;Can someone please show me how to do this in 4.14 and beyond?&amp;nbsp; I have not been able to find anything on the web or this site that has been helpful.&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 21:50:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-behavior-change-from-4-13-to-4-14/m-p/1336766#M82431</guid>
      <dc:creator>TimDietz</dc:creator>
      <dc:date>2023-10-10T21:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: SketchViewModel behavior change from 4.13 to 4.14</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-behavior-change-from-4-13-to-4-14/m-p/1338257#M82470</link>
      <description>&lt;P&gt;I was able to get help elsewhere and the solution was to embed the&amp;nbsp;onEditGraphicMove() method within the&amp;nbsp;&lt;SPAN&gt;SketchViewModel&amp;nbsp;on(update) event handler.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2023 15:43:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketchviewmodel-behavior-change-from-4-13-to-4-14/m-p/1338257#M82470</guid>
      <dc:creator>TimDietz</dc:creator>
      <dc:date>2023-10-16T15:43:23Z</dc:date>
    </item>
  </channel>
</rss>

