<?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: AGSGraphicsLayer addGraphic: Too Slow in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsgraphicslayer-addgraphic-too-slow/m-p/461053#M3955</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; ...Unfortunately this is extremely slow and there is noticeable lag as the user draws on the screen. Will I need to use a UIView to accomplish this?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is the user 1) tapping to add points to a piece of geometry, or 2) dragging their finger to sketch geometry?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You probably want to use &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSSketchGraphicsLayer&lt;/SPAN&gt;&lt;SPAN&gt; for creating geometry through this type user input. Have you looked at the &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=5106817cf79f44c99f8045e2d705f279"&gt;code sample provided by ESRI&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If 2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The ArcGIS Runtime SDK does not provide a good method for doing this. I have accomplished this workflow by adding a custom sketching layer on top of the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSMapView&lt;/SPAN&gt;&lt;SPAN&gt; that catches the users freehand gesture, draws it using core graphics, and then converts the sketched gesture into an &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSGraphic&lt;/SPAN&gt;&lt;SPAN&gt; and draws that on the map. If this is your intended workflow, you are correct that you will have to draw on a &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;UIView&lt;/SPAN&gt;&lt;SPAN&gt; and translate that geometry into the map. The good news is that, with a little tweaking, you can create an incredibly smooth interface.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Mar 2013 16:31:02 GMT</pubDate>
    <dc:creator>DanaMaher</dc:creator>
    <dc:date>2013-03-05T16:31:02Z</dc:date>
    <item>
      <title>AGSGraphicsLayer addGraphic: Too Slow</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsgraphicslayer-addgraphic-too-slow/m-p/461052#M3954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: iqubalhusain&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to create an application which supports "drawing style" annotations. To do this I setup a touch delegate from the map view. Between the previous and next point I create a AGSGraphic and load it onto the graphics layer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
- (void) addPointToMapFrom:(AGSPoint *) pp to:(AGSPoint *) cp;
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create Simple for Polyline
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSSimpleLineSymbol *lineSymbol = [AGSSimpleLineSymbol simpleLineSymbol];
&amp;nbsp;&amp;nbsp;&amp;nbsp; lineSymbol.width = 3.0;
&amp;nbsp;&amp;nbsp;&amp;nbsp; lineSymbol.color = self.roleColor; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create Polyline Geometry
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSMutablePolyline *polyline = [[AGSMutablePolyline alloc] initWithSpatialReference:self.mapView.spatialReference];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [polyline addPathToPolyline]; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; [polyline addPointToPath:pp];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [polyline addPointToPath:cp];
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Add to graphics layer 
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSGraphic *graphic = [AGSGraphic graphicWithGeometry:polyline symbol:lineSymbol attributes:nil infoTemplateDelegate:nil];
&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.graphicsLayer addGraphic:graphic];

&amp;nbsp;&amp;nbsp; 

}

&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately this is extremely slow and there is noticeable lag as the user draws on the screen. Will I need to use a UIView to accomplish this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:30:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsgraphicslayer-addgraphic-too-slow/m-p/461052#M3954</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T20:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: AGSGraphicsLayer addGraphic: Too Slow</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsgraphicslayer-addgraphic-too-slow/m-p/461053#M3955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; ...Unfortunately this is extremely slow and there is noticeable lag as the user draws on the screen. Will I need to use a UIView to accomplish this?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is the user 1) tapping to add points to a piece of geometry, or 2) dragging their finger to sketch geometry?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You probably want to use &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSSketchGraphicsLayer&lt;/SPAN&gt;&lt;SPAN&gt; for creating geometry through this type user input. Have you looked at the &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=5106817cf79f44c99f8045e2d705f279"&gt;code sample provided by ESRI&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If 2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The ArcGIS Runtime SDK does not provide a good method for doing this. I have accomplished this workflow by adding a custom sketching layer on top of the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSMapView&lt;/SPAN&gt;&lt;SPAN&gt; that catches the users freehand gesture, draws it using core graphics, and then converts the sketched gesture into an &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSGraphic&lt;/SPAN&gt;&lt;SPAN&gt; and draws that on the map. If this is your intended workflow, you are correct that you will have to draw on a &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;UIView&lt;/SPAN&gt;&lt;SPAN&gt; and translate that geometry into the map. The good news is that, with a little tweaking, you can create an incredibly smooth interface.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2013 16:31:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/agsgraphicslayer-addgraphic-too-slow/m-p/461053#M3955</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2013-03-05T16:31:02Z</dc:date>
    </item>
  </channel>
</rss>

