mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 14:02:15 +00:00
@@ -1,20 +0,0 @@
|
||||
<div id="map-container">
|
||||
<div id="mapbg-image">
|
||||
<div class="mapbg-attrib">
|
||||
<a href="https://openfreemap.org" target="_blank">OpenFreeMap</a>
|
||||
<a href="https://www.openmaptiles.org/" target="_blank">© OpenMapTiles</a> Data from
|
||||
<a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Choose a style:</p>
|
||||
<div class="button-container">
|
||||
<button onclick="selectStyle(event, 'positron')" class="btn">Positron</button>
|
||||
<button onclick="selectStyle(event, 'bright')" class="btn">Bright</button>
|
||||
<button onclick="selectStyle(event, 'liberty')" class="btn selected">Liberty</button>
|
||||
<button onclick="selectStyle(event, 'liberty-3d')" class="btn">3D</button>
|
||||
</div>
|
||||
|
||||
<p>Use the following style in a MapLibre map:</p>
|
||||
<pre><code class="lang-uri" id="style-url-code">https://tiles.openfreemap.org/styles/liberty</code></pre>
|
||||
@@ -1,4 +1,23 @@
|
||||
<p>How to use: <a href="#">In detail</a></p>
|
||||
<div id="map-container">
|
||||
<div id="mapbg-image">
|
||||
<div class="mapbg-attrib">
|
||||
<a href="https://openfreemap.org" target="_blank">OpenFreeMap</a>
|
||||
<a href="https://www.openmaptiles.org/" target="_blank">© OpenMapTiles</a> Data from
|
||||
<a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Choose a style:</p>
|
||||
<div class="button-container">
|
||||
<button onclick="selectStyle(event, 'positron')" class="btn">Positron</button>
|
||||
<button onclick="selectStyle(event, 'bright')" class="btn">Bright</button>
|
||||
<button onclick="selectStyle(event, 'liberty')" class="btn selected">Liberty</button>
|
||||
<button onclick="selectStyle(event, 'liberty-3d')" class="btn">3D</button>
|
||||
</div>
|
||||
|
||||
<p>Use the following style in a MapLibre map:</p>
|
||||
<pre><code class="lang-uri" id="style-url-code">https://tiles.openfreemap.org/styles/liberty</code></pre>
|
||||
|
||||
<input type="checkbox" id="col1" class="col-chk" />
|
||||
<label for="col1" class="col-lbl">How to load MapLibre?</label>
|
||||
@@ -110,3 +129,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="pricing"></div>
|
||||
@@ -14,43 +14,21 @@ def generate():
|
||||
shutil.rmtree(OUT_DIR, ignore_errors=True)
|
||||
OUT_DIR.mkdir()
|
||||
|
||||
make_index_html()
|
||||
make_howto_use()
|
||||
make_js()
|
||||
template = open('template.html').read()
|
||||
|
||||
make_static_page('privacy', 'Privacy Policy')
|
||||
make_static_page('tos', 'Terms of Services')
|
||||
|
||||
copy_assets()
|
||||
|
||||
|
||||
def make_index_html():
|
||||
template = open('template_index.html').read()
|
||||
|
||||
main_md = open('blocks/index.md').read()
|
||||
main_md = open('blocks/main.md').read()
|
||||
main_html = marko.convert(main_md)
|
||||
|
||||
template = template.replace('{body}', main_html)
|
||||
index_html = template.replace('{main}', main_html)
|
||||
|
||||
map_howto = open('blocks/map.html').read()
|
||||
template = template.replace('<!--map_howto-->', map_howto)
|
||||
map_howto = open('blocks/map_howto.html').read()
|
||||
index_html = index_html.replace('<!--map_howto-->', map_howto)
|
||||
|
||||
support_plans = open('blocks/support_plans.html').read()
|
||||
template = template.replace('<!--support_plans-->', support_plans)
|
||||
index_html = index_html.replace('<!--support_plans-->', support_plans)
|
||||
|
||||
open(OUT_DIR / 'index.html', 'w').write(template)
|
||||
open(OUT_DIR / 'index.html', 'w').write(index_html)
|
||||
|
||||
|
||||
def make_howto_use():
|
||||
template = open('template_howto_use.html').read()
|
||||
|
||||
map_howto = open('blocks/map.html').read()
|
||||
template = template.replace('<!--map_howto-->', map_howto)
|
||||
|
||||
open(OUT_DIR / 'howto_use.html', 'w').write(template)
|
||||
|
||||
|
||||
def make_js():
|
||||
pricing_json = json.load(open('assets/pricing.json'))
|
||||
support_plans_js = open('assets/support_plans.js').read()
|
||||
support_plans_js = support_plans_js.replace(
|
||||
@@ -58,6 +36,10 @@ def make_js():
|
||||
)
|
||||
open(OUT_DIR / 'support_plans.js', 'w').write(support_plans_js)
|
||||
|
||||
make_static_page('privacy', 'Privacy Policy')
|
||||
make_static_page('tos', 'Terms of Services')
|
||||
copy_assets()
|
||||
|
||||
|
||||
def copy_assets():
|
||||
for file in [
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<a href="https://x.com/hyperknot" target="_blank"><img src="x.svg" alt="x" height="28" /></a>
|
||||
</div>
|
||||
|
||||
{body}
|
||||
{main}
|
||||
|
||||
<div class="footer">
|
||||
<a href="privacy">Privacy Policy</a>
|
||||
@@ -1,38 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>How to use OpenFreeMap</title>
|
||||
<meta
|
||||
name="description"
|
||||
content="Open and free custom maps for your website and apps, based on OpenStreetMap."
|
||||
/>
|
||||
|
||||
<!-- <meta property="og:title" content="" />-->
|
||||
<!-- <meta property="og:type" content="" />-->
|
||||
<!-- <meta property="og:url" content="" />-->
|
||||
<!-- <meta property="og:image" content="" />-->
|
||||
|
||||
<!-- <link rel="icon" href="/favicon.ico" sizes="any" />-->
|
||||
|
||||
<link href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
{body}
|
||||
|
||||
<div class="footer">
|
||||
<a href="privacy">Privacy Policy</a>
|
||||
<a href="tos">Terms of Service</a>
|
||||
</div>
|
||||
|
||||
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script>
|
||||
|
||||
<script src="map_howto.js"></script>
|
||||
|
||||
<script src="https://unpkg.com/prismjs@1.29.0/components/prism-core.min.js"></script>
|
||||
<script src="https://unpkg.com/prismjs@1.29.0/plugins/autoloader/prism-autoloader.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user