Hello. Starting to look at using the 4.x JavaScript API. I am looking to assign a popupTemplate to each layer within a map service. Can I do this without having to add each individual feature layer to the map? I have done this in the 3.x API. Here is my sample below and this works well:
electricGPS = new ArcGISDynamicMapServiceLayer("https://arcgis03/arcgis/rest/services/Electric/ElectricGPS/MapServer", {
id: "Electric GPS",
visible: true,
outFields: ["*"]
});
// Set Info Template for Electric GPS
electricGPS.setInfoTemplates({
0: {infoTemplate: genericPointsInfoTemplate},
1: {infoTemplate: poleAttachmentsInfoTemplate},
2: {infoTemplate: poleInfoTemplate},
3: {infoTemplate: pedestalInfoTemplate},
4: {infoTemplate: propertyInfoTemplate},
5: {infoTemplate: streetlightInfoTemplate},
6: {infoTemplate: switchingFacilityInfoTemplate},
7: {infoTemplate: transformerFacilityInfoTemplate},
8: {infoTemplate: servicePointsInfoTemplate},
9: {infoTemplate: anchorGuyInfoTemplate},
10: {infoTemplate: PrimaryMeterInfoTemplate},
11: {infoTemplate: genericLineInfoTemplate},
12: {infoTemplate: UGPrimaryInfoTemplate},
13: {infoTemplate: UGSecondaryInfoTemplate},
14: {infoTemplate: AreaGenericInfoTemplate}
});
How would this work using the 4.x API? Trying to find clues in the API reference. Thank you for any information you can provide.