How To Add hyperlinks to the footer of a pop-up window using ArcGIS API for JavaScript 4.18 ?

1585
2
Jump to solution
03-16-2021 08:57 AM
Med-Karim-Rouissi
New Contributor III

Hey everyone,
I'm trying to use this code with Arcgis JS 4.18, but according to ESRI support this code works only for 3.x versions.

https://support.esri.com/en/technical-article/000014528

Code:
var link = domConstruct.create("a",{ 
 "class": "action", 
 "id": "statsLink", 
 "innerHTML": "More Information", //the text representing the link
 "href": "javascript: void(0);" 
 }, query(".actionList",map.infoWindow.domNode)[0]); 
 on(link, "click", [function name]); 

function cp(evt){ 
 window.open("http://url"); //set the url to be displayed
 }


as seen in these two examples:

https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=exp_history

https://developers.ardomNodejavascript/3/sandbox/sandbox.html?sample=gp_popuplink

 

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You can add an action to the popup that will appear in the footer. Your action could open a new browser window with your link.

See this sample, although it's currently broken. You have to make one change in the sandbox version. Change line 47 to this

url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/OpenBeerDB/FeatureServer/0",

and click on a brewery with a website (not all of them have one). The popup contains a new icon that, when clicked, opens the link.

brewery.png

View solution in original post

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor

You can add an action to the popup that will appear in the footer. Your action could open a new browser window with your link.

See this sample, although it's currently broken. You have to make one change in the sandbox version. Change line 47 to this

url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/OpenBeerDB/FeatureServer/0",

and click on a brewery with a website (not all of them have one). The popup contains a new icon that, when clicked, opens the link.

brewery.png

0 Kudos
Med-Karim-Rouissi
New Contributor III

I understood , i plan to add a link in the popup to a related feature-layer that I have already requested, is it possible to do so by customizing this example?

0 Kudos