diff --git a/frontends/frontend-dev/assets/map_maker/background-style.json b/frontends/frontend-dev/assets/lib/map_maker/background-style.json similarity index 100% rename from frontends/frontend-dev/assets/map_maker/background-style.json rename to frontends/frontend-dev/assets/lib/map_maker/background-style.json diff --git a/frontends/frontend-dev/assets/map_maker/lib/design_maker.js b/frontends/frontend-dev/assets/lib/map_maker/lib/design_maker.js similarity index 100% rename from frontends/frontend-dev/assets/map_maker/lib/design_maker.js rename to frontends/frontend-dev/assets/lib/map_maker/lib/design_maker.js diff --git a/frontends/frontend-dev/assets/map_maker/lib/maplibre_control.js b/frontends/frontend-dev/assets/lib/map_maker/lib/maplibre_control.js similarity index 100% rename from frontends/frontend-dev/assets/map_maker/lib/maplibre_control.js rename to frontends/frontend-dev/assets/lib/map_maker/lib/maplibre_control.js diff --git a/frontends/frontend-dev/assets/map_maker/lib/random_color.js b/frontends/frontend-dev/assets/lib/map_maker/lib/random_color.js similarity index 100% rename from frontends/frontend-dev/assets/map_maker/lib/random_color.js rename to frontends/frontend-dev/assets/lib/map_maker/lib/random_color.js diff --git a/frontends/frontend-dev/assets/map_maker/lib/style_maker.js b/frontends/frontend-dev/assets/lib/map_maker/lib/style_maker.js similarity index 100% rename from frontends/frontend-dev/assets/map_maker/lib/style_maker.js rename to frontends/frontend-dev/assets/lib/map_maker/lib/style_maker.js diff --git a/frontends/frontend-dev/assets/map_maker/lib/utils.js b/frontends/frontend-dev/assets/lib/map_maker/lib/utils.js similarity index 100% rename from frontends/frontend-dev/assets/map_maker/lib/utils.js rename to frontends/frontend-dev/assets/lib/map_maker/lib/utils.js diff --git a/frontends/frontend-dev/assets/map_maker/map_maker.js b/frontends/frontend-dev/assets/lib/map_maker/map_maker.js similarity index 91% rename from frontends/frontend-dev/assets/map_maker/map_maker.js rename to frontends/frontend-dev/assets/lib/map_maker/map_maker.js index 59cb725..68d3381 100644 --- a/frontends/frontend-dev/assets/map_maker/map_maker.js +++ b/frontends/frontend-dev/assets/lib/map_maker/map_maker.js @@ -2,8 +2,8 @@ import MaplibreControl from './lib/maplibre_control.js'; import StyleMaker from './lib/style_maker.js'; import { loadJSON } from './lib/utils.js'; -export default async function MapMaker(maplibregl, nodeId, meta_url) { - const info = await loadJSON(meta_url); +export default async function MapMaker(maplibregl, nodeId, url) { + const meta = await loadJSON(url + '/tiles.json'); const tiles_url = window.location.origin + info.url; const container = info.container; @@ -67,7 +67,7 @@ function addZoomLevelWarning(map, zoom_min, zoom_max) { function update() { let zoom = map.getZoom(); - let shouldBeVisible = (zoom < zoom_min) || (zoom > zoom_max+0.5); + let shouldBeVisible = (zoom < zoom_min) || (zoom > zoom_max + 0.5); if (shouldBeVisible) { let text = 'the data source is only defined for zoom level'; diff --git a/frontends/frontend-dev/assets/main.js b/frontends/frontend-dev/assets/main.js index 983bd5b..f6db7a2 100644 --- a/frontends/frontend-dev/assets/main.js +++ b/frontends/frontend-dev/assets/main.js @@ -1,5 +1,5 @@ -import MapMaker from './map_maker/map_maker.js'; +import MapMaker from './lib/map_maker/map_maker.js'; init(); @@ -12,5 +12,5 @@ async function start() { const id = (new URLSearchParams(window.location.search)).get('id'); if (!id) throw Error('id is not defined'); - await MapMaker(maplibregl, 'map', '/api/source/' + id); + await MapMaker(maplibregl, 'map', `/tiles/${id}/`); } diff --git a/frontends/frontend-dev/index.html b/frontends/frontend-dev/index.html index ce98a8a..bb284a5 100755 --- a/frontends/frontend-dev/index.html +++ b/frontends/frontend-dev/index.html @@ -11,95 +11,126 @@ body { font-family: sans-serif; margin: 20px 20px; + background-color: #0a0a0a; + color: #888; } article { - width: 400px; + width: 600px; max-width: 100%; margin: auto; box-sizing: border-box; + color: #ccc; + } + + h1, + h2, + p { + text-align: center; + margin: 0 0 1em; + } + + h1 { + font-weight: 400; + font-size: 4em; + color: #fff; + } + + h2 { + font-weight: 400; + font-size: 1.5em; } div.box { - border: 1px solid #0004; - box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.2); - border-radius: 10px; - padding: 20px; - margin-bottom: 20px; - background: #fff; + border: 1px solid #fff4; + border-radius: 3px; + padding: 1.5em; + margin: 2em 0; + background: #222; box-sizing: border-box; } + div.box:hover { + border: 1px solid #fff; + } + a { text-decoration: none !important; color: inherit !important; } - h2 { - text-align: center; - margin: 0 0 10px; - } - div.row { display: flex; flex-wrap: nowrap; - gap: 5px; + gap: 10px; opacity: 0.5; } div.row>div:first-child { - flex-basis: 30%; + flex-basis: 20%; text-align: right; font-weight: bold; } div.row>div:last-child { - flex-basis: 70%; + flex-basis: 80%; text-align: left; } - div.box:hover { - border: 1px solid #000F; - box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2); - } - div.box:hover div.row { opacity: 1; } -
- +

VersaTiles

+

available tile sources:

+