<?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 Hide/Show AGSLayer in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483195#M4119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Prior to 10.1 when you wanted to toggle the visibility of&amp;nbsp; layers you had to retain a copy of a layer's UIView and use the UIView's hidden property. The release notes now say to NOT do this, but rather to use the visible property on AGSLayer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm having trouble getting this to work. I add 3 layers to a map, then toggle either their visible property or the opacity property to (YES/NO, 0.0/1.0 respectively) to show / hide them. This does not work because the layers themselves sometimes won't load tiles until you interact with the map. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is troublesome as I would expect the map to load it's tiles as soon as it's been made visible. Is that not the case? How should I go about toggling the layers visibility like this AND have the tile imagery load, without the map having moved previously?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my example the streets layer should load because its the one that's visible at first. The Topo and Imagery layers, if you switch to them with the buttons below, will not display tiles until you move the map. Sometimes this works, sometimes it doesn't. For example on the iPhone simulator the Topo layer would not work, but the Imagery did work. On iPad simulator neither Topo nor Imagery would load until you moved the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've attached a sample project demonstrating this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2013 22:44:51 GMT</pubDate>
    <dc:creator>AaronConnolly</dc:creator>
    <dc:date>2013-01-29T22:44:51Z</dc:date>
    <item>
      <title>Hide/Show AGSLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483195#M4119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Prior to 10.1 when you wanted to toggle the visibility of&amp;nbsp; layers you had to retain a copy of a layer's UIView and use the UIView's hidden property. The release notes now say to NOT do this, but rather to use the visible property on AGSLayer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm having trouble getting this to work. I add 3 layers to a map, then toggle either their visible property or the opacity property to (YES/NO, 0.0/1.0 respectively) to show / hide them. This does not work because the layers themselves sometimes won't load tiles until you interact with the map. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is troublesome as I would expect the map to load it's tiles as soon as it's been made visible. Is that not the case? How should I go about toggling the layers visibility like this AND have the tile imagery load, without the map having moved previously?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my example the streets layer should load because its the one that's visible at first. The Topo and Imagery layers, if you switch to them with the buttons below, will not display tiles until you move the map. Sometimes this works, sometimes it doesn't. For example on the iPhone simulator the Topo layer would not work, but the Imagery did work. On iPad simulator neither Topo nor Imagery would load until you moved the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've attached a sample project demonstrating this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2013 22:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483195#M4119</guid>
      <dc:creator>AaronConnolly</dc:creator>
      <dc:date>2013-01-29T22:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Show AGSLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483196#M4120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I checked out your demo and saw the behavior you are describing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A quick fix is to very slightly shift the center of the map every time you toggle a layer. If you shift the center point by a very small multiplier, the map will update but not shift visibly. I am attaching a modified version of your demo that does such. I used a multiplier of 1.00001 and there is not visible map shift.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I find that the map renders more quickly if you just swap layers in and out of the map using addMapLayer: / removeMapLayer: . There does seem to be a cost to keeping track of empty layers on the map. This would also avoid your problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: Calling the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;-(void)refresh&lt;/SPAN&gt;&lt;SPAN&gt; method of AGSLayer is a simpler solution. I should have seen that in the API docs. If you replace the map center shifting code in my edit of your test case with &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;[layer refresh]&lt;/SPAN&gt;&lt;SPAN&gt;, you get the same results.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 16:16:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483196#M4120</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2013-01-30T16:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Show AGSLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483197#M4121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I checked out your demo and saw the behavior you are describing.&lt;BR /&gt;&lt;BR /&gt;A quick fix is to very slightly shift the center of the map every time you toggle a layer. If you shift the center point by a very small multiplier, the map will update but not shift visibly. I am attaching a modified version of your demo that does such. I used a multiplier of 1.00001 and there is not visible map shift.&lt;BR /&gt;&lt;BR /&gt;I find that the map renders more quickly if you just swap layers in and out of the map using addMapLayer: / removeMapLayer: . There does seem to be a cost to keeping track of empty layers on the map. This would also avoid your problem.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dana,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. I thought about moving the map programmatically and about adding/removing the layers dynamically. I would rather just control the visibility in this manner per the release notes and as such want to know why this doesn't work. Moving the map ever-so-slightly seems like a hack. In my case I can't do this because I fetch records from a web service each time the map's extent changes. To do this I'd get an extra call and a few more redundant CPU cycles. This should work because that's why they gave us the visibility property, right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To me it looks like any changes to the visibility property don't fire a new render even for the tile imagery in the layer. Same goes for the opacity property.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 16:31:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483197#M4121</guid>
      <dc:creator>AaronConnolly</dc:creator>
      <dc:date>2013-01-30T16:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Show AGSLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483198#M4122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Dana,&lt;BR /&gt;&lt;BR /&gt;I would rather just control the visibility in this manner per the release notes and as such want to know why this doesn't work. Moving the map ever-so-slightly seems like a hack.&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;To me it looks like any changes to the visibility property don't fire a new render even for the tile imagery in the layer. Same goes for the opacity property.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, it is definitely a hack. Did you see my edit that you can achieve the same result with the - (void)refresh method of AGSLayer?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 16:49:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483198#M4122</guid>
      <dc:creator>DanaMaher</dc:creator>
      <dc:date>2013-01-30T16:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Show AGSLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483199#M4123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Yes, it is definitely a hack. Did you see my edit that you can achieve the same result with the - (void)refresh method of AGSLayer?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ah, I didn't see your edit. I'll probably go with that until ESRI responds. Thanks for the tip.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 18:23:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483199#M4123</guid>
      <dc:creator>AaronConnolly</dc:creator>
      <dc:date>2013-01-30T18:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Show AGSLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483200#M4124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for providing the testcase. We have investigated the issue and can confirm that it is a bug. We will fix it in our next release. In the meantime, you can continue to use the workaround of calling refresh after you change the layer visibility.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 16:04:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483200#M4124</guid>
      <dc:creator>DiveshGoyal</dc:creator>
      <dc:date>2013-02-04T16:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Show AGSLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483201#M4125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Great Divsesh. Thanks for the feedback.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 17:07:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483201#M4125</guid>
      <dc:creator>AaronConnolly</dc:creator>
      <dc:date>2013-02-04T17:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Hide/Show AGSLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483202#M4126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Divesh, can you provide me with a bug number for this issue?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 18:02:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/hide-show-agslayer/m-p/483202#M4126</guid>
      <dc:creator>AaronConnolly</dc:creator>
      <dc:date>2013-02-04T18:02:50Z</dc:date>
    </item>
  </channel>
</rss>

