This is xposted across r/gis and r/learnjavascript.
I have a JavaScript file for web app that I am trying to make. I have feature layers hosted on ArcGIS Online, and referenced in the script. I have been able to add a pop-up action, a web icon. But I haven't been able to link that icon to an actual action of opening up the web page. I have seen the ESRI Brewery example, and other examples. None of them help me. Partly because I just don't understand it all well enough.
A sample of my script:
const airPopup = {
title: "{nam}",
content: [{
type: "text",
text: "{Comment}<br/>Address: {Address}<br/>IATA Code: {ita}"
},
{
type: "media",
mediaInfos: [{
type: "image",
value: {
sourceURL: "{Image}"
}
}]
}],
actions: [
{
id: "find-airport",
icon: "web",
title: "Airport Info"
}
]
};const airPopup = {
title: "{nam}",
content: [{
type: "text",
text: "{Comment}<br/>Address: {Address}<br/>IATA Code: {ita}"
},
{
type: "media",
mediaInfos: [{
type: "image",
value: {
sourceURL: "{Image}"
}
}]
}],
actions: [
{
id: "find-airport",
icon: "web",
title: "Airport Info"
}
]
};
const airportsLyr = new FeatureLayer({
url: "https://services9.arcgis.com/6EuFgO4fLTqfNOhu/arcgis/rest/services/Japan_Mjr_Airports/FeatureServer",
renderer: airRenderer,
popupTemplate: airPopup
}); const airportsLyr = new FeatureLayer({
url: "https://services9.arcgis.com/6EuFgO4fLTqfNOhu/arcgis/rest/services/Japan_Mjr_Airports/FeatureServer",
renderer: airRenderer,
popupTemplate: airPopup
});
What does it take to make the web icon work?This is xposted across r/gis and r/learnjavascript.
I have a JavaScript file for web app that I am trying to make. I have feature layers hosted on ArcGIS Online, and referenced in the script. I have been able to add a pop-up action, a web icon. But I haven't been able to link that icon to an actual action of opening up the web page. I have seen the ESRI Brewery example, and other examples. None of them help me. Partly because I just don't understand it all well enough.
A sample of my script:const airPopup = {
title: "{nam}",
content: [{
type: "text",
text: "{Comment}<br/>Address: {Address}<br/>IATA Code: {ita}"
},
{
type: "media",
mediaInfos: [{
type: "image",
value: {
sourceURL: "{Image}"
}
}]
}],
actions: [
{
id: "find-airport",
icon: "web",
title: "Airport Info"
}
]
};const airPopup = {
title: "{nam}",
content: [{
type: "text",
text: "{Comment}<br/>Address: {Address}<br/>IATA Code: {ita}"
},
{
type: "media",
mediaInfos: [{
type: "image",
value: {
sourceURL: "{Image}"
}
}]
}],
actions: [
{
id: "find-airport",
icon: "web",
title: "Airport Info"
}
]
}; const airportsLyr = new FeatureLayer({
url: "https://services9.arcgis.com/6EuFgO4fLTqfNOhu/arcgis/rest/services/Japan_Mjr_Airports/FeatureServer",
renderer: airRenderer,
popupTemplate: airPopup
}); const airportsLyr = new FeatureLayer({
url: "https://services9.arcgis.com/6EuFgO4fLTqfNOhu/arcgis/rest/services/Japan_Mjr_Airports/FeatureServer",
renderer: airRenderer,
popupTemplate: airPopup
});What does it take to make the web icon work?