// Carbon storage of trees in Warren Wilson College. featureLayer = new FeatureLayer({ url: 'http://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0', outFields: ['*'], // add a custom action popupTemplate: { title: '{Cmn_Name}', content: '{*}', actions: [ { id: 'tree-photos', className: 'esri-icon-media', title: 'Tree Photos' } ], overwriteActions: false } }); view.popup.on('action-click', function (event) { var actionId = event.action.id; var feature = popup.selectedFeature; var attributes = feature.attributes; // Search on Flickr with the name of the tree if (actionId === 'tree-photos') { var search = 'https://www.flickr.com/search/?text=' + attributes.Cmn_Name + ' tree'; window.open(search); } });
4.0
New Popup - custom actions