<?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: Arcgis Javascript API 4.14 Moving marker symbol in the Graphics Layer in Angular 8 is not smooth in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1044000#M72363</link>
    <description>&lt;P&gt;If the SketchViewModel runs slower in Angular than in a vanilla JS app, and there aren't any errors in the console, it's possible the performance issue is related to zone.js and Angular's built-in component change detection. There are two primary ways to try and address these types of issues.&lt;/P&gt;&lt;P&gt;You can move to a manual change detection pattern within your map component, there is a lot of info about this on the web, here is one &lt;A href="https://www.andygup.net/manual-change-detection-in-angular-for-performance/" target="_self"&gt;example&lt;/A&gt; of how to do it.&lt;/P&gt;&lt;P&gt;Or, you can also try running your code &lt;A href="https://angular.io/api/core/NgZone" target="_self"&gt;outside of the Angular "zone"&lt;/A&gt;, similar to this super basic, pseudo-example:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    this.zone.runOutsideAngular(() =&amp;gt; {
      // Initialize MapView here
      this.initializeMap().then(() =&amp;gt; {
        // The map has been initialized
        . . .
        // For non-map-related component events, run them outside the Zone
        this.zone.run(() =&amp;gt; {
          console.log('mapView ready: ');
        });
      });
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Apr 2021 21:56:42 GMT</pubDate>
    <dc:creator>AndyGup</dc:creator>
    <dc:date>2021-04-05T21:56:42Z</dc:date>
    <item>
      <title>Arcgis Javascript API 4.14 Moving marker symbol in the Graphics Layer in Angular 8 is not smooth</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1043396#M72339</link>
      <description>&lt;P&gt;We have an app with a simple implementation of ESRI Arcgis Javascript API (arcgis-js-api v4.14.0) with esri-loader v2.13.0.We are using Angular 8 and JDK 11, .&lt;/P&gt;&lt;P&gt;The application displays a topographical&amp;nbsp; map in an Angular dialog window. The user may add/delete marker symbols on the map using a left mouse-click. The user may also move the marker symbol by left mouse-click on the marker symbol and dragging the marker symbol.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkGlass_0-1617379186868.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/9985i8B2E4693E3016662/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkGlass_0-1617379186868.png" alt="MarkGlass_0-1617379186868.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Question has to do with the dragging behavior. It's choppy and easily lost if the user moves too fast.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    return loadModules([
      'esri/Map',
      'esri/views/MapView',
      'esri/Graphic',
      'esri/layers/GraphicsLayer',
    ])
      .then(([Map, MapView, Graphic, GraphicsLayer]) =&amp;gt; {
.....          
         this.mapView.on('drag', (event:DragEvent) =&amp;gt; {
            event.stopPropagation();

            this.mapView.hitTest(event)
              .then((response) =&amp;gt; {
                if (response.results.length &amp;gt; 1) {
                  const graphic = response.results[0].graphic;

                  const mapPoint = response.results[0].mapPoint;
                  const location = this.getLocationFromMapPoint(mapPoint);
                  const pointGraphic: esri.Graphic = this.getGraphic(Graphic, location);
                  this.removePin(graphic);
                  this.addPin(pointGraphic);
                }
              });
          })&lt;/LI-CODE&gt;&lt;P&gt;removePin(graphic) removes the pin(i.e. marker symbol) from the graphic layer and addPin places a new pin in the graphic layer.&lt;/P&gt;&lt;P&gt;Is there a better way to move the marker symbol?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 16:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1043396#M72339</guid>
      <dc:creator>MarkGlass</dc:creator>
      <dc:date>2021-04-02T16:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Javascript API 4.14 Moving marker symbol in the Graphics Layer in Angular 8 is not smooth</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1043549#M72345</link>
      <description>&lt;P&gt;If you are looking to move graphics around the map, the easiest way is to use the SketchViewModel, it can manage that for you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch-SketchViewModel.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 21:59:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1043549#M72345</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-04-02T21:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Javascript API 4.14 Moving marker symbol in the Graphics Layer in Angular 8 is not smooth</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1043834#M72352</link>
      <description>&lt;P&gt;Thank you for your quick response. I took a look at the link you sent back and tried to envision how it might work with what I've done already. I did another search for examples based on Sketchview but am still not able to see how I can use SketchViewModel to resolve my problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you provide an example how SketchViewModel can be used in conjunction with a WebView using JSAPI 4.14?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 16:24:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1043834#M72352</guid>
      <dc:creator>MarkGlass</dc:creator>
      <dc:date>2021-04-05T16:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Javascript API 4.14 Moving marker symbol in the Graphics Layer in Angular 8 is not smooth</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1043883#M72353</link>
      <description>&lt;P&gt;Check this one out.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sketch-update-validation/" target="_blank"&gt;Sketch update validation | ArcGIS API for JavaScript&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 17:46:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1043883#M72353</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-04-05T17:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcgis Javascript API 4.14 Moving marker symbol in the Graphics Layer in Angular 8 is not smooth</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1044000#M72363</link>
      <description>&lt;P&gt;If the SketchViewModel runs slower in Angular than in a vanilla JS app, and there aren't any errors in the console, it's possible the performance issue is related to zone.js and Angular's built-in component change detection. There are two primary ways to try and address these types of issues.&lt;/P&gt;&lt;P&gt;You can move to a manual change detection pattern within your map component, there is a lot of info about this on the web, here is one &lt;A href="https://www.andygup.net/manual-change-detection-in-angular-for-performance/" target="_self"&gt;example&lt;/A&gt; of how to do it.&lt;/P&gt;&lt;P&gt;Or, you can also try running your code &lt;A href="https://angular.io/api/core/NgZone" target="_self"&gt;outside of the Angular "zone"&lt;/A&gt;, similar to this super basic, pseudo-example:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    this.zone.runOutsideAngular(() =&amp;gt; {
      // Initialize MapView here
      this.initializeMap().then(() =&amp;gt; {
        // The map has been initialized
        . . .
        // For non-map-related component events, run them outside the Zone
        this.zone.run(() =&amp;gt; {
          console.log('mapView ready: ');
        });
      });
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 21:56:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-4-14-moving-marker-symbol-in/m-p/1044000#M72363</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-04-05T21:56:42Z</dc:date>
    </item>
  </channel>
</rss>

