Allow App User to Save Their Personal Settings

4354
6
10-07-2015 08:19 AM
ColeAndrews
Occasional Contributor III

This is a very far fetched idea, and likely the very antithesis of a web app, but I will ask regardless in order to show due diligence. I'm expecting the group will echo what I already believe to be true...and possibly receive some public shaming.

How far from impossible is it to allow users in an organization to "save" their working settings of a web app? For example, if a particular users job requires them to focus on a specific geographic area, working with a subset of layers that are in the web app, what would it take to allow them to load the app where they left off, zoomed in to an area, with the exact layers on that they need?

Currently, the app loads at a national extent with the most common layers turned on by default, but we're getting pushback from the non-gis users that they are annoyed with having to zoom to their specific area-of-interest each time and go through the *laborious* process of checking layers off and on.

This would be similar to the "save as" function present in the Portal map viewer, but that's a completely different setup. I'm expecting there's no real one size fits all solution to appeasing the customers and having the functionality, but no harm in asking...

Tags (1)
6 Replies
RickeyFight
MVP Regular Contributor

Cole,

One solution would be to create separate webapps for each user. Then if they always work in a specific area or project you could have the map set up for them.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

Not quite the same, but check out this thread (active as recent as yesterday 10/6/2015) multiple configurations under one application

It's not quite the same as saving configurations, but maybe a way that several different focused apps could be accessed thru one front end (I have not tried yet).

0 Kudos
SimonFisher
Occasional Contributor II

If its just the saving of the map extent you are after, you could use the Bookmark widget.  If its more than that you would need to build some custom functionality to save and retrieve all state.

ColeAndrews
Occasional Contributor III

It would also need to include layer visibility rather than just extent. Plus, with hundreds of users, the Bookmark widget would become a mess.

What's the easiest/best way to save and retrieve all state? I received the below recommendation from a non-GIS software engineer, this was one of their two recommendations-- seemed to be the "easiest" of the two. Although, as a non-developer, it would seem daunting. Anyone have experience using HTML5 browser storage?

"With newer browsers you can actually write state to the browser without having to go through a server (http://www.w3schools.com/html/html5_webstorage.asp). The JS code would just use this API to write the state to the browser. Next time the user goes back to the map, the JS code looks up the state from the browser and setups the map how it was.  The downside here is that it's tied to the browser.  If you use a different browser or computer, it will not remember."

0 Kudos
SteveCole
Frequent Contributor

I think as a non-developer, there is no easy answer. The localStorage option probably is the easiest answer and the caveat mentioned is valid (clearing a person's browser cache/history would also wipe this information out).

The other option would be a a database table for each user and use that to save/update user preferences and then read/import those settings at page load. I'm not sure how you extract a "user id" from any given user (maybe through credentials?..) but if you can overcome that, the rest could follow.

ColeAndrews
Occasional Contributor III

Thanks Steve-- I would agree, seems like it would take serious time commitment to accomplish a task like this.

Similar to option you presented in the second sentence, this was their other suggestion (not using HTML5):

1) Use the ArcGIS APIs to read information about the application. This would be like what layers are active, where the map is, what zoom level etc.

2) Periodically, or when a user clicks a save button, gather all that information about the application state and store it somewhere (see state storage).

3) When the application starts, have the JS look for any state, then use the ArcGis APIs to reposition the map and add any layers etc.

State Storage:

For storing data from a web app, you typically use JS to make HTTP requests to a server. The server will lookup state from a database and send your JS back the result. The format for sending data back and forth is often JSON.

1) You would need to write a server that could handle this state and put it on the webserver. There maybe a way to use ArcGis here if they allow you to read and write to a database from the JS code.

0 Kudos