How to turn off new "auto saved map extent and layer visibility" in Nov 2015 update?

15868
53
11-19-2015 07:53 AM
DanAllen
Occasional Contributor III

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

Tags (1)
53 Replies
RobertScheitlin__GISP
MVP Emeritus

Correct.

ChrisMathers
Occasional Contributor III

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.

BrianO_keefe
Occasional Contributor III

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.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brian,

   That would be in the client\stemapp folder

AdamGebhart
Occasional Contributor III

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?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

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.

AdamGebhart
Occasional Contributor III

Thank you.  That worked.

0 Kudos
BrianO_keefe
Occasional Contributor III

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

IanPeebles
Occasional Contributor III

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?

0 Kudos
AdamGebhart
Occasional Contributor III

Ian Peebles

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.

0 Kudos