From 45807e3a9033e07c8a225791526bed8aac55797b Mon Sep 17 00:00:00 2001 From: Dongho Kim Date: Mon, 15 Dec 2025 23:10:38 +0900 Subject: [PATCH] update --- Dockerfile | 1 + build.log | 266 ---- frontend/favicon.svg | 3 + frontend/index.html | 1264 ++++++++++++++- frontend/src/camera.rs | 52 + frontend/src/geo.rs | 60 + frontend/src/labels.rs | 360 +++++ frontend/src/lib.rs | 2393 ++++++---------------------- frontend/src/pipelines/building.rs | 95 ++ frontend/src/pipelines/common.rs | 71 + frontend/src/pipelines/landuse.rs | 126 ++ frontend/src/pipelines/mod.rs | 21 + frontend/src/pipelines/railway.rs | 95 ++ frontend/src/pipelines/roads.rs | 214 +++ frontend/src/pipelines/water.rs | 146 ++ frontend/src/state.rs | 48 + frontend/src/tiles.rs | 102 ++ frontend/src/types.rs | 68 + importer/src/main.rs | 309 +++- 19 files changed, 3438 insertions(+), 2256 deletions(-) delete mode 100644 build.log create mode 100644 frontend/favicon.svg create mode 100644 frontend/src/camera.rs create mode 100644 frontend/src/geo.rs create mode 100644 frontend/src/labels.rs create mode 100644 frontend/src/pipelines/building.rs create mode 100644 frontend/src/pipelines/common.rs create mode 100644 frontend/src/pipelines/landuse.rs create mode 100644 frontend/src/pipelines/mod.rs create mode 100644 frontend/src/pipelines/railway.rs create mode 100644 frontend/src/pipelines/roads.rs create mode 100644 frontend/src/pipelines/water.rs create mode 100644 frontend/src/state.rs create mode 100644 frontend/src/tiles.rs create mode 100644 frontend/src/types.rs diff --git a/Dockerfile b/Dockerfile index dcfa34c..7c2c708 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ WORKDIR /app/frontend # Build frontend RUN wasm-pack build --target web --out-name wasm --out-dir ../backend/static RUN cp index.html ../backend/static/index.html +RUN cp favicon.svg ../backend/static/favicon.svg # Build Backend FROM rust:latest AS backend-builder diff --git a/build.log b/build.log deleted file mode 100644 index 3a0254a..0000000 --- a/build.log +++ /dev/null @@ -1,266 +0,0 @@ -time="2025-11-26T11:51:45+01:00" level=warning msg="/Users/ekstrah/Desktop/git/map/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion" -#1 [internal] load local bake definitions -#1 reading from stdin 520B done -#1 DONE 0.0s - -#2 [internal] load build definition from Dockerfile -#2 transferring dockerfile: 1.41kB done -#2 WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 2) -#2 WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 13) -#2 WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 21) -#2 WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 28) -#2 WARN: FromAsCasing: 'as' and 'FROM' keywords' casing do not match (line 39) -#2 DONE 0.0s - -#3 [internal] load metadata for docker.io/library/debian:forky-slim -#3 ... - -#4 [internal] load metadata for docker.io/library/rust:latest -#4 DONE 0.6s - -#3 [internal] load metadata for docker.io/library/debian:forky-slim -#3 DONE 0.6s - -#5 [internal] load .dockerignore -#5 transferring context: 2B done -#5 DONE 0.0s - -#6 [backend 1/5] FROM docker.io/library/debian:forky-slim@sha256:7c8d9645032d8b0e0afa9f95d2cd34f7eedd2915562f5d19bf9c20dec1bf25fc -#6 resolve docker.io/library/debian:forky-slim@sha256:7c8d9645032d8b0e0afa9f95d2cd34f7eedd2915562f5d19bf9c20dec1bf25fc done -#6 DONE 0.0s - -#7 [backend 2/5] WORKDIR /app -#7 CACHED - -#8 [frontend-builder 1/7] FROM docker.io/library/rust:latest@sha256:4a29b0db5c961cd530f39276ece3eb6e66925b59599324c8c19723b72a423615 -#8 resolve docker.io/library/rust:latest@sha256:4a29b0db5c961cd530f39276ece3eb6e66925b59599324c8c19723b72a423615 0.0s done -#8 DONE 0.0s - -#9 [internal] load build context -#9 transferring context: 746B done -#9 DONE 0.0s - -#10 [frontend-builder 2/7] WORKDIR /app -#10 CACHED - -#11 [backend-builder 3/6] COPY backend ./backend -#11 CACHED - -#12 [frontend-builder 5/7] RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -#12 CACHED - -#13 [frontend-builder 3/7] COPY frontend ./frontend -#13 CACHED - -#14 [frontend-builder 4/7] COPY backend/static ./backend/static -#14 CACHED - -#15 [frontend-builder 6/7] WORKDIR /app/frontend -#15 CACHED - -#16 [frontend-builder 7/7] RUN wasm-pack build --target web --out-name wasm --out-dir ../backend/static -#16 5.805 [INFO]: Checking for the Wasm target... -#16 6.004 info: downloading component 'rust-std' for 'wasm32-unknown-unknown' -#16 6.830 info: installing component 'rust-std' for 'wasm32-unknown-unknown' -#16 8.136 [INFO]: Compiling to Wasm... -#16 8.381 Compiling unicode-ident v1.0.22 -#16 8.381 Compiling proc-macro2 v1.0.103 -#16 8.381 Compiling quote v1.0.42 -#16 8.381 Compiling wasm-bindgen-shared v0.2.105 -#16 8.381 Compiling rustversion v1.0.22 -#16 8.383 Compiling cfg-if v1.0.4 -#16 8.383 Compiling bumpalo v3.19.0 -#16 8.384 Compiling stable_deref_trait v1.2.1 -#16 8.384 Compiling once_cell v1.21.3 -#16 8.729 Compiling cfg_aliases v0.1.1 -#16 8.736 Compiling smallvec v1.15.1 -#16 8.743 Compiling writeable v0.6.2 -#16 8.760 Compiling autocfg v1.5.0 -#16 8.779 Compiling litemap v0.8.1 -#16 8.866 Compiling icu_normalizer_data v2.1.1 -#16 8.895 Compiling version_check v0.9.5 -#16 8.934 Compiling serde_core v1.0.228 -#16 9.065 Compiling icu_properties_data v2.1.1 -#16 9.134 Compiling log v0.4.28 -#16 9.159 Compiling bitflags v2.10.0 -#16 9.180 Compiling num-traits v0.2.19 -#16 9.197 Compiling parking_lot_core v0.9.12 -#16 9.251 Compiling slotmap v1.0.7 -#16 9.255 Compiling thiserror v1.0.69 -#16 9.437 Compiling unicode-width v0.1.14 -#16 9.463 Compiling scopeguard v1.2.0 -#16 9.465 Compiling hashbrown v0.16.1 -#16 9.506 Compiling serde v1.0.228 -#16 9.506 Compiling bit-vec v0.6.3 -#16 9.562 Compiling equivalent v1.0.2 -#16 9.575 Compiling termcolor v1.4.1 -#16 9.627 Compiling wasm-bindgen v0.2.105 -#16 9.636 Compiling lock_api v0.4.14 -#16 9.675 Compiling bit-set v0.5.3 -#16 9.749 Compiling codespan-reporting v0.11.1 -#16 9.764 Compiling syn v2.0.111 -#16 9.800 Compiling wgpu-hal v0.19.5 -#16 9.819 Compiling unicode-xid v0.2.6 -#16 9.947 Compiling indexmap v2.12.1 -#16 9.947 Compiling rustc-hash v1.1.0 -#16 9.969 Compiling hexf-parse v0.2.1 -#16 9.979 Compiling itoa v1.0.15 -#16 9.990 Compiling percent-encoding v2.3.2 -#16 10.03 Compiling raw-window-handle v0.6.2 -#16 10.05 Compiling form_urlencoded v1.2.2 -#16 10.08 Compiling parking_lot v0.12.5 -#16 10.13 Compiling wgpu-core v0.19.4 -#16 10.16 Compiling utf8_iter v1.0.4 -#16 10.17 Compiling serde_json v1.0.145 -#16 10.21 Compiling profiling v1.0.17 -#16 10.24 Compiling ryu v1.0.20 -#16 10.25 Compiling arrayvec v0.7.6 -#16 10.25 Compiling wgpu v0.19.4 -#16 10.29 Compiling winit v0.29.15 -#16 10.34 Compiling memchr v2.7.6 -#16 10.38 Compiling futures-core v0.3.31 -#16 10.43 Compiling either v1.15.0 -#16 10.44 Compiling futures-task v0.3.31 -#16 10.47 Compiling bytes v1.11.0 -#16 10.49 Compiling fnv v1.0.7 -#16 10.51 Compiling pin-utils v0.1.0 -#16 10.54 Compiling pin-project-lite v0.2.16 -#16 10.55 Compiling itertools v0.11.0 -#16 10.56 Compiling futures-util v0.3.31 -#16 10.58 Compiling cursor-icon v1.2.0 -#16 10.67 Compiling static_assertions v1.1.0 -#16 10.68 Compiling smol_str v0.2.2 -#16 10.69 Compiling sync_wrapper v0.1.2 -#16 10.70 Compiling tower-service v0.3.3 -#16 10.72 Compiling base64 v0.21.7 -#16 10.74 Compiling atomic-waker v1.1.2 -#16 10.89 Compiling http v0.2.12 -#16 11.32 Compiling earcutr v0.4.3 -#16 11.81 Compiling synstructure v0.13.2 -#16 11.81 Compiling wasm-bindgen-macro-support v0.2.105 -#16 12.04 Compiling zerofrom-derive v0.1.6 -#16 12.04 Compiling yoke-derive v0.8.1 -#16 12.04 Compiling zerovec-derive v0.11.2 -#16 12.04 Compiling displaydoc v0.2.5 -#16 12.04 Compiling thiserror-impl v1.0.69 -#16 12.04 Compiling serde_derive v1.0.228 -#16 12.04 Compiling bytemuck_derive v1.10.2 -#16 12.80 Compiling zerofrom v0.1.6 -#16 12.80 Compiling bytemuck v1.24.0 -#16 12.85 Compiling naga v0.19.2 -#16 12.86 Compiling yoke v0.8.1 -#16 12.94 Compiling zerovec v0.11.5 -#16 12.94 Compiling zerotrie v0.2.3 -#16 12.96 Compiling wasm-bindgen-macro v0.2.105 -#16 13.35 Compiling tinystr v0.8.2 -#16 13.35 Compiling potential_utf v0.1.4 -#16 13.39 Compiling icu_collections v2.1.1 -#16 13.42 Compiling icu_locale_core v2.1.1 -#16 13.87 Compiling js-sys v0.3.82 -#16 13.87 Compiling console_error_panic_hook v0.1.7 -#16 13.88 Compiling icu_provider v2.1.1 -#16 14.07 Compiling serde_urlencoded v0.7.1 -#16 14.17 Compiling icu_properties v2.1.1 -#16 14.17 Compiling icu_normalizer v2.1.1 -#16 15.02 Compiling idna_adapter v1.2.1 -#16 15.05 Compiling idna v1.1.0 -#16 15.21 Compiling url v2.5.7 -#16 17.02 Compiling web-sys v0.3.82 -#16 17.08 Compiling wasm-bindgen-futures v0.4.55 -#16 17.12 Compiling web-time v0.2.4 -#16 25.07 Compiling wgpu-types v0.19.2 -#16 25.07 Compiling glow v0.13.1 -#16 25.07 Compiling console_log v1.0.0 -#16 25.07 Compiling reqwest v0.11.27 -#16 31.14 Compiling frontend v0.1.0 (/app/frontend) -#16 31.21 warning: unused variable: `railways_data` -#16 31.21 --> src/lib.rs:806:33 -#16 31.21 | -#16 31.21 806 | ... let railways_data = if let Some(json) = fetch_cached(&url_railways).await { -#16 31.21 | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_railways_data` -#16 31.21 | -#16 31.21 = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default -#16 31.21 -#16 31.22 warning: value captured by `camera_uniform` is never read -#16 31.22 --> src/lib.rs:871:21 -#16 31.22 | -#16 31.22 871 | camera_uniform = camera_uniform_data; -#16 31.22 | ^^^^^^^^^^^^^^ -#16 31.22 | -#16 31.22 = help: did you mean to capture by reference instead? -#16 31.22 = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default -#16 31.22 -#16 31.22 warning: unused variable: `window_clone` -#16 31.22 --> src/lib.rs:461:9 -#16 31.22 | -#16 31.22 461 | let window_clone = window.clone(); -#16 31.22 | ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_window_clone` -#16 31.22 -#16 31.23 error[E0382]: use of moved value -#16 31.23 --> src/lib.rs:855:41 -#16 31.23 | -#16 31.23 848 | ... if let Some(railways) = railways_data { -#16 31.23 | -------- value moved here -#16 31.23 ... -#16 31.23 855 | ... if let Some(railways) = railways_data { -#16 31.23 | ^^^^^^^^ value used here after move -#16 31.23 | -#16 31.23 = note: move occurs because value has type `Vec`, which does not implement the `Copy` trait -#16 31.23 help: borrow this binding in the pattern to avoid moving the value -#16 31.23 | -#16 31.23 848 | if let Some(ref railways) = railways_data { -#16 31.23 | +++ -#16 31.23 -#16 31.24 warning: variable does not need to be mutable -#16 31.24 --> src/lib.rs:521:25 -#16 31.24 | -#16 31.24 521 | let mut cam = camera.lock().unwrap(); -#16 31.24 | ----^^^ -#16 31.24 | | -#16 31.24 | help: remove this `mut` -#16 31.24 | -#16 31.24 = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default -#16 31.24 -#16 31.27 For more information about this error, try `rustc --explain E0382`. -#16 31.27 warning: `frontend` (lib) generated 4 warnings -#16 31.27 error: could not compile `frontend` (lib) due to 1 previous error; 4 warnings emitted -#16 31.32 Error: Compiling your crate to WebAssembly failed -#16 31.32 Caused by: Compiling your crate to WebAssembly failed -#16 31.32 Caused by: failed to execute `cargo build`: exited with exit status: 101 -#16 31.32 full command: cd "/app/frontend" && "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown" -#16 ERROR: process "/bin/sh -c wasm-pack build --target web --out-name wasm --out-dir ../backend/static" did not complete successfully: exit code: 1 ------- - > [frontend-builder 7/7] RUN wasm-pack build --target web --out-name wasm --out-dir ../backend/static: -31.24 | -31.24 = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default -31.24 -31.27 For more information about this error, try `rustc --explain E0382`. -31.27 warning: `frontend` (lib) generated 4 warnings -31.27 error: could not compile `frontend` (lib) due to 1 previous error; 4 warnings emitted -31.32 Error: Compiling your crate to WebAssembly failed -31.32 Caused by: Compiling your crate to WebAssembly failed -31.32 Caused by: failed to execute `cargo build`: exited with exit status: 101 -31.32 full command: cd "/app/frontend" && "cargo" "build" "--lib" "--release" "--target" "wasm32-unknown-unknown" ------- -Dockerfile:10 - --------------------- - - 8 | WORKDIR /app/frontend - - 9 | # Build frontend - - 10 | >>> RUN wasm-pack build --target web --out-name wasm --out-dir ../backend/static - - 11 | - - 12 | # Build Backend - --------------------- - -failed to solve: process "/bin/sh -c wasm-pack build --target web --out-name wasm --out-dir ../backend/static" did not complete successfully: exit code: 1 - - - -View build details: docker-desktop://dashboard/build/default/default/ojyxf9sq9vbhjusaaq2tnqkq5 - diff --git a/frontend/favicon.svg b/frontend/favicon.svg new file mode 100644 index 0000000..8de9d36 --- /dev/null +++ b/frontend/favicon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index ee12835..6fff079 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,122 +4,440 @@ - Maps + + Maps App + + + + +
N
E
@@ -163,70 +537,747 @@ position: absolute; transform: translate(-50%, -50%); color: #333; - text-shadow: 0 0 3px white, 0 0 3px white, 0 0 3px white; - font-family: sans-serif; + /* Lighter, cleaner shadow */ + text-shadow: 0 0 2px white, 0 0 4px white; + font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; white-space: nowrap; pointer-events: none; - font-weight: 600; + font-weight: 500; + z-index: 10; } .label-country { - font-size: 16px; - font-weight: bold; + font-size: 14px; + font-weight: 600; text-transform: uppercase; letter-spacing: 1px; - color: #222; + color: #555; + opacity: 0.8; } .label-city { - font-size: 12px; + font-size: 13px; font-weight: 600; color: #333; } - /* Apple Maps-style street labels */ + /* Apple Maps-style street labels - Very Clean */ .label-street { font-size: 10px; - font-weight: 400; - color: #555; - letter-spacing: 0.3px; + font-weight: 500; + color: #6e6e73; + /* Apple Gray */ + letter-spacing: 0.2px; text-shadow: - 0 0 2px rgba(255, 255, 255, 0.9), - 0 0 4px rgba(255, 255, 255, 0.8), - 1px 1px 1px rgba(255, 255, 255, 0.95); - font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; + 0 0 2px rgba(255, 255, 255, 0.95), + 0 0 4px rgba(255, 255, 255, 0.9); } /* Apple Maps-style POI labels */ .label-poi { font-size: 11px; font-weight: 500; - color: #c44; - letter-spacing: 0.2px; - text-shadow: - 0 0 3px rgba(255, 255, 255, 0.95), - 0 0 5px rgba(255, 255, 255, 0.9), - 1px 1px 2px rgba(255, 255, 255, 1); - font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; + color: #666; + letter-spacing: 0.1px; + display: flex; + flex-direction: column; + align-items: center; + /* Icon above text */ + gap: 2px; + text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9); + } + + /* The Icon Circle */ + .label-poi::before { + content: ''; + width: 8px; + height: 8px; + border-radius: 50%; + background-color: #999; + /* Default Gray */ + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); + border: 1px solid white; + display: block; + margin-bottom: 2px; + } + + /* Specific POI Categories */ + + /* Parks - Green */ + .label-poi-park { + color: #357a38; + } + + .label-poi-park::before { + background-color: #4caf50; + } + + .label-poi-garden::before { + background-color: #4caf50; + } + + /* Restaurants/Food - Orange */ + .label-poi-restaurant { + color: #d86800; + } + + .label-poi-restaurant::before { + background-color: #ff9800; + } + + .label-poi-cafe::before { + background-color: #ff9800; + } + + /* Health - Red */ + .label-poi-hospital { + color: #c62828; + } + + .label-poi-hospital::before { + background-color: #f44336; + } + + .label-poi-pharmacy::before { + background-color: #f44336; + } + + /* Education - Gray/Purple */ + .label-poi-university { + color: #555; + } + + .label-poi-university::before { + background-color: #9e9e9e; + } + + .label-poi-school::before { + background-color: #9e9e9e; + } + + /* Stores - Purple */ + .label-poi-shop { + color: #6a1b9a; + } + + .label-poi-shop::before { + background-color: #9c27b0; + } + + /* Transport - Blue */ + .label-poi-fuel { + color: #0277bd; + } + + .label-poi-fuel::before { + background-color: #03a9f4; + } + + .label-poi-parking::before { + background-color: #03a9f4; + } + + /* Tourism - Pink/Brown */ + .label-poi-museum { + color: #ad1457; + } + + .label-poi-museum::before { + background-color: #e91e63; + } + + .label-poi-hotel { + color: #8d6e63; + } + + .label-poi-hotel::before { + background-color: #795548; + } + + /* Dark Theme Adjustments for Labels */ + [data-theme="dark"] .label { + color: #ddd; + text-shadow: 0 0 3px rgba(0, 0, 0, 0.8); + } + + [data-theme="dark"] .label-street { + color: #a1a1a6; + text-shadow: 0 0 3px rgba(0, 0, 0, 0.9); + } + + [data-theme="dark"] .label-poi { + color: #ccc; + } + + [data-theme="dark"] .label-poi::before { + border-color: rgba(255, 255, 255, 0.2); + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); } -
-
- - + +