<?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: Sketch widget tools take time to display mouse cursor when it gets activated first time in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1320132#M82023</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;Thanks for replying. Map and MapView have already been initialized before I initialized Sketch widget in a separate function. So, they are already available on the client.&lt;/P&gt;&lt;P&gt;It is like when screen loads then&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;function A(){

require(["esri/Map", "esri/views/MapView"], function(Map, MapView) {

});

}&lt;/LI-CODE&gt;&lt;P&gt;Then call function B on a separate button click.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;function B() {

require(['esri/widgets/Sketch', 'esri/widgets/Sketch/SketchViewModel'], function(Sketch, SketchViewModel) {

var sketch = new Sketch({
           defaultCreateOptions: {
                mode: 'click'
           },
          layer: &amp;lt;graphic layer&amp;gt;,
          updateOnGraphicClick: false,
         view: mapView,
          viewModel: new SketchViewModel({
             pointSymbol: &amp;lt;pointSymbol&amp;gt;,
             polylineSymbol: &amp;lt;polylineSymbol&amp;gt;
         })
    });

      sketch.when(function(){
           sketch.create(&amp;lt;tool&amp;gt;); //tool is point or polyline
      });
});}


&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2023 15:27:07 GMT</pubDate>
    <dc:creator>BhavinSanghani</dc:creator>
    <dc:date>2023-08-18T15:27:07Z</dc:date>
    <item>
      <title>Sketch widget tools take time to display mouse cursor when it gets activated first time</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1319595#M82008</link>
      <description>&lt;P&gt;I have written my code to initiate the Sketch tools following way.&lt;/P&gt;&lt;P&gt;When the tool gets activated first time on click of the button (it's in my application, not the Sketch widget button) then it downloads several small javascript files and the tool related mouse cursor(crosshair) doesn't appear on the map immediately. This behavior is noticeable if you throttle the speed in Chrome to Slow 3G.&amp;nbsp;&lt;/P&gt;&lt;P&gt;require(['esri/widgets/Sketch', 'esri/widgets/Sketch/SketchViewModel'], function(Sketch, SketchViewModel) {&lt;BR /&gt;&lt;BR /&gt;var sketch = new Sketch({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;defaultCreateOptions: {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mode: 'click'&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; layer: &amp;lt;graphic layer&amp;gt;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; updateOnGraphicClick: false,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;view: mapView,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; viewModel: new SketchViewModel({&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pointSymbol: &amp;lt;pointSymbol&amp;gt;,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;polylineSymbol: &amp;lt;polylineSymbol&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;})&lt;BR /&gt;&amp;nbsp; &amp;nbsp; });&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sketch.when(function(){&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sketch.create(&amp;lt;tool&amp;gt;); //tool is point or polyline&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea on how to improve this performance or correct way to activate the tool so user doesn't require to wait?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 14:09:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1319595#M82008</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2023-08-17T14:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch widget tools take time to display mouse cursor when it gets activated first time</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1319910#M82014</link>
      <description>&lt;P&gt;You could also require these modules when your application starts up, i.e. in the same call to require that includes your MapView:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require(["esri/Map", "esri/views/MapView", "esri/widgets/Sketch", "esri/widgets/Sketch/SketchViewModel"], function(Map, MapView, Sketch, SketchViewModel) {
	var map = new Map({
		//etc
	});

	//etc
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That way, when your existing code executes, those modules will already be available on the client.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 22:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1319910#M82014</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-08-17T22:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch widget tools take time to display mouse cursor when it gets activated first time</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1320132#M82023</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;Thanks for replying. Map and MapView have already been initialized before I initialized Sketch widget in a separate function. So, they are already available on the client.&lt;/P&gt;&lt;P&gt;It is like when screen loads then&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;function A(){

require(["esri/Map", "esri/views/MapView"], function(Map, MapView) {

});

}&lt;/LI-CODE&gt;&lt;P&gt;Then call function B on a separate button click.&lt;/P&gt;&lt;LI-CODE lang="c"&gt;function B() {

require(['esri/widgets/Sketch', 'esri/widgets/Sketch/SketchViewModel'], function(Sketch, SketchViewModel) {

var sketch = new Sketch({
           defaultCreateOptions: {
                mode: 'click'
           },
          layer: &amp;lt;graphic layer&amp;gt;,
          updateOnGraphicClick: false,
         view: mapView,
          viewModel: new SketchViewModel({
             pointSymbol: &amp;lt;pointSymbol&amp;gt;,
             polylineSymbol: &amp;lt;polylineSymbol&amp;gt;
         })
    });

      sketch.when(function(){
           sketch.create(&amp;lt;tool&amp;gt;); //tool is point or polyline
      });
});}


&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 15:27:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1320132#M82023</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2023-08-18T15:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch widget tools take time to display mouse cursor when it gets activated first time</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1320193#M82025</link>
      <description>&lt;P&gt;Yes, but what I'm saying is that you should &lt;U&gt;also&lt;/U&gt; include Sketch and SketchViewModel in the call to require in function A, even if you don't use them in function A.&amp;nbsp; That way, Sketch and SketchViewModel will already be available on the client by the time function B is called.&amp;nbsp; Otherwise function B executes, and then it has to wait until those modules download before the "real" execution takes place.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 16:58:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1320193#M82025</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-08-18T16:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch widget tools take time to display mouse cursor when it gets activated first time</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1321098#M82056</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;. I was thinking about it as a temporary fix. It looks like a workaround and I will try out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any idea if this is a bug with the API?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 12:27:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1321098#M82056</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2023-08-22T12:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Sketch widget tools take time to display mouse cursor when it gets activated first time</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1321248#M82061</link>
      <description>&lt;P&gt;No, this is not a bug.&amp;nbsp; It is by design that modules are not downloaded until they are imported via a call to "require" or "define".&amp;nbsp; Therefore, it makes sense to import the modules you need when the application is starting up.&amp;nbsp; It may make startup time a little bit longer, but the user expects some load time at the beginning.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 17:10:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/sketch-widget-tools-take-time-to-display-mouse/m-p/1321248#M82061</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2023-08-22T17:10:48Z</dc:date>
    </item>
  </channel>
</rss>

