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

1539
2
Jump to solution
12-01-2014 03:15 PM
KenDoman
Occasional Contributor II

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?

Thanks,

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

Are you able to update the application that uses your web map with createMap? If so try setting the createMap usePopupManager constructor option to true and see if it resolves the issue.

arcgisUtils.createMap(itemInfo, "mapDiv", {
                mapOptions: {},
                usePopupManager: true

});

View solution in original post

2 Replies
KellyHutchins
Esri Frequent Contributor

Are you able to update the application that uses your web map with createMap? If so try setting the createMap usePopupManager constructor option to true and see if it resolves the issue.

arcgisUtils.createMap(itemInfo, "mapDiv", {
                mapOptions: {},
                usePopupManager: true

});
KenDoman
Occasional Contributor II

Thanks, that did the trick.

0 Kudos