diff --git a/LICENSE b/LICENSE deleted file mode 100644 index b7e147a..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2023 Zsolt Ero - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..b70bbf6 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,67 @@ +## Licenses + +The license of this project is [MIT](https://www.tldrlegal.com/license/mit-license). + +Map data is from [OpenStreetMap](https://www.openstreetmap.org/copyright). + +[OpenMapTiles](https://github.com/openmaptiles/openmaptiles) code is released under the [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)), design under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). [LICENSE.md](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md). + +### Styles + +#### Bright + +Fork from [openmaptiles/osm-bright-gl-style](https://github.com/openmaptiles/osm-bright-gl-style). The OSM Bright GL Style is derived from [Mapbox Open Styles](https://github.com/mapbox/mapbox-gl-styles). The OSM Bright GL Style’s code is released under the [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)). The OSM Bright GL Style’s design is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). [LICENSE.md](https://github.com/openmaptiles/osm-bright-gl-style/blob/master/LICENSE.md). + +#### Liberty + +Fork from [maputnik/osm-liberty](https://github.com/maputnik/osm-liberty). OSM Liberty is a fork of OSM Bright. The OSM Bright GL Style is derived from [Mapbox Open Styles](https://github.com/mapbox/mapbox-gl-styles). The OSM Bright GL Style’s code is released under the [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)). The OSM Bright GL Style’s design is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). [LICENSE.md](https://github.com/maputnik/osm-liberty/blob/gh-pages/LICENSE.md). + +#### Positron + +Fork from [openmaptiles/positron-gl-style](https://github.com/openmaptiles/positron-gl-style). The Positron GL Style is derived from [CartoDB Basemaps](https://github.com/CartoDB/CartoDB-basemaps) designed by Stamen and Paul Norman for CartoDB Inc., licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/). The Positron GL style’s code is released under the [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)). The Positron GL Style’s design is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). [LICENSE.md](https://github.com/openmaptiles/positron-gl-style/blob/master/LICENSE.md). + +### Fonts + +[Noto Sans](https://www.google.com/get/noto/) is released under the [SIL Open Font License, Version 1.1](https://openfontlicense.org/) + +### **Icons** + +The [Maki POI icon set](https://github.com/mapbox/maki/blob/master/LICENSE.txt) is licensed under CC0 1.0 Universal. + +The right arrow was derived from [Wikipedia](https://commons.wikimedia.org/wiki/File:Arrowright.svg), it is public domain. + +### Natural Earth + +[Natural Earth](https://www.naturalearthdata.com/) map data is in the public domain. + +### Tools + +spritezero-cli is from [mapbox/spritezero-cli](https://github.com/mapbox/spritezero-cli), licensed [ISC](https://github.com/mapbox/spritezero-cli/blob/master/LICENSE.md). + + + +--- + +## Licence of this repo + +MIT License + +Copyright (c) 2023 Zsolt Ero + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index d7f69a6..5f715b8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # openfreemap + + + + +### License + +Licenses are listed in [LICENSE.md](LICENSE.md) diff --git a/lint.sh b/lint.sh index 6014443..030d200 100755 --- a/lint.sh +++ b/lint.sh @@ -6,3 +6,4 @@ ruff format . find . -type f -name '*.conf' -path '*/nginx*' -exec nginxfmt -v {} +; + diff --git a/website/favicon.ico b/website/favicon.ico new file mode 100644 index 0000000..be74abd Binary files /dev/null and b/website/favicon.ico differ diff --git a/website/generate.py b/website/generate.py new file mode 100755 index 0000000..4e921af --- /dev/null +++ b/website/generate.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python + +import marko + + +def generate(): + licenses = open('../LICENSE.md').read().split('---')[0] + map_html = open('map.html').read() + + text_md = open('text.md').read() + text_md = text_md.replace('{licenses}', licenses) + + text_html = marko.convert(text_md) + + template = open('template.html').read() + template = template.replace('{text}', text_html) + template = template.replace('{map}', map_html) + + open('index.html', 'w').write(template) + + +if __name__ == '__main__': + generate() diff --git a/website/index.html b/website/index.html new file mode 100644 index 0000000..79e0a0d --- /dev/null +++ b/website/index.html @@ -0,0 +1,136 @@ + + + + + + + OpenFreeMap + + + + + + + + + + + + + + + + +

OpenFreeMap

+

What is this?

+

OpenFreeMap is an open and free OpenStreetMap tile hosting service.

+

It's truly free: there is no limit on the amount of map views or requests you can make or how you use your map. There is no registration page, user database, API keys nor cookies.

+

It's truly open source: everything, including the full production setup is on GitHub.

+

Why is this important?

+

OpenStreetMap is one of the most important collective projects in history. More than 2 million users have contributed to it over 19 years; 3 million edits are made each day.

+

Unfortunately, when you want to use the map on your website or app, you need to look for a commercial map tile provider and hope your site doesn't get too popular, otherwise you might end up with a $10,000 bill in a single day, like Hoodmaps did *.

+

You can try self-hosting, but it requires a big server and a lot of time to get it right.

+

Who is behind this project?

+

I'm Zsolt Ero (twitter, blog). I've created MapHub and I've been running map hosting in production for 8 years.

+

How can I use it?

+

Include MapLibre GL JS in <head>

+
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
+<link
+  href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css"
+  rel="stylesheet"
+/>
+
+

And initialize it to a div, like this:

+
<div id="map" style="width: 600px; height: 400px"></div>
+
+<script>
+  const map = new maplibregl.Map({
+    style: "https://tiles.openfreemap.org/styles/liberty",
+    center: [-74.5, 40],
+    zoom: 9,
+    container: "map",
+  });
+</script>
+
+

+ + + +

+

If you've used Mapbox GL before, please migrate to MapLibre. It is based on the last open-source version of Mapbox GL, before it went closed-source. A Leaflet based snippet is coming soon.

+

For mobile apps, you can do the same with MapLibre Native.

+

You can also download our processed planet MBTiles and BTRFS images if you want to self-host yourself. Details are in the GitHub at hyperknot/openfreemap.

+

How can I donate or support this project?

+

...

+

How can I follow this project?

+

The main repo is hyperknot/openfreemap

+

Styles are at hyperknot/openfreemap-styles

+

twitter: @hyperknot

+

twitter: @OpenFreeMapOrg

+

mastodon zsolt https://elk.zone/sigmoid.social/@hyperknot/followers

+

mastodon ofm TODO

+

Is commercial usage allowed?

+

Yes.

+

Why did I make this?

+

Because I waited for years for someone to offer this service, but realised no one is going to make it. So, I thought I might use my map hosting experience and do it.

+

I'll share more about the why in a blog post in the future, feel free to subscribe on the links above.

+

How can this work? How can a one person project offer unlimited map hosting for free?

+

There is no technical reason why vector tile hosting should cost as much as it does today.

+

Vector tiles are just static files. OK, serving 300 million files is not easy, but at the end of the day they are just files.

+

Financially, the plan is to keep buying Hetzner servers until they cover the bandwidth. I believe it can work if enough people contribute. If this project helps you save your map hosting costs, please consider our support plans!

+

What is the tech stack?

+

The map schema is OpenMapTiles.

+

The tiles are generated by Planetiler.

+

There is no tile server running, only BTRFS partition images with 300 million hard linked files.

+

The server is nginx on Ubuntu.

+

There is no cloud, just dedicated servers on Hetzner.

+

Currently using Cloudflare, but it's designed so that it can be changed any time.

+

Moreover, a lot of work is going into customising the styles at openfreemap-styles.

+

What about PMTiles?

+

I would have loved to use PMTiles, they are a brilliant idea!

+

Unfortunately, making range requests in 80 GB files is just not working in production. They are fine for < 500 MB files, but have terrible latency and caching issues for full planet datasets.

+

Attribution

+

If you are using MapLibre, attributions are automatically added.

+

If you are using this in a printed media or video, please attribute:

+

OpenFreeMap © OpenMapTiles Data from OpenStreetMap

+

You don't need to display the OpenFreeMap part, but it's nice if you do.

+

Licenses

+

The license of this project is MIT.

+

Map data is from OpenStreetMap.

+

OpenMapTiles code is released under the BSD 3-Clause License, design under CC BY 4.0. LICENSE.md.

+

Styles

+

Bright

+

Fork from openmaptiles/osm-bright-gl-style. The OSM Bright GL Style is derived from Mapbox Open Styles. The OSM Bright GL Style’s code is released under the BSD 3-Clause License. The OSM Bright GL Style’s design is released under CC BY 4.0. LICENSE.md.

+

Liberty

+

Fork from maputnik/osm-liberty. OSM Liberty is a fork of OSM Bright. The OSM Bright GL Style is derived from Mapbox Open Styles. The OSM Bright GL Style’s code is released under the BSD 3-Clause License. The OSM Bright GL Style’s design is released under CC BY 4.0. LICENSE.md.

+

Positron

+

Fork from openmaptiles/positron-gl-style. The Positron GL Style is derived from CartoDB Basemaps designed by Stamen and Paul Norman for CartoDB Inc., licensed under CC BY 3.0. The Positron GL style’s code is released under the BSD 3-Clause License. The Positron GL Style’s design is released under CC BY 4.0. LICENSE.md.

+

Fonts

+

Noto Sans is released under the SIL Open Font License, Version 1.1

+

Icons

+

The Maki POI icon set is licensed under CC0 1.0 Universal.

+

The right arrow was derived from Wikipedia, it is public domain.

+

Natural Earth

+

Natural Earth map data is in the public domain.

+

Tools

+

spritezero-cli is from mapbox/spritezero-cli, licensed ISC.

+ + + + + + diff --git a/website/logo_512.png b/website/logo_512.png new file mode 100644 index 0000000..f96d0e5 Binary files /dev/null and b/website/logo_512.png differ diff --git a/website/map.html b/website/map.html new file mode 100644 index 0000000..d9fbf04 --- /dev/null +++ b/website/map.html @@ -0,0 +1,28 @@ +
+ + + diff --git a/website/style.css b/website/style.css new file mode 100644 index 0000000..4c3c251 --- /dev/null +++ b/website/style.css @@ -0,0 +1,81 @@ +/* + Josh's Custom CSS Reset + https://www.joshwcomeau.com/css/custom-css-reset/ +*/ +*, *::before, *::after { + box-sizing: border-box; +} +* { + margin: 0; +} +img, picture, video, canvas, svg { + display: block; + max-width: 100%; +} +input, button, textarea, select { + font: inherit; +} + +/* --- start --- */ + +body { + padding: 0 40px; + + line-height: 1.5; + font-size: 17px; + -webkit-font-smoothing: antialiased; + + font-family: Avenir, Montserrat, Corbel, 'URW Gothic', source-sans-pro, sans-serif; + font-weight: normal; + + color: #000; +} + +h1, h2, h3, h4, h5, h6 { + color: #555; + max-width: 600px; + margin: 1em auto 0.5em; + line-height: 1.2; + + + font-family: Seravek, 'Gill Sans Nova', Ubuntu, Calibri, 'DejaVu Sans', source-sans-pro, sans-serif; + font-weight: 700; +} + +a { + color: #444; +} + +.logo { + margin: 0 auto; +} + +h1 { + text-align: center; + margin: 0 auto; +} + +p { + max-width: 600px; + margin: 0 auto 0.6em; +} + +pre { + background: #efefef; + + + max-width: 800px; + margin: 0 auto; + font-size: 14px; +} + +code { + font-family: 'Nimbus Mono PS', 'Courier New', monospace; + font-weight: 600; + background: #efefef; +} + +#map { + height: 500px; + width: 100%; +} \ No newline at end of file diff --git a/website/template.html b/website/template.html new file mode 100644 index 0000000..578f427 --- /dev/null +++ b/website/template.html @@ -0,0 +1,29 @@ + + + + + + + OpenFreeMap + + + + + + + + + + + + + + + + +{text} + + + + + diff --git a/website/text.md b/website/text.md index 77909f2..d9d9345 100644 --- a/website/text.md +++ b/website/text.md @@ -2,61 +2,58 @@ ## What is this? -OpenFreeMap is a free, open-source OpenStreetMap based map hosting service for everyone. +OpenFreeMap is an open and free OpenStreetMap tile hosting service. -It's truly free: there is no limit on the amount of map views or requests you can make. +It's truly free: there is no limit on the amount of map views or requests you can make or how you use your map. There is no registration page, user database, API keys nor cookies. -Actually, there is not even a registration page or a user database, there are no API keys nor cookies. - -It's truly open source, not open core. Everything, including the last production detail is up on GitHub. +It's truly open source: everything, including the full production setup is on GitHub. ## Why is this important? -OpenStreetMap is one of the most important collective projects in history. More than 3 million edits are made each day, over 2 million users have contributed to the project so far. +OpenStreetMap is one of the most important collective projects in history. More than 2 million users have contributed to it over 19 years; 3 million edits are made each day. -The problem starts when you want to use a map on your website or app: you need to look for a commercial map provider and hope your site doesn't get too popular, otherwise you might end up with a $10,000 bill in a single day, like Hoodmaps did [*](https://twitter.com/levelsio/status/1730659933232730443). +Unfortunately, when you want to use the map on your website or app, you need to look for a commercial map tile provider and hope your site doesn't get too popular, otherwise you might end up with a $10,000 bill in a single day, like Hoodmaps did [*](https://twitter.com/levelsio/status/1730659933232730443). -Or you can try self-hosting, but it requires a big server and a lot of time to get it right. +You can try self-hosting, but it requires a big server and a lot of time to get it right. -Well, it required: OpenFreeMap also allows you to self-host with a single command. +## Who is behind this project? -## Who is behind this project and why? - -I'm Zsolt Ero (twitter, blog). I've created [MapHub](https://maphub.net/) and I've been running map hosting in production for 8 years. - -Why did I make this? Because I waited for years for someone to offer this service, but realised no one is going to make it. So, I thought I might use my map hosting experience and do it. - -I'll share more about the why in a blog post in the future, feel free to subscribe on the links above. +I'm Zsolt Ero ([twitter](https://twitter.com/hyperknot), [blog](https://blog.hyperknot.com/)). I've created [MapHub](https://maphub.net/) and I've been running map hosting in production for 8 years. ## How can I use it? Include [MapLibre GL JS](https://maplibre.org/maplibre-gl-js/docs/) in `` ``` - - + + ``` -And use the following in your HTML: +And initialize it to a div, like this: ``` -
+
``` +{map} + If you've used Mapbox GL before, please migrate to MapLibre. It is based on the last open-source version of Mapbox GL, before it went closed-source. A Leaflet based snippet is coming soon. For mobile apps, you can do the same with [MapLibre Native.](https://maplibre.org/) - +You can also download our processed planet MBTiles and BTRFS images if you want to self-host yourself. Details are in the GitHub at [hyperknot/openfreemap](https://github.com/hyperknot/openfreemap). ## How can I donate or support this project? @@ -66,35 +63,44 @@ For mobile apps, you can do the same with [MapLibre Native.](https://maplibre.or ## How can I follow this project? -github +The main repo is [hyperknot/openfreemap](https://github.com/hyperknot/openfreemap) -twitter zsolt +Styles are at [hyperknot/openfreemap-styles](https://github.com/hyperknot/openfreemap-styles) -twitter ofm +twitter: [@hyperknot](https://twitter.com/hyperknot) -mastodon zsolt +twitter: [@OpenFreeMapOrg](https://twitter.com/OpenFreeMapOrg) -mastodon ofm +mastodon zsolt https://elk.zone/sigmoid.social/@hyperknot/followers + +mastodon ofm TODO - -#### Is commercial usage allowed? +## Is commercial usage allowed? Yes. -#### How can this work? How can a one person project offer unlimited tile hosting for free? +## Why did I make this? + +Because I waited for years for someone to offer this service, but realised no one is going to make it. So, I thought I might use my map hosting experience and do it. + +I'll share more about the why in a blog post in the future, feel free to subscribe on the links above. + + + +## How can this work? How can a one person project offer unlimited map hosting for free? There is no technical reason why vector tile hosting should cost as much as it does today. Vector tiles are just static files. OK, serving 300 million files is not easy, but at the end of the day they are just files. -Financially, the plan is basically I keep buying Hetzner servers until they cover the load. I believe it can work, if enough people contribute with the support plans. +Financially, the plan is to keep buying Hetzner servers until they cover the bandwidth. I believe it can work if enough people contribute. If this project helps you save your map hosting costs, please consider our support plans! -### What is the tech stack? +## What is the tech stack? The map schema is [OpenMapTiles](https://github.com/openmaptiles/openmaptiles). @@ -106,56 +112,26 @@ The server is nginx on Ubuntu. There is no cloud, just dedicated servers on Hetzner. -Currently using Cloudflare, but designed so that it can be changed any time. +Currently using Cloudflare, but it's designed so that it can be changed any time. -Moreover, a lot of work went into customising the styles at [openfreemap-styles](https://github.com/hyperknot/openfreemap-styles). +Moreover, a lot of work is going into customising the styles at [openfreemap-styles](https://github.com/hyperknot/openfreemap-styles). -### What about PMTiles hosted on the cloud? +## What about PMTiles? I would have loved to use PMTiles, they are a brilliant idea! -Unfortunately, making range requests in 80 GB files is just not working in production. They are fine for < 500 MB files, but have terrible latency and caching issues for full planet datasets. +Unfortunately, making range requests in 80 GB files is just not working in production. They are fine for < 500 MB files, but have terrible latency and caching issues for full planet datasets. +## Attribution +If you are using MapLibre, attributions are automatically added. -## Licenses and attribution - -If you are using MapLibre, all attributions are taken care of. - -If you are using this in a printed media or web, please attribute: +If you are using this in a printed media or video, please attribute: OpenFreeMap © OpenMapTiles Data from OpenStreetMap +You don't need to display the OpenFreeMap part, but it's nice if you do. - - don't need to display the OpenFreeMaps text, but it's nice if you do. - -Map data from [OpenStreetMap](https://www.openstreetmap.org/copyright). - -[OpenMapTiles](https://github.com/openmaptiles/openmaptiles) code is released under the [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)), design under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). [LICENSE.md](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md). - -##### Styles - -###### Bright - -Fork from [openmaptiles/osm-bright-gl-style](https://github.com/openmaptiles/osm-bright-gl-style). The OSM Bright GL Style is derived from [Mapbox Open Styles](https://github.com/mapbox/mapbox-gl-styles). The OSM Bright GL Style’s code is released under the [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)). The OSM Bright GL Style’s design is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). [LICENSE.md](https://github.com/openmaptiles/osm-bright-gl-style/blob/master/LICENSE.md). - -###### Liberty - -Fork from [maputnik/osm-liberty](https://github.com/maputnik/osm-liberty). OSM Liberty is a fork of OSM Bright. The OSM Bright GL Style is derived from [Mapbox Open Styles](https://github.com/mapbox/mapbox-gl-styles). The OSM Bright GL Style’s code is released under the [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)). The OSM Bright GL Style’s design is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). [LICENSE.md](https://github.com/maputnik/osm-liberty/blob/gh-pages/LICENSE.md). - -###### Positron - -Fork from [openmaptiles/positron-gl-style](https://github.com/openmaptiles/positron-gl-style). The Positron GL Style is derived from [CartoDB Basemaps](https://github.com/CartoDB/CartoDB-basemaps) designed by Stamen and Paul Norman for CartoDB Inc., licensed under [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/). The Positron GL style’s code is released under the [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)). The Positron GL Style’s design is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). [LICENSE.md](https://github.com/openmaptiles/positron-gl-style/blob/master/LICENSE.md). - -##### Fonts - -[Noto Sans](https://www.google.com/get/noto/) is released under the [SIL Open Font License, Version 1.1](https://openfontlicense.org/) - -**Icons** - -The [Maki POI icon set](https://github.com/mapbox/maki/blob/master/LICENSE.txt) is licensed under CC0 1.0 Universal. - -The right arrow was derived from [Wikipedia](https://commons.wikimedia.org/wiki/File:Arrowright.svg), it is public domain. +{licenses}