Select to view content in your preferred language

HTML5 Offline App issues

932
5
04-03-2012 01:41 PM
GrantCarroll
Deactivated User
Hi All

I have created an HTML5 application for online and offline editng of data. It works pretty well until I have taken the final step and applied an application manifest to cache the files i need to run offline. Obvisouly one of these is the ESRI Api, however when I refresh the page after the initial load of the page i get the following error. "Could not load cross-domain resources: dojox.gfx.svg esri.nls.sjapi.... etc".

What have I missed, I'm thinking the api makes calls to Dojo to load in some resources and as a result its trying to load these but can't ?? However I am still online when I do the refresh, and the browser is pulling everything from the cache. Any advice would be most appreciated.

Thanks

Grant
0 Kudos
5 Replies
GrantCarroll
Deactivated User
Solved my own problem.

I just ran it through firebug and found any files that were not loading, and added them to my manifest file. Now it works.
0 Kudos
JamesCornwell-Shiel
Deactivated User
Out of curiosity, how are you handling data editing while offline, and syncing that data to the server when online?
0 Kudos
GrantCarroll
Deactivated User
Hi

I have followed the example on the samples page but I had added in a manual sync button, I will eventually automate this to automatically sync when the application comes back on line. The way I do it is to load in the feature service when the users syncs, grab all the graphics that have been created while offline from local storage (see the HTML5 example on the samples page) and pass them into the feature service and then remove them from local storage. I have also implemented a version of the raster storage as well so that users can have aerials offline, however there is a limit on the local storage size to 5gb so I have been using  phonegap and a SQLite plugin to store the cached map service in a database. I also have a button to manual clear the local storage and database just in case.

Any other questions happy to answer

Cheers
0 Kudos
akpagaakpaga
Deactivated User
Hi grant,

I am trying to do similar application as you have done...Can You Please let me know how you are loading your map service when offline..Are you using MBTiles..
Can You please share some resources as to where I can get started...I already have used The Local Stoarage sample from HTML5 samples  and Got my dynamic service layer and feature layer to show up.

I wnat them to show up when offline ..How can I do it...Thank you very much
0 Kudos
TomMacWright
New Contributor
There's a pretty decent blog post on using MBTiles with PhoneGap and the SQLite plugin.
0 Kudos