I'm publishing services to ArcGIS server and I want to test them out in a simple HTML web map. I would like to create a pop-up window to test if the attributes are coming through. Since I will be doing this with many feature services I don't want to make a static info template. Here is the code I am using:
var infoWindow = new InfoWindowLite(null, domConstruct.create("div", null, null, map.root));
infoWindow.startup();
map.setInfoWindow(infoWindow);
map.infoWindow.resize(200, 75);
//adds information about Alameda County
var template = new InfoTemplate();
template.setTitle("<b>${STATE_NAME} - ${STATE_ABBR}</b>");
template.setContent("${STATE_NAME} is in the ${SUB_REGION} sub region.");
//adds the border around each of the states
var featureLayer = new FeatureLayer("https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3", {
mode: FeatureLayer.MODE_ONDEMAND,
infoTemplate:template,
outFields: ["STATE_NAME" , "SUB_REGION", "STATE_ABBR"]
});
map.addLayer(featureLayer);
Where it says "template.setTitle" and "template.setContent" as well as "outFields" is there a way to use a generic index like the first three fields for each feature class?
"*"
is used to return all fields. TryoutFields: ["*"]