<?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: Control layer transparency by scale using Arcade in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1296749#M52664</link>
    <description>&lt;P&gt;Hi, Erica!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just trying to do the same thing, with more added hurdle - I needed to filter only certain features within a layer based on view scale.&amp;nbsp; I ended up working out a solution that might be easier than editing the JSON.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoshuaReyling_0-1686153509213.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/72553i81A2C72FC2108B7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoshuaReyling_0-1686153509213.png" alt="JoshuaReyling_0-1686153509213.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In an expression, I mapped binary threshold values in variables with an IIf(), and set numeric values based on those thresholds.&amp;nbsp; Then I simply multiplied those variables together.&amp;nbsp; In my case, any feature with a program type of 'adaptive management' has a value of 0, and&amp;nbsp;&lt;EM&gt;all&lt;/EM&gt; features have a value of 100 when zoomed in beyond 1:50,000.&amp;nbsp; This means that when I zoom in, my adaptive management features are still 0 (0*100) and all my other features are at 10,000 (100*100).&amp;nbsp; Then I simply set my transparency slider accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think your situation might be easier, because you only need the one variable.&amp;nbsp; Hope this helps and isn't too confusing of a walkthrough!&lt;/P&gt;</description>
    <pubDate>Wed, 07 Jun 2023 16:03:28 GMT</pubDate>
    <dc:creator>JoshuaReyling</dc:creator>
    <dc:date>2023-06-07T16:03:28Z</dc:date>
    <item>
      <title>Control layer transparency by scale using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1280369#M51553</link>
      <description>&lt;P&gt;Hi -&lt;/P&gt;&lt;P&gt;I've seen many posts about scale-based symbology using Arcade (e.g. change the point size). I was wondering if it was possible to control a layer's transparency via Arcade so that a layer becomes more transparent as a user zooms in on a map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, I have two copies of the same layer in my map - one is opaque and the other is semi-transparent. As the user zooms in on the map, the opaque version disappears and is 'replaced' by the semi-transparent version.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, I'd like to use Arcade to change the transparency of a single layer as the user zooms in. This would help immensely as I am using my map in Experience Builder and the filter widget can only be applied to one layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice would be appreciated,&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 19:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1280369#M51553</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2023-04-19T19:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Control layer transparency by scale using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1289107#M52186</link>
      <description>&lt;P&gt;I wanted to post my solution to this in case it is useful to others. I reached out to our local Esri contacts and was informed that while this is possible using Arcade, there is a bug in the map viewer which prevents it from working properly. Below is a workaround which I tested and was successfully able to implement in my map:&lt;/P&gt;&lt;DIV&gt;&lt;OL&gt;&lt;LI&gt;Open your web map and select the layer &amp;gt; Styles.&lt;/LI&gt;&lt;LI&gt;Set symbology and then toggle on "Transparency by attribute" at the bottom of the Styles dialog.&lt;/LI&gt;&lt;LI&gt;Click the &amp;lt;/&amp;gt; and add a new expression.&lt;/LI&gt;&lt;LI&gt;Leave expression title as "New expression".&lt;/LI&gt;&lt;LI&gt;In body, type &lt;STRONG&gt;$view.scale&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Click Save.&lt;/LI&gt;&lt;LI&gt;Select a numeric field for transparency normalization (I selected "Shape_Length").&lt;/LI&gt;&lt;LI&gt;Open AGO Assistant and view the JSON of your web map.&lt;/LI&gt;&lt;LI&gt;In the JSON code, locate the code that looks like this:&lt;/LI&gt;&lt;/OL&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erica_poisson_0-1684155397994.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70674i3C0DF3B84E978E18/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erica_poisson_0-1684155397994.jpeg" alt="erica_poisson_0-1684155397994.jpeg" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;10. Replace it with something like this. Note that where I have "36111.909643" should be the scale at which you want the transparency to change.&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erica_poisson_1-1684155397995.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/70675i52D00D2C2AD0B81E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erica_poisson_1-1684155397995.jpeg" alt="erica_poisson_1-1684155397995.jpeg" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tested this and it worked. I would recommend testing in a copy of your web map and copying/pasting default JSON into Notepad just in case.&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 15 May 2023 12:58:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1289107#M52186</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2023-05-15T12:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Control layer transparency by scale using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1296749#M52664</link>
      <description>&lt;P&gt;Hi, Erica!&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just trying to do the same thing, with more added hurdle - I needed to filter only certain features within a layer based on view scale.&amp;nbsp; I ended up working out a solution that might be easier than editing the JSON.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoshuaReyling_0-1686153509213.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/72553i81A2C72FC2108B7F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoshuaReyling_0-1686153509213.png" alt="JoshuaReyling_0-1686153509213.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In an expression, I mapped binary threshold values in variables with an IIf(), and set numeric values based on those thresholds.&amp;nbsp; Then I simply multiplied those variables together.&amp;nbsp; In my case, any feature with a program type of 'adaptive management' has a value of 0, and&amp;nbsp;&lt;EM&gt;all&lt;/EM&gt; features have a value of 100 when zoomed in beyond 1:50,000.&amp;nbsp; This means that when I zoom in, my adaptive management features are still 0 (0*100) and all my other features are at 10,000 (100*100).&amp;nbsp; Then I simply set my transparency slider accordingly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think your situation might be easier, because you only need the one variable.&amp;nbsp; Hope this helps and isn't too confusing of a walkthrough!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2023 16:03:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1296749#M52664</guid>
      <dc:creator>JoshuaReyling</dc:creator>
      <dc:date>2023-06-07T16:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Control layer transparency by scale using Arcade</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1297539#M52695</link>
      <description>&lt;P&gt;Hi Josh,&lt;/P&gt;&lt;P&gt;Thanks for sharing that example - I'll give it a try. I was actually going to try it out this morning, but when I open the Map Viewer (in Chrome or Firefox) and select the layer, there is no longer a "transparency by attribute" option under the symbology settings. I'm mystified.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="erica_poisson_0-1686313525479.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/72764i0E76797B8F900C41/image-size/medium?v=v2&amp;amp;px=400" role="button" title="erica_poisson_0-1686313525479.png" alt="erica_poisson_0-1686313525479.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 12:26:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/control-layer-transparency-by-scale-using-arcade/m-p/1297539#M52695</guid>
      <dc:creator>erica_poisson</dc:creator>
      <dc:date>2023-06-09T12:26:31Z</dc:date>
    </item>
  </channel>
</rss>

