Select to view content in your preferred language

Using the &marker URL parameter with hyperlinks

552
2
Jump to solution
10-17-2024 02:19 AM
MappyIan
Frequent Contributor

Following on from this blog post by @BernSzukalski we've created an Instant App using the Basic template to test the passing in of URL parameters to identify specific location on the map.  This works really well and allows us to identify the location of a specific feature using a pin icon and show a basic popup when the pin is clicked:

https://edinageo.maps.arcgis.com/apps/instant/basic/index.html?appid=2030541249d64bc7b53fb760cb989b0...

What we'd like to do is embed a hyperlink in the popup text, but it seems that the hyperlink is stripped out somewhere along the line.  For example, we'd like to use the following text in the popup of the pin:

Information about the <a href="https://en.wikipedia.org/wiki/Ray_Dolby">Ray Dolby</a> Building.

When correctly encoded, the full URL is as follows:

https://edinageo.maps.arcgis.com/apps/instant/basic/index.html?appid=2030541249d64bc7b53fb760cb989b0...

But if you click on the above URL, you'll see that the words 'Ray Dolby' are not a hyperlink:

MappyIan_1-1729156642888.png

Does anyone know if any way to pass in a hyperlink to a popup created using the &marker URL parameter in Instant Apps?  If it's not currently possible, are there any plans for it in the future?

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

We strip the HTML from the url parameter content to avoid Cross Site Scripting security issues. In a future release we can look at allowing some HTML content to be provided via url parameters. 

One approach you could use now would be to use an app like Media that supports defining a custom URL parameter that allows you to open the app pointing to a specific feature with its popup open. Here is an example of the Media app configured to have a custom url parameter called name that points to the Buildings layer and specifies the building name as the parameter.  In this example we add the custom marker using your existing url parameter but display the popup from the feature using the custom url parameter. 

 

https://www.arcgis.com/apps/instant/media/index.html?appid=7e89ceadd32c416d968c6315fa884ed3&name=Ray...

 

 

View solution in original post

0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor

We strip the HTML from the url parameter content to avoid Cross Site Scripting security issues. In a future release we can look at allowing some HTML content to be provided via url parameters. 

One approach you could use now would be to use an app like Media that supports defining a custom URL parameter that allows you to open the app pointing to a specific feature with its popup open. Here is an example of the Media app configured to have a custom url parameter called name that points to the Buildings layer and specifies the building name as the parameter.  In this example we add the custom marker using your existing url parameter but display the popup from the feature using the custom url parameter. 

 

https://www.arcgis.com/apps/instant/media/index.html?appid=7e89ceadd32c416d968c6315fa884ed3&name=Ray...

 

 

0 Kudos
MappyIan
Frequent Contributor

Hey @KellyHutchins, many thanks for the response.  And thanks for suggestion of using the Media app template, that's something I'll investigate.

0 Kudos