I've created a web map and web application using Developer WAB, when I swapped layers using the Admin Tools (find/replace layers using url), the web app broke (See image below for web app and console error). However the web map still works when launched independently.
The only workaround I have found is to make a copy of the map and switch the web map id in the application. However this is not ideal as we would have to do this everytime we need to swap layers.
Has anyone experienced anything similar and found a fix?
The likely issue is that the wab app is maintaining one or more references to a particular layer that was in the web map that is not now. In WAB dev try removing the layerlist widget and the legend widget and readding them. You will need to do the same for any other widgets that have a specific reference to the web map layers (i.e. query widget, filter widget, etc).
Thanks for the quick response! I am using the admin tools to swap my layers and am not removing any layers or changing any layer id's. Since I am simply changing the urls for the layers to reference a new urls. I don't believe this should have any references in the web application? Is that correct?
So are the layers identical (i.e fields and same layer ids) and the only thing that is changing is the url where that layer is coming from?
Yes it is just imagery, however the only difference is we are swapping from a map service to image service, could this be causing an issue?
I tried to replicate this and was unsuccessful. It appears swapping the map service with the image service is not causing any issues.
And how exactly did you replicate this?
I made a map with the original imagery layers (map services) and then swapped them with the new layers (image services), and the map still loaded in the application.
OK, but that says nothing about any widgets that were originally configured to use the map service and then you switched the webmap to have images services.