15

My goal is to have a world map embedded in a web page, but without access to the internet. Preferrably only a set of tiles in combination with some slippy map js-lib. Storage space is not really an issue, and max zoom level is not required.

What is the easiest way to accomplish this?

I found a project that seems to fit the bill - Maps on a stick, but it seems to be dead?

7
  • 2
    What exactly does "max zoom is not required" mean? What kind of scale/accuracy/resolution do you need?
    – Mr_Chimp
    Commented Apr 18, 2012 at 14:22
  • 2
    mapnik (Windows) github.com/mapnik/mapnik/wiki/WindowsInstallation and use localhost as the url (local machine)
    – Mapperz
    Commented Apr 18, 2012 at 14:28
  • The accuracy and resolution are not important, countries and mayor cities are sufficient, but of course I want it to be as good as possible. Simplicity is more important, I'm trying to avoid extra services and databases.
    – tek
    Commented Apr 18, 2012 at 14:34
  • 1
    If you're willing to spend a couple days configuring on windows then mapnik + postgis + postgresql + proj.4 + python 2.7 + ... is an option but after having gone through that I'd recommend researching the TileMill answer below. Sounds much easier.
    – ca0v
    Commented Apr 18, 2012 at 15:07
  • It is really simple. The only problem is getting hold of the map data and the licensing problems involved with creating an offline map system. I.e. most map providers that allow free use (e.g. google) only do so when the map is available to the public. But this is a whole different question... I was only doing it for the UK so used the OS Open Data which is free to use.
    – Mr_Chimp
    Commented Apr 18, 2012 at 15:12

4 Answers 4

17

I would recommend looking into TileMill which is made by the same people that were workign on Maps On A Stick. TileMill was either part of Maps On A Stick, or is what Maps On A Stick became - something like that. I forget the connection. Anyway...

TileMill will let you load geographic data, style it how you like and then create a set of PNG map tiles for a variety for zoom levels.

The output of TileMill is a .mbtiles file. This is just a sqlite database which holds the PNGs. If you're working offline it's probably easier to extract the pngs to a folder (using mbutil)rather than using sqlite to access them.

If your map is fairly simple (i.e. minimal interaction), I'd recommend using Leaflet for your mapping library.

In leaflet you then need to add a tile layer (hint: use tms rather than xyz).

Hope that helps.

Edit: Couple of things to note.

1) You should be aware of the licensing restrictions with any map data you use (see my comment on the question above).

2) If you get close in enough to see roads etc then expect to have several GBs of tiles.

1
  • Got a proof of concept up and running! I'll have to investigate the licensing issues further, but this is most likely the easiest solution.
    – tek
    Commented Apr 19, 2012 at 12:40
2

Another option would be something like mapwingis. No need for tiles, it'll read shapefiles.

2
  • MapWinGIS is pretty good but the question specified web-based.
    – Mr_Chimp
    Commented Apr 19, 2012 at 12:40
  • It said web PAGE, not web based, and specified no internet access so I assumed that meant server based (or local), which would be okay for mapwingis. I've used it in a form in an Access database and can't imagine it would be any more difficult to implement in a web page.
    – Ian
    Commented Apr 20, 2012 at 0:04
2

I've found a new project called OpenMapTiles, which makes it a lot easier to have offline maps.

Setting up a tile server on your machine is very easy. Install Node.js (with npm) and follow the two steps in their docs: https://openmaptiles.org/docs/

You can download the maps from their website (including a map of the entire planet, which is now ~44 GB): https://openmaptiles.org/downloads/

1

If you can make an MBTiles file (for example with Tilemill), then you can convert that file into a simple bag of tiles in nested folders that conform to the expected z/x/y layout using tilestache-seed.py, a script included with Tilestache. Here's one I made recently:

http://mike.teczno.com/img/hachure/labels/

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