PirateBox & OpenStreetMap

Posted by ratzillas 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
PirateBox & OpenStreetMap
February 26, 2013 08:58PM
Hi all,

Just share my h4ck on embedding OpenStreetMap tiles on PirateBox
I just want to have a map in my train between Paris and Vernon (Upper Normandy)
You can download my demo here:

[ratzillas.com]

Feel free to h4ck it.

Currently work on a one file for tiles with MBtiles format.
MBtiles is a SQLite based format from MapBox.
On my last try php5-mod-pdo-sqlite was buggy on OpenWRT.

Feel free to tell me if it's helpful for you.

Gaël aka @RatZillaS on Identi.ca or Twitter

Have Maps Fun winking smiley
Re: PirateBox & OpenStreetMap
February 27, 2013 06:01PM
Hi, can i just ask you how you did that? Did you just download the file from openstreetmap website? Et si vous êtes français alors ce sera encore plus simple smiling smiley
Re: PirateBox & OpenStreetMap
April 02, 2013 11:22PM
hi Ratzillas,
Tried your hack. Extracted the files to shared directory in my piratebox.

I am able to invoke the page. But the map does not get loaded.

Any clues as to what should be done?

cheers
bala
Re: PirateBox & OpenStreetMap
April 06, 2013 09:19AM
have debugged the script for piratebox.
need to use tms: false
tiles directory to be correctly specified in the script.

thanks for sharing the script.
Re: PirateBox & OpenStreetMap
June 12, 2013 02:04PM
ratzillas - really cool idea! Too bad for me, Leaflet is loading but the tiles are not. My error message in Chrome:

Not allowed to load local resource: file:///tiles/12/2074/1408.jpg	leaflet.js:6

I tried bala's trick of adding `tms: false` but, no change. Any ideas? Thanks!
Re: PirateBox & OpenStreetMap
June 12, 2013 03:29PM
If I edit the leaflet js script section of OSM_In_A_Box_beta.html, and use
Language: Javascript
L.tileLayer(';./tiles/{z}/{x}/{y}.jpg';
instead of the original
Language: Javascript
L.tileLayer(';file:./tiles/{z}/{x}/{y}.jpg';
Chrome reports:
Resource interpreted as Image but transferred with MIME type text/html
Re: PirateBox & OpenStreetMap
June 18, 2013 03:08PM
@ratzillas : Could you show us a little bit tutorial how to make this map?
I have make the tiles from Open Street Map using Maperitive, but don't know how to modify your file in
http://ratzillas.com/osm/osm_onboard.zip to show the map.
Thanks
Re: PirateBox & OpenStreetMap
June 18, 2013 04:19PM
.@johanrusli, et al - -

Here is a gist of the html code that is currently working for me [gist.github.com] .. with a little nudge in the right direction from @bala, I was able to overcome my roadblock.

I am using MOBAC [mobac.sourceforge.net] to make .mbtiles. I then used mbutil [github.com] to make a tiles folder. I might be missing how MOBAC can directly create a tiles folder - but the workflow is successful enough, for now.

Next, will be trying to clean up the layer-switching and make it more mobile friendly (in Leaflet).



Edited 1 time(s). Last edit at 03/12/2014 03:56PM by oeon.
Re: PirateBox & OpenStreetMap
June 19, 2013 03:49AM
Hooray....I made it...smileys with beer
Using Maperitive(v2.3.25) to generate Tiles
Little bit modification in OSM_In_A_Box_Beta.html (by Ratzillas)
Ta..dah...the map of my hometown appears already.

Thanks everyone !thumbs up

Note: This works on my pc using Xampp local server.
I believe it should work on Piratebox too. I will try it on the Box
as soon as my bricked router debrick already. winking smiley
ruk
Re: PirateBox & OpenStreetMap
July 27, 2013 12:25AM
I've prepared some basic documentation for getting "OpenStreetBox" up and running on a PirateBox, generating tiles with TileMill and using Leaflet, inspired by Ratzillas code:

[github.com]

[ruk.ca]
Re: PirateBox & OpenStreetMap
July 27, 2013 07:56PM
Hi ruk,
I added your howto to my modification-list.

regards Matthias
Hello,

I spend few hours (days!) trying to put offline Openstreetmap page on the Piratebox with your tutorial without managing anything!

But, I find this one Openlayers local tiles tutorial which is for me much more easier to understand and to adapt! Meaning that there is not much coding and writing what is good for a beginner like me.
I use the software Maperitive to make to tiles file, but it seems that there is a lot of different possibility to do this.

Regards,
Bastien
Re: PirateBox & OpenStreetMap
February 07, 2018 06:43PM
Hey, thanks for posting this ratzillas. I got this working on ubuntu 'trusty' (tilemill hasn't been pulled for xenial xerus) in Oracle VM. I am a complete absolute day one beginner in linux and just started my piratebox build and this mod is something I definitely want for my box. I followed the same tutorial ratzillas followed except found the ubuntu version. Had a lot of roadblocks and took me a whole day and half to get this working. Just had a few contributions/notes to add to this thread.

I followed this tutorial: OSM Bright for Ubuntu quickstart for those who want to use ubuntu 'trusty'. Note that the version of postgresql I had to use was 9.3 not 9.1 and postgis is 2.1 not 1.5 as stated in the tutorial under "Step 1: Set up a database for your OSM data" as those are the latest versions that are downloaded with apt-get.

I ran into a roadblock when I ran ./make.py which creates your project in tilemill to begin exporting and editing. The problem was due to JSON not allowing trailing commas when reading 'osm-bright.imposm.mml' (if you are using imposm and not osm2pgsql, in which case you should use the osm2pgsql.mml file in the same directory). The issue I had was removing a comma at the end of the extent id.

expecting property at line 554 and column 7
Language: Javascript
"Datasource": { "type": "postgis", "table": "( SELECT geometry, type, name \n FROM osm_transport_points \n WHERE type=';station';\n) AS DATA ", "key_field": "", "geometry_field": "geometry", "extent": "-20037508.34 -20037508.34 20037508.34 20037508.34", }, "id": "train_stations", "class": "", "srs-name": "900913", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "advanced": {}, "name": "train_stations" }
the error returned was that it was expecting a property at line 554 and column 7 because there was a comma at the end of those numbers at: "extent": "-20037508.34 -20037508.34 20037508.34 20037508.34",
I removed the comma: "extent": "-20037508.34 -20037508.34 20037508.34 20037508.34"
saved the file and ran ./make.py again and it worked *chefs kiss*

That's all I can think of to say right now. I followed ratzillas documentation as well to complete this build. Thanks a bunch. I would have never imagined this would have been something I could do without the help of the community.