Offline Mapping and Editing Funtionalities

2098
1
12-21-2012 06:11 AM
SreejaS
New Contributor II
Hi All,

We are trying to achieve editing and mapping functionalities while offlline on field devices. We are looking into the option of creating a web based application using ArcGIS API for Javascript with HTML5 capabilities, since HTML5 has data caching properties.

But we are having questions around the browser compatabilities and offline editing capabilities. It would be really helpful if somone can give insights on this. Also if anybody has better suggestions for this, please share.

Thanks in Advance
Sreeja S.
0 Kudos
1 Reply
ReneRubalcava
Frequent Contributor
Funny you should ask, I am in the process of prototyping some stuff that does just this, so I'm curious to see what approaches people may have. I have heard people mention they implemented it, but not the actual steps or how to handle the nuances.

I haven't coded much beyond capturing errors when offine and storing some points. I have not yet pushed an edit on reconnect.

But, here is my plan if I may share in a rough format,

On the editing portion, I have a simple add feature (pt, polygon, line) button to do edits. So far, I listen for an error on my base layers onUpdateEnd, it's jsut an error message though, not an error code, but for now I assume I've lost connection. Then I popup a message that the user is now working in a "limited offline mode". At this point, I start to store basic edit info in the local storage. I try to strip it to x,y's and attributes unique to the edit. Local storage is small. It's supposed to be 5MB, but you can probably only rely on 2.5MB and even then if they are using other apps accessing local storage, even less.

It's the returning to online mode I have not fully tested yet. If my base onUpdateEnd does not return an error, return to online mode and retrieve updates from local storage, push them out to the featureservice, clear the local storage and voila, done, magic 😄

In theory it sounds great. Major snag I hit was the base layer tiles. You only have access to cached tiles, once you pan somewhere new no more tiles. I'm not sure if you can somehow precache tiles to the browser without the user knowing. Maybe sending a request to download 2 or 3 extra tiles around extents without user knowing. I just imagine that would add some overhead, but won't know until I try to test it. This would give you some wiggle room, but not a lot.

This is all just rough ideas I've been toying with. I have by no means successfully implemented these in a production environment. I'm sure there is a better way to detect when I've gone offline, but this little method works so far, but only afer you pan the map and no data is returned. I suppose you could try to listen for error event from the feature you are trying to edit? I think the key with an app that can do any edits outside of a desktop environment is simplicity. The simpler it is overall, the easier it will be to handle an offline situation.

Local storage will only get you so far. I have been using a cool add-on for FireFox called Elite Proxy Switcher to quickly test offline mode with one button click. I just point the proxy to an obscure port on my localhost.

Sorry, just thinking out loud.
0 Kudos