AnsweredAssumed Answered

ArcGIS Online map popup fails to load in JSAPI v3.11

Question asked by kdoman on Dec 1, 2014
Latest reply on Dec 2, 2014 by kdoman

I have a map I've created on ArcGIS Online, mashing up several map services. I've configured popups for several layers and sublayers. On the webmap, I have a map service called GIS Layers, which has a layer called GPS Monuments. GIS Layers is turned on, but GPS Monuments is turned off by default. I have a popup configured for GPS Monuments, and when I turn on that layer in ArcGIS Online, the popup will show when the layer is visible. However, when I load the webmap through an application created with version 3.11 of the ArcGIS API for JavaScript, and I toggle the visibility of the GPS Monuments layer, I don't get a popup for that layer. Stepping through the code, I found that if the GPS Monuments layer is made visible, the feature layer that controls the popup is loaded by the arcgisUtils.createMap method. However, if the GPS Monuments layer is turned off on the webmap, no feature layer is loaded.


I know I could make visible all the layers that have popups configured for them, but it makes the webmap look messy. Any suggestions on how to handle this without hard-coding manual turn on/off of layers in the external JSAPI application?