Suppress "layer cannot be added to the map" message

858
2
Jump to solution
05-22-2018 01:12 PM
BlakeTerhune
MVP Regular Contributor

The web map I'm using for my app has several layers hosted on our ArcGIS Server. One of the layers is a secured service while the rest are not. We deployed the app to everyone in our organization but only certain groups have access to the secured layer. Previously, this worked great because Web AppBuilder just "silently" threw an error in the console claiming it couldn't find the secured layer but now it looks like there's a new "feature" that displays a message claiming the layer cannot be added to the map. Is there any way to suppress or hide this message?

0 Kudos
1 Solution

Accepted Solutions
JoseBanuelos
Esri Contributor

Hello Blake,

The "layer cannot be added to the map" message gets generated in the '_showUnreachableLayersTitleMessage' function, in the MapManager.js file.

(WebAppBuilderForArcGIS > server > apps > (appNumber) > jimu.js > MapManager.js)

If you comment out the new Message( { ... } ) code in the function, there will no longer be a message. You can print the message to the console instead if you like. Hope this helps!

Regards,

Jose Banuelos

View solution in original post

2 Replies
JoseBanuelos
Esri Contributor

Hello Blake,

The "layer cannot be added to the map" message gets generated in the '_showUnreachableLayersTitleMessage' function, in the MapManager.js file.

(WebAppBuilderForArcGIS > server > apps > (appNumber) > jimu.js > MapManager.js)

If you comment out the new Message( { ... } ) code in the function, there will no longer be a message. You can print the message to the console instead if you like. Hope this helps!

Regards,

Jose Banuelos

BlakeTerhune
MVP Regular Contributor

I commented out the new Message({...}); lines in _showUnreachableLayersTitleMessage: function() and that seemed to do the trick. Thanks!