Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm not sure whether to post this here or on Stackoverflow, as it's sort of a crossover. Let me give it a try.

In the proposed HTML5 standard, there's the option of storing web application data in a local cache using a cache manifest. I am looking to use this technique for an offline tiled web map application and did a quick prototype here based on a standard install of Geoserver.

I just ripped the OpenLayers client page that is generated from one of the default layers and changed the <html> tag to

<html xmlns="http://www.w3.org/1999/xhtml" manifest="cache.manifest">

And created the file cache.manifest which simply reads

CACHE MANIFEST
http://lima.schaaltreinen.nl:8080/

Which should, in my limited understanding of the matter, locally cache everything that loads from that URL: all tiles and the OpenLayers JS. In fact, upon first call in Firefox, it does ask me to allow local storage, but when I hit refresh - either online or offline - the page croaks stating that the OpenLayers object is not defined. Looks like it hasn't loaded the OpenLayers JS.

Anyone successfully did a functioning offline OpenLayers-based tiled web map app? Or hints on how to investigate this further?

share|improve this question
add comment

4 Answers

up vote 8 down vote accepted

You might be interested in the projects Maps on a Stick and MapBox iPad. (disclaimer: designed the former, involved in the latter. however, both are BSD-licensed, and the underlying tile format, termed ".mbtiles", is SQL-based.)

Maps on a Stick is an offline OpenLayers map. The main reasoning for going with a portable database/server instead of client side storage is that using browsers as large data storage isn't quite worked out and populating and indexing the cache can be costly.

share|improve this answer
    
Interesting solution, not what I was thinking about but it looks workable. How easy or difficult is it to load MapBox / Maps on a Stick with custom tile layers? –  mvexel Jan 12 '11 at 19:41
1  
It's relatively simple: there are a few tools - a C-based importer ( github.com/developmentseed/mb_tiles_importer ), a version of gdal2tiles that outputs mbtiles ( github.com/developmentseed/gdal2mb ), and an upcoming GUI tool. –  tmcw Jan 26 '11 at 14:18
add comment

Think you will need to create your own tilecache on 'localhost' see http://code.google.com/p/cumberland/wiki/TilePyramiderAndOpenLayers

Examples

    Using vmap
    http://localhost:8081/vmap0/levelzero/0/0.png
    The tile near the middle of the tile set in the third zoom level of vmap0.
    http://localhost:8081/vmap0/leveltwo/3/4.png
    The tile near the middle of the tile set in the fifth zoom level of landsat2000.
    hhttp://localhost:8081/vmap0/landsat2000/1/8500/8500.png
Source:
    The tile at the origin of the tile set in the first zoom level of basemap.
    http://www.osgeo.org/services/basemap/L1/0/0.png

Note: must not have spaces

share|improve this answer
    
This is useful but requires a local web server, which might not always be feasible, e.g. when you want it to run on an iPhone / iPad. In general, I am looking to achieve this without any requirements on the client side other than a HTML5/cache manifest savvy web browser. –  mvexel Nov 15 '10 at 11:03
    
1  
I linked to that page in the original question already. I know this is the way to go, but I am trying to find out if it's feasible at all. –  mvexel Nov 16 '10 at 8:23
add comment

One complexity that seems to show up in articles about this is that:

Note that the MIME type of the manifest file is text/cache-manifest.

And the examples all seem to list specific files to cache (but I may need to read further).

share|improve this answer
    
That's one thing that is not clear to me: whether you need to whitelist specific concrete URLs or you can use URL prefixes. I have not been able to test this yet. Anyone who has? –  mvexel Nov 15 '10 at 11:00
add comment

Maybe another approach: Geopublisher http://en.geopublishing.org can publish your maps for offline use. Geopublisher is a Desktop software that allows you to plug together vector and raster data and create digital maps. Then you can export this map as a stand-alone Java application. It even creates autostart files etc. and does not require a Java installation on the targeted computers.

share|improve this answer
    
note: The destination is in German even though the url is to the English language version of the site. To fix locate the [english] link in the left hand navigation column. –  matt wilkie Mar 28 '12 at 17:59
    
Thanks.. I fixed it –  alfonx Mar 31 '12 at 21:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.