<?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: Popup - URL link in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1202215#M78263</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/91142"&gt;@ITApplications&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;There are a couple of ways you could do this and I put together this sample to show how to add to your current custom content and display a hyperlink that contains information from the currently clicked feature:&amp;nbsp;&lt;A href="https://codepen.io/laurenb14/pen/VwXGbBP?editors=1000" target="_blank"&gt;https://codepen.io/laurenb14/pen/VwXGbBP?editors=1000&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2022 21:59:19 GMT</pubDate>
    <dc:creator>LaurenBoyd</dc:creator>
    <dc:date>2022-08-11T21:59:19Z</dc:date>
    <item>
      <title>Popup - URL link</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1201794#M78258</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;This may be an extremely simple answer but I can't work out how to get it to work (I'm very new to this so apologies if this is something very simple) .&lt;BR /&gt;&lt;BR /&gt;I have a Web Map in ArcGIS Online and in there I am able to add custom HTML into the popup that provides a URL link to a 3rd party system (and it also passes data via URL params). That works great as a customer clicks on the link in the popup and it passes the feature data over.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITApplications_0-1660205513964.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48399i4805AF33996556E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITApplications_0-1660205513964.png" alt="ITApplications_0-1660205513964.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have a ArcGIS JS map that I've developed and I'd like to put the URL link into that popup also but I can't work out how to do it. My popup in JS is customised as well so it can pick up X/Y coordinates of where a customer puts their marker (it's to report potholes on a street).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITApplications_2-1660206293366.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48401i55BEADE7828E58DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITApplications_2-1660206293366.png" alt="ITApplications_2-1660206293366.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;How do I add the URL link (and params) into my existing code?&lt;BR /&gt;&lt;BR /&gt;// Define pop-up for Streets layer&lt;BR /&gt;const popupStreets = {&lt;BR /&gt;"title": "Click to report an issue:",&lt;BR /&gt;"content": [{&lt;BR /&gt;type: "text",&lt;BR /&gt;text: "&amp;lt;b&amp;gt;Street:&amp;lt;/b&amp;gt; {SITE_NAME}&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Town:&amp;lt;/b&amp;gt; {TOWN_NAME}&amp;lt;br&amp;gt;"&lt;BR /&gt;}, {&lt;BR /&gt;type: "custom",&lt;BR /&gt;creator: (graphic) =&amp;gt; {&lt;BR /&gt;const location = view.popup.location;&lt;BR /&gt;return `X: ${location.x.toFixed (0) }&amp;lt;br&amp;gt;Y: ${location.y.toFixed (0)}`; //gets x/y coordinates&lt;BR /&gt;}&lt;BR /&gt;}]&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITApplications_3-1660206433893.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48402i0F7137D38D63AF8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITApplications_3-1660206433893.png" alt="ITApplications_3-1660206433893.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is code from the Online popup and I'm guessing I only need the part boxed in red.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ITApplications_1-1660206197390.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48400iAE0E6A1B58D24D36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ITApplications_1-1660206197390.png" alt="ITApplications_1-1660206197390.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How do I get that to work in my JS code please? Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 08:28:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1201794#M78258</guid>
      <dc:creator>ITApplications</dc:creator>
      <dc:date>2022-08-11T08:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Popup - URL link</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1202034#M78262</link>
      <description>&lt;P&gt;I think this may be what you're looking for (may need to double-check my typing for that URL though):&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const popupStreets = {
	"title": "Click to report an issue:",
	"content": [{
		type: "text",
		text: "&amp;lt;b&amp;gt;Street:&amp;lt;/b&amp;gt; {SITE_NAME}&amp;lt;br&amp;gt;&amp;lt;b&amp;gt;Town:&amp;lt;/b&amp;gt; {TOWN_NAME}&amp;lt;br&amp;gt;" + 
			"&amp;lt;a href=\"https://east-riding-self.test.achieveservice.com/service/Map__ArcGIS_Online_Trees" +
			"?street={SITE_NAME}&amp;amp;town={TOWN_NAME}&amp;amp;USRN={SITE_CODE}&amp;amp;assetID={CENTRAL_ASSET_ID}" +
			"&amp;amp;Easting={FEAT_CENT_EAST}&amp;amp;Northing={FEAT_CENT_NORTH}\" rel=\"nofollow ugc\"&amp;gt;" +
			"&amp;lt;font size=\"6\"&amp;gt;Click Here&amp;lt;/font&amp;gt;&amp;lt;/a&amp;gt;"
	}, {
		type: "custom",
		creator: (graphic) =&amp;gt; {
			const location = view.popup.location;
			return `X: ${location.x.toFixed (0) }&amp;lt;br&amp;gt;Y: ${location.y.toFixed (0)}`; //gets x/y coordinates
		}
	}]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The most likely issue you were having is needing to escape the quotation marks surrounding the html element attributes, since this text is already inside of a JavaScript literal.&amp;nbsp; When inside a JavaScript string, if you want a quotation mark in the string, you have to add a backslash before it, like: \"&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 17:12:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1202034#M78262</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-08-11T17:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Popup - URL link</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1202215#M78263</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/91142"&gt;@ITApplications&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;There are a couple of ways you could do this and I put together this sample to show how to add to your current custom content and display a hyperlink that contains information from the currently clicked feature:&amp;nbsp;&lt;A href="https://codepen.io/laurenb14/pen/VwXGbBP?editors=1000" target="_blank"&gt;https://codepen.io/laurenb14/pen/VwXGbBP?editors=1000&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2022 21:59:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1202215#M78263</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2022-08-11T21:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Popup - URL link</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1204419#M78361</link>
      <description>&lt;P&gt;Thank you so much both you you. Both are great solutions. After trying them both I've ultimately gone with Lauren's suggestion as it allowed me to pass the X/Y of where a user drops a pin (to report a pothole) through the URL into a form on our CRM system. It works great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks both again&lt;/P&gt;&lt;P&gt;Ricky&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 07:51:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-url-link/m-p/1204419#M78361</guid>
      <dc:creator>ITApplications</dc:creator>
      <dc:date>2022-08-19T07:51:58Z</dc:date>
    </item>
  </channel>
</rss>

