Select to view content in your preferred language

Dynamic Mapservice popups fail in webmap when default visibility is off

3144
1
Jump to solution
10-23-2014 09:21 AM
DavidStajan
Occasional Contributor

I was wondering if anyone has come across this problem.  I have a webmap that contains a dynamic map service.  All the layers in the service have popups enabled in the webmap.  Some layers have their visibility turned on by default in the webmap and others are turned off.  In the AGOL map viewer everything seems to work fine, however if I publish the webmap as an application or use it in a simple JSAPI application the popups only work for layers that have their visibility turned on by default in the webmap.  It seems to me theres an api bug here, but I'm struggling to find a workaround.  Any help would be great

 

webmap

http://www.arcgis.com/home/item.html?id=488207cb49e045d5910a6496c1a0b26c

 

this WAB displays the symptoms, but note this is not an isolated WAB issue as I can replicate this in any code I use the web map in

 

WAB application

ArcGIS Web Application

 

Thanks,

David

0 Kudos
1 Solution

Accepted Solutions
DavidStajan
Occasional Contributor

Just an update.  It wasn’t so much a bug but a setting that should probably be set to true by default.

When adding your webmap to your application there is an option (added in jsapi 3.10) called usePopupManager.  If set to true it will resolve the issue, the default value of this option is false. see the api documentation for more detail https://developers.arcgis.com/javascript/jsapi/esri.arcgis.utils-amd.html

var createMapOptions = {
mapOptions: {
slider: true
},
usePopupManager: true, // since version 3.10
bingMapsKey: bingMapsKey,
geometryServiceURL: "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"

};
var webMapItemID = "c41d5f3b4e304806a047702fbfc2759e";
deferred = arcgisUtils.createMap(webMapItemID, "ui-map", createMapOptions);

I've also advised the WAB beta team to consider updating this in WAB

View solution in original post

0 Kudos
1 Reply
DavidStajan
Occasional Contributor

Just an update.  It wasn’t so much a bug but a setting that should probably be set to true by default.

When adding your webmap to your application there is an option (added in jsapi 3.10) called usePopupManager.  If set to true it will resolve the issue, the default value of this option is false. see the api documentation for more detail https://developers.arcgis.com/javascript/jsapi/esri.arcgis.utils-amd.html

var createMapOptions = {
mapOptions: {
slider: true
},
usePopupManager: true, // since version 3.10
bingMapsKey: bingMapsKey,
geometryServiceURL: "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"

};
var webMapItemID = "c41d5f3b4e304806a047702fbfc2759e";
deferred = arcgisUtils.createMap(webMapItemID, "ui-map", createMapOptions);

I've also advised the WAB beta team to consider updating this in WAB

0 Kudos