AnsweredAssumed Answered

Dynamic Map Service Popup not working after updating url

Question asked by ryandeng on Aug 16, 2018
Latest reply on Aug 16, 2018 by ryandeng


I have a dynamic map layer but for some reason once the widget update the variable "year_opSelect" which changes the url to a different map service, the popup stopped working. does anyone know why and how to fix it? Thanks so much!!


takeoutLayerFromMap: function (layer) {
   var layerToRemove =;;


if ("hDynamicLayer") !== undefined) {


var hYearUrlD = "" + year_opSelect + "/MapServer"


var hDynTemplate= {};
      hDynTemplate[0] = { infoTemplate: templateX };


var hDynamicLayer = new ArcGISDynamicMapServiceLayer(hYearUrlD, {id: "hDynamicLayer", minScale: hDetailMinVal,       imageformat: "png32", name: "h Application Details"});


var hLayerDefinitions = [];
      hLayerDefinitions[dSelect] = hYear_ID;


var hlayerDrawingOptions = [];
var layerDrawingOption = new LayerDrawingOptions();
      layerDrawingOption.renderer = hRenderer;
      hlayerDrawingOptions[dSelect] = layerDrawingOption;