<?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: Drawing Graphics on Different esri Basemaps in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440432#M3761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Later in the application, on user input, graphics are added to the graphics layer via the addGraphics method. if the above URL for the tiled layer is changed to: &lt;A href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer&lt;/A&gt;, the street basemap, then the graphic is added to the graphics layer and appears as it should.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it sounds like my basic solution worked? You could mark that as the answer for future readers. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; To further complicate things, After I added the graphic in the World_Imagery situation, I tried removing the World Imagery layer to see if the graphic was behind it, but, when I remove that layer, i am left with nothing but the black screen with the checker-box pattern on it.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The first layer added defines the spatial reference and extent of the map. If you remove that layer, the map looks for the next layer up in the stack and uses that layer to set the spatial reference and extent. I'm not sure what happens if an &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSGraphicsLayer&lt;/SPAN&gt;&lt;SPAN&gt; becomes the base/bottom layer. &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/runtime-ios-sdk/apiref/interface_a_g_s_graphics_layer.html"&gt;The documentation for &lt;SPAN style="font-style:italic;"&gt;AGSGraphicsLayer&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; notes that if a graphics layer is to be a base/bottom layer, it should be created using &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;-(id)initWithFullEnvelope:&lt;/SPAN&gt;&lt;SPAN&gt; . In your case, the graphics layers might not have any envelope settings and as such will not function properly as a base layer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Jan 2013 22:00:28 GMT</pubDate>
    <dc:creator>DanaMaher</dc:creator>
    <dc:date>2013-01-31T22:00:28Z</dc:date>
    <item>
      <title>Drawing Graphics on Different esri Basemaps</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440429#M3758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to draw a graphic on an esri basemap. I started with the ESRI_StreetMap_World_2D basemap. It is created in the viewDidLoad method of my view controller like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSTiledMapServiceLayer *tiledLayer =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [AGSTiledMapServiceLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tiledMapServiceLayerWithURL:[NSURL URLWithString:@"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" rel="nofollow" target="_blank"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer&lt;/A&gt;&lt;SPAN&gt;"]];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.mapView addMapLayer:tiledLayer withName:@"World Imagery"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I then draw a graphic, a blue simple marker symbol, on user input. However, if i switch to &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" rel="nofollow" target="_blank"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer&lt;/A&gt;&lt;SPAN&gt; as my basemap, the graphic no longer draws. Is there something with the imagery layer where you cannot draw graphics on it? The only change I make to my code that results in the graphic not being drawn is changing the URL of the basemap.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 14:53:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440429#M3758</guid>
      <dc:creator>ChristopherBarger</dc:creator>
      <dc:date>2013-01-31T14:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Graphics on Different esri Basemaps</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440430#M3759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;I then draw a graphic, a blue simple marker symbol, on user input. However, if i switch to &lt;A href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer&lt;/A&gt; as my basemap, the graphic no longer draws. Is there something with the imagery layer where you cannot draw graphics on it? The only change I make to my code that results in the graphic not being drawn is changing the URL of the basemap.&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So are you removing the first &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSTiledMapServiceLayer&lt;/SPAN&gt;&lt;SPAN&gt; and adding a new &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSTiledMapServiceLayer&lt;/SPAN&gt;&lt;SPAN&gt; ? And you are drawing your graphic in an &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSGraphicsLayer&lt;/SPAN&gt;&lt;SPAN&gt;? If you are using the -(void)addMapLayer: method of &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSMapView&lt;/SPAN&gt;&lt;SPAN&gt;, you are probably adding the new tiled layer on top of the graphics layer, which is why your graphic is disappearing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, use the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;-(void)insertMapLayer:atIndex:&lt;/SPAN&gt;&lt;SPAN&gt; or &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;-(void)insertMapLayer:withName:atIndex:&lt;/SPAN&gt;&lt;SPAN&gt; methods to insert the new base map underneath the graphics layer. The appropriate index would probably be 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;ArcGIS Runtime SDK&lt;/SPAN&gt;&lt;SPAN&gt; is different from other map SDKs in that it doesn't presume a base map that always underlies other data and layers. For instance, the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;MKMapView&lt;/SPAN&gt;&lt;SPAN&gt; class in iOS's &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;MKMapKit&lt;/SPAN&gt;&lt;SPAN&gt; has a &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;mapType&lt;/SPAN&gt;&lt;SPAN&gt; typedef that is used to swap between several always-on, always-under base map options (street, satellite, hybrid). In the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;ArcGIS Runtime SDK&lt;/SPAN&gt;&lt;SPAN&gt;, you are responsible for establishing and maintaining the visual hierarchy for every layer. With great power comes great responsibility &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 16:31:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440430#M3759</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2013-01-31T16:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Graphics on Different esri Basemaps</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440431#M3760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am adding the layers in order, but implemented your solution As Below&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;tiledMapServiceLayerWithURL:[NSURL URLWithString:@"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" rel="nofollow" target="_blank"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer&lt;/A&gt;&lt;SPAN&gt;"]];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.mapView insertMapLayer:tiledLayer withName:@"World Imagery" atIndex:0];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer = [AGSGraphicsLayer graphicsLayer];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [self.mapView addMapLayer:graphicsLayer withName:@"GraphicsLayer"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End Code&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Later in the application, on user input, graphics are added to the graphics layer via the addGraphics method. if the above URL for the tiled layer is changed to: &lt;/SPAN&gt;&lt;A href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer&lt;/A&gt;&lt;SPAN&gt;, the street basemap, then the graphic is added to the graphics layer and appears as it should.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To further complicate things, After I added the graphic in the World_Imagery situation, I tried removing the World Imagery layer to see if the graphic was behind it, but, when I remove that layer, i am left with nothing but the black screen with the checker-box pattern on it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 18:26:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440431#M3760</guid>
      <dc:creator>ChristopherBarger</dc:creator>
      <dc:date>2013-01-31T18:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Graphics on Different esri Basemaps</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440432#M3761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Later in the application, on user input, graphics are added to the graphics layer via the addGraphics method. if the above URL for the tiled layer is changed to: &lt;A href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"&gt;http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer&lt;/A&gt;, the street basemap, then the graphic is added to the graphics layer and appears as it should.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it sounds like my basic solution worked? You could mark that as the answer for future readers. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; To further complicate things, After I added the graphic in the World_Imagery situation, I tried removing the World Imagery layer to see if the graphic was behind it, but, when I remove that layer, i am left with nothing but the black screen with the checker-box pattern on it.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The first layer added defines the spatial reference and extent of the map. If you remove that layer, the map looks for the next layer up in the stack and uses that layer to set the spatial reference and extent. I'm not sure what happens if an &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSGraphicsLayer&lt;/SPAN&gt;&lt;SPAN&gt; becomes the base/bottom layer. &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/runtime-ios-sdk/apiref/interface_a_g_s_graphics_layer.html"&gt;The documentation for &lt;SPAN style="font-style:italic;"&gt;AGSGraphicsLayer&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; notes that if a graphics layer is to be a base/bottom layer, it should be created using &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;-(id)initWithFullEnvelope:&lt;/SPAN&gt;&lt;SPAN&gt; . In your case, the graphics layers might not have any envelope settings and as such will not function properly as a base layer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 22:00:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440432#M3761</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2013-01-31T22:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Graphics on Different esri Basemaps</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440433#M3762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just to clarify, after implementing your atIndex solution the behavior is exactly the same, as always, the graphic draws when using the streets basemap, and does not draw when using the world imagery basemap&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 15:20:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440433#M3762</guid>
      <dc:creator>ChristopherBarger</dc:creator>
      <dc:date>2013-02-01T15:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Graphics on Different esri Basemaps</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440434#M3763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Just to clarify, after implementing your atIndex solution the behavior is exactly the same, as always, the graphic draws when using the streets basemap, and does not draw when using the world imagery basemap&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok. I have seen &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSGraphicsLayers&lt;/SPAN&gt;&lt;SPAN&gt; fail to draw if the spatial reference of the geometries for the graphics does not match the spatial reference of the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSMapView&lt;/SPAN&gt;&lt;SPAN&gt;. Are the spatial references of your base maps different? For instance, take a look at ESRI's &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" rel="nofollow" target="_blank"&gt;World Street Map&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer" rel="nofollow" target="_blank"&gt;World Ocean Map&lt;/A&gt;&lt;SPAN&gt; services. The Street map service has a spatial reference of WKID 4326 (see the 'Spatial Reference' field), which is straight wgs84 latitude/longitude. The Ocean map service has a spatial reference of WKID 102100, which is the web mercator projection pushed by Google. If you add the Ocean map as your first layer, the AGSMapView will have the 102100 spatial reference, and if you add the Street map as your first layer, the AGSMapView will have the 4326 spatial reference. In either case, the spatial reference of the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSGeometry&lt;/SPAN&gt;&lt;SPAN&gt; objects you use to create your &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSGraphics&lt;/SPAN&gt;&lt;SPAN&gt; must be the same as the spatial reference of the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSMapView&lt;/SPAN&gt;&lt;SPAN&gt;, or the graphics won't draw. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your base maps *do* have separate spatial references, I worked up a quick demo when I saw your reply this morning, saw the behavior you are describing, and realized that I was using base map layers with different spatial references. I changed it to work around this using AGSGeometryEngine to project the geometry for the graphics if needed. I did notice that the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AGSMapView&lt;/SPAN&gt;&lt;SPAN&gt; does not function very well if you swap from a base layer with one spatial reference to a base layer with another, so I am calling reload on the map. See attached zip.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 17:10:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440434#M3763</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2013-02-01T17:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing Graphics on Different esri Basemaps</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440435#M3764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Fantastic, this was a projection issue. Using the geometry engine to project the graphic being added to the graphics layer solved my problem as the imagery layer was 102100. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Feb 2013 19:23:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/drawing-graphics-on-different-esri-basemaps/m-p/440435#M3764</guid>
      <dc:creator>ChristopherBarger</dc:creator>
      <dc:date>2013-02-01T19:23:37Z</dc:date>
    </item>
  </channel>
</rss>

