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
Solved! Go to Solution.
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.
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.
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?