<?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 Create Hyperlink In A Popup That Turns On A Different Feature Layer in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/create-hyperlink-in-a-popup-that-turns-on-a/m-p/1510923#M60533</link>
    <description>&lt;P&gt;So I am writing (trying) Arcade code for ArcGIS Online Web Map that will create a hyperlink in a pop-up of one feature layer, which when clicked, will turn on another feature layer in the same map.&lt;/P&gt;&lt;P&gt;I have two layers:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Layer A (the layer with the pop-up)&lt;/LI&gt;&lt;LI&gt;Layer B (the layer to be turned on)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I'm trying to use ArcGIS Online's URL scheme for layer visibility through the URL parameters. Layer A and Layer B each have IDs from their AGOL web pages I have copied.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; orgUrl = &lt;SPAN class=""&gt;"https://www.arcgis.com"&lt;/SPAN&gt;;

&lt;SPAN class=""&gt;// Define the Web Map ID&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; webMapId = &lt;SPAN class=""&gt;"0b0c9d09e20a4c1fb6707a51c5e2bd51"&lt;/SPAN&gt;;

&lt;SPAN class=""&gt;// Define the Layer B ID&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; layerBId = &lt;SPAN class=""&gt;"0b0c9d09e20a4c1fb6707a51c5e2bd51"&lt;/SPAN&gt;;

&lt;SPAN class=""&gt;// Construct the URL with parameters to turn on Layer B&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; layerBUrl = orgUrl + &lt;SPAN class=""&gt;"/home/webmap/viewer.html?webmap="&lt;/SPAN&gt; + webMapId + &lt;SPAN class=""&gt;"&amp;amp;layers="&lt;/SPAN&gt; + layerBId;

&lt;SPAN class=""&gt;// Define the hyperlink text&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; hyperlinkText = &lt;SPAN class=""&gt;"Turn on Layer B"&lt;/SPAN&gt;;

&lt;SPAN class=""&gt;// Return the HTML code for the hyperlink&lt;/SPAN&gt;
&lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;"&amp;lt;a href='"&lt;/SPAN&gt; + layerBUrl + &lt;SPAN class=""&gt;"' target='_blank'&amp;gt;"&lt;/SPAN&gt; + hyperlinkText + &lt;SPAN class=""&gt;"&amp;lt;/a&amp;gt;"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;P&gt;What I get is a hyperlink that opens a new web map. I'm just trying to create a hyperlink in a feature layer's pop-up that turns on a different feature layer in the same map.&lt;/P&gt;&lt;P&gt;Any assistance would be greatly appreciated. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 23:16:27 GMT</pubDate>
    <dc:creator>EggandNog</dc:creator>
    <dc:date>2024-07-26T23:16:27Z</dc:date>
    <item>
      <title>Create Hyperlink In A Popup That Turns On A Different Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/create-hyperlink-in-a-popup-that-turns-on-a/m-p/1510923#M60533</link>
      <description>&lt;P&gt;So I am writing (trying) Arcade code for ArcGIS Online Web Map that will create a hyperlink in a pop-up of one feature layer, which when clicked, will turn on another feature layer in the same map.&lt;/P&gt;&lt;P&gt;I have two layers:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Layer A (the layer with the pop-up)&lt;/LI&gt;&lt;LI&gt;Layer B (the layer to be turned on)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I'm trying to use ArcGIS Online's URL scheme for layer visibility through the URL parameters. Layer A and Layer B each have IDs from their AGOL web pages I have copied.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;var&lt;/SPAN&gt; orgUrl = &lt;SPAN class=""&gt;"https://www.arcgis.com"&lt;/SPAN&gt;;

&lt;SPAN class=""&gt;// Define the Web Map ID&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; webMapId = &lt;SPAN class=""&gt;"0b0c9d09e20a4c1fb6707a51c5e2bd51"&lt;/SPAN&gt;;

&lt;SPAN class=""&gt;// Define the Layer B ID&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; layerBId = &lt;SPAN class=""&gt;"0b0c9d09e20a4c1fb6707a51c5e2bd51"&lt;/SPAN&gt;;

&lt;SPAN class=""&gt;// Construct the URL with parameters to turn on Layer B&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; layerBUrl = orgUrl + &lt;SPAN class=""&gt;"/home/webmap/viewer.html?webmap="&lt;/SPAN&gt; + webMapId + &lt;SPAN class=""&gt;"&amp;amp;layers="&lt;/SPAN&gt; + layerBId;

&lt;SPAN class=""&gt;// Define the hyperlink text&lt;/SPAN&gt;
&lt;SPAN class=""&gt;var&lt;/SPAN&gt; hyperlinkText = &lt;SPAN class=""&gt;"Turn on Layer B"&lt;/SPAN&gt;;

&lt;SPAN class=""&gt;// Return the HTML code for the hyperlink&lt;/SPAN&gt;
&lt;SPAN class=""&gt;return&lt;/SPAN&gt; &lt;SPAN class=""&gt;"&amp;lt;a href='"&lt;/SPAN&gt; + layerBUrl + &lt;SPAN class=""&gt;"' target='_blank'&amp;gt;"&lt;/SPAN&gt; + hyperlinkText + &lt;SPAN class=""&gt;"&amp;lt;/a&amp;gt;"&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;P&gt;What I get is a hyperlink that opens a new web map. I'm just trying to create a hyperlink in a feature layer's pop-up that turns on a different feature layer in the same map.&lt;/P&gt;&lt;P&gt;Any assistance would be greatly appreciated. Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 23:16:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/create-hyperlink-in-a-popup-that-turns-on-a/m-p/1510923#M60533</guid>
      <dc:creator>EggandNog</dc:creator>
      <dc:date>2024-07-26T23:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create Hyperlink In A Popup That Turns On A Different Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/create-hyperlink-in-a-popup-that-turns-on-a/m-p/1511093#M60536</link>
      <description>&lt;P&gt;That's how it's meant to work. Custom URL links are designed for a separate web page, not the current one.&lt;/P&gt;&lt;P&gt;There may be a world where you could force it to open the new page in the current one, instead of a new tab/window, but the current session for the user might be lost.&lt;/P&gt;&lt;P&gt;Within map viewer there aren't tools for dynamic layer on/off interaction.&lt;/P&gt;&lt;P&gt;Generally, you shouldn't share web maps with users. Better to wrap it in an app. In this case you could use Dashboards or Experience Builder. They'll give you more options for dynamic layer interaction.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2024 23:24:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/create-hyperlink-in-a-popup-that-turns-on-a/m-p/1511093#M60536</guid>
      <dc:creator>ChristopherCounsell</dc:creator>
      <dc:date>2024-07-27T23:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create Hyperlink In A Popup That Turns On A Different Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/create-hyperlink-in-a-popup-that-turns-on-a/m-p/1511842#M60559</link>
      <description>&lt;P&gt;Thank you. I guess it's not possible right now in AGOL Map Viewer to toggle layers in a map on and off within a pop-up.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 19:27:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/create-hyperlink-in-a-popup-that-turns-on-a/m-p/1511842#M60559</guid>
      <dc:creator>MHO_Harbors</dc:creator>
      <dc:date>2024-07-29T19:27:40Z</dc:date>
    </item>
  </channel>
</rss>

