News for hackers. Stuff that matters.
Re:Self Hosting a Google Maps Alternative with OpenStreetMap by curiousfab on Tuesday November 22, 2022 @08:46AM (#33705686)
As a solution in between, for those who want to include a OSM map on their website but don't want to put load on the official OSM tile servers, a simple tile proxy may be a good idea.

I am using something based on https://wiki.openstreetmap.org/wiki/ProxySimplePHP5 for a long time already and since I don't need to have up to date tiles every day, I set the TTL to a few weeks.

Together with leaflet this works beautifully.

Re:Self Hosting a Google Maps Alternative with OpenStreetMap by CSSer on Tuesday November 22, 2022 @09:06AM (#33705884)
Out of curiosity, what’s the motivation to error suppress the mkdir call here (my PHP is rusty)? Anyway, this is great. Thank you for sharing!
Re:Self Hosting a Google Maps Alternative with OpenStreetMap by okasaki on Tuesday November 22, 2022 @09:11AM (#33705942)
It returns an error if the directory already exists (same as in Python)
Re:Self Hosting a Google Maps Alternative with OpenStreetMap by uneekname on Tuesday November 22, 2022 @04:01PM (#33711456)
While we're on the topic, in Python there's a nice way to deal with this:

os.makedirs(path, exist_ok=True)

Re:Self Hosting a Google Maps Alternative with OpenStreetMap by lukeqsee on Tuesday November 22, 2022 @08:49AM (#33705719)
For sure! There's a lot of in-between solutions (depending on what services/regions/update frequency you need).