The November 2015 ArcGIS.com update has a new feature listed for Web AppBuilder where the app automatically saves your last location and layer visibility for the next time you open the app. HOW DO I TURN THIS OFF? This seems to be causing issues with map layers not loading that are coming from our internal server. Plus, I want all the layers to go back to the map default each time on map open.
Thanks
Dan
Correct.
If you are using the Developer Edition, instead of the baked into AGOL version, you can use the method that Junshan suggested. I did this morning and it worked fine. Just comment out two lines in MapManager.js. Im going to do it in my base files so whenever a new app is created it is already commented out.
Chris, where would you make those changes so that they are in base and will propogate to new maps you make? I'm still hazy on where to change core things so that they transfer over to finalized webmaps.
Brian,
That would be in the client\stemapp folder
Robert Scheitlin, GISP, Chris Mathers
Will we want to comment out the lines that Kim Bülow referenced below (see December 14th)? I tried Kim's lines in jimu.js\MapManager.js with a hosted/deployed app but the previous state or extent was preserved after refreshing, reopening and clearing the cache. Or do I have the wrong lines and/or wrong file?
Adam,
It is lines 94 thru 96 in WAB Dev 1.3 and you need to make those changes in the current app you are working on [install dir]\server\apps\[app #]\jimu.js\MapManager.js.
Thank you. That worked.
And if you want to turn it off for ALL apps you build then you can go to:
[install dir]\client\stemapp\jimus.js\MapManager.js
onBeforeUnload: function() { // this.appStateManager.saveWabAppState(this.map, this.layerInfosObj); },
- Lines 94-96
I have these lines commented out in the live application in MapManager.js file, but I am still not getting the map to return to full extent. I am using version 1.3, which we downloaded in December 2015. Is there something I am missing?
This is what I've done for lines 94-96 in my apps:
94. //onBeforeUnload: function() {
95. // this.appStateManager.saveWabAppState(this.map, this.layerInfosObj);
96. //},
I don't recall what problem I was having earlier (see my post 10:29 a.m. on 1/6/16) but everything works fine now.