//define a popup template var popupTemplate = new esri.dijit.PopupTemplate({ title: "{EVENT}", fieldInfos: [ {fieldName: "EFFECTIVE", visible: true, label:"Effective"}, {fieldName: "WEB", visible:true, label:"Link"} ], showAttachments:false }); //create a feature layer based on the feature collection var featureLayer = new esri.layers.FeatureLayer("http://rmgsc.cr.usgs.gov/ArcGIS/rest/services/nhss_weat/MapServer/0", { mode: esri.layers.FeatureLayer.MODE_ONDEMAND, infoTemplate: popupTemplate, outFields: ['*'] });
@Kelly can you help me please why this is not working ? Adding hyperlink in popup template for JS API 4.8
{
fieldName: "Report",
label: "Report",
Link :"href='http://data.mbmg.mtech.edu/proppant/Report.asp?SampleId=${SampleId}&reqby=M&'",
visible: true
},
Kelly Hutchins now it works in this way....I watched your Making Popups video...It helped.
var template = { // autocasts as new PopupTemplate()
title: "SNaP Record {SampleId}",
content: "<table>" + "<tr valign='top'><td style='white-space:nowrap;'>Sample Name</td><td>{SampleName}</td></tr>" +
"<tr><td style='white-space:nowrap;'>Report</td><td><a target='_newwellwin' href='http://data.mbmg.mtech.edu/proppant/Report.asp?SampleId=${SampleId}&reqby=M&'>View</a></td></tr>" +
"<tr><td style='white-space:nowrap;'>Elevation</td><td style='white-space:nowrap;'>{Elevation}</td></tr>" +
"<tr><td style='white-space:nowrap;'>Location</td><td style='white-space:nowrap;'>{Township} {Range} {Section} {QSection}</td></tr>" +
"<tr><td style='white-space:nowrap;'>Lat/Long</td><td>{Latitude}, {Longitude}</td></tr>" +
"<tr><td style='white-space:nowrap;'>Sampled?</td><td>{SampleTaken}</td></tr>" +
"<tr><td style='white-space:nowrap;'>Sample Date</td><td>{SampleDate}</td></tr>" +
"</table>"
};
Thank you for your elaborate Video demonstration.
Regards
Bulbul
var template = new esri.InfoTemplate(); template.setTitle("Advisories"); template.setContent(getWindowContent); // var template = new esri.InfoTemplate("", "Parcel ID: ${PARCELID}"); feature.setInfoTemplate(template); }
function getWindowContent(graphic){ var content = "<a href='" + graphic.attributes.WEB + "'>Click here for more info</a>"; return content; }
var popupTemplate = new esri.dijit.PopupTemplate({ title: "{Building} {Type}", fieldInfos: [ {fieldName: "Building", visible: true, label:"Building Name:"}, {fieldName: "Descrip", visible:true, label:"Info:"}, ], mediaInfos: [ { "type":"image", "value":{ "sourceURL":"{Images}", "linkURL":"{Hyperlink}" } }] }); //create a feature layer based on the feature collection var featureLayer = new esri.layers.FeatureLayer("http://webgis.uwm.edu/ArcGISUWM/rest/services/Sustain1/MapServer/0", { mode: esri.layers.FeatureLayer.MODE_SNAPSHOT, infoTemplate: popupTemplate, outFields: ['Type','Building','Descrip','Images','Hyperlink'] }); featureLayer.setDefinitionExpression("Type != ''"); dojo.connect(featureLayer,"onClick",function(evt){ map.infoWindow.setFeatures([evt.graphic]); }); map.addLayer(featureLayer);