From 5afde00ab7a92d6981c39b2d21d05b3ce489bf17 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 23:22:21 -0700 Subject: [PATCH] Base-map tile pipeline and shared-canvas Leaflet viewer Extracts only the base map art from re3mr PSDs (the top-level LOCATION group), tiles it to WebP, and renders every map on one shared world canvas. Pipeline: psd_tree -> export_base -> tile -> build -> preview, driven entirely by maps.json. Adding a map is a config change. Maps are placed on an 8192px grid (tileSize * 2^maxZoom) so a cell's tile index shift is exactly cell * 2^z at every zoom. Each map keeps its own locally numbered pyramid and the browser translates on the fly, so adding a map never re-tiles the others. excludeLayers works around psd-tools rendering stroke-only vector shapes as solid fills, which otherwise buries Customs under a white fill. Co-Authored-By: Claude Opus 5 --- .claude/launch.json | 11 + .gitignore | 16 + PLAN.md | 251 ++++++++++ README.md | 75 +++ docs/adding-a-map.md | 151 ++++++ maps.json | 29 ++ server/serve.py | 74 +++ tools/build.py | 76 +++ tools/common.py | 73 +++ tools/export_base.py | 103 +++++ tools/preview.py | 63 +++ tools/psd_tree.py | 48 ++ tools/requirements.txt | 4 + tools/tile.py | 104 +++++ web/app.js | 131 ++++++ web/index.html | 24 + web/style.css | 114 +++++ web/vendor/images/layers-2x.png | Bin 0 -> 1259 bytes web/vendor/images/layers.png | Bin 0 -> 696 bytes web/vendor/images/marker-icon-2x.png | Bin 0 -> 2464 bytes web/vendor/images/marker-icon.png | Bin 0 -> 1466 bytes web/vendor/images/marker-shadow.png | Bin 0 -> 618 bytes web/vendor/leaflet.css | 661 +++++++++++++++++++++++++++ web/vendor/leaflet.js | 6 + web/vendor/leaflet.js.map | 1 + 25 files changed, 2015 insertions(+) create mode 100644 .claude/launch.json create mode 100644 .gitignore create mode 100644 PLAN.md create mode 100644 README.md create mode 100644 docs/adding-a-map.md create mode 100644 maps.json create mode 100644 server/serve.py create mode 100644 tools/build.py create mode 100644 tools/common.py create mode 100644 tools/export_base.py create mode 100644 tools/preview.py create mode 100644 tools/psd_tree.py create mode 100644 tools/requirements.txt create mode 100644 tools/tile.py create mode 100644 web/app.js create mode 100644 web/index.html create mode 100644 web/style.css create mode 100644 web/vendor/images/layers-2x.png create mode 100644 web/vendor/images/layers.png create mode 100644 web/vendor/images/marker-icon-2x.png create mode 100644 web/vendor/images/marker-icon.png create mode 100644 web/vendor/images/marker-shadow.png create mode 100644 web/vendor/leaflet.css create mode 100644 web/vendor/leaflet.js create mode 100644 web/vendor/leaflet.js.map diff --git a/.claude/launch.json b/.claude/launch.json new file mode 100644 index 0000000..028b7a6 --- /dev/null +++ b/.claude/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.0.1", + "configurations": [ + { + "name": "tarkovmap", + "runtimeExecutable": "python", + "runtimeArgs": ["server/serve.py", "8080"], + "port": 8080 + } + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba60538 --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +# Source art: hundreds of MB to >1 GB per map. Keep these on the shared +# drive, never in git. See docs/adding-a-map.md. +sources/ +*.psd +*.psb +*.7z + +# Generated by tools/build.py -- rebuildable from sources/, so not tracked. +build/ +web/tiles/ +web/data/world.json + +__pycache__/ +*.pyc +.venv/ +node_modules/ diff --git a/PLAN.md b/PLAN.md new file mode 100644 index 0000000..94d7e66 --- /dev/null +++ b/PLAN.md @@ -0,0 +1,251 @@ +# TarkovMap — Project Plan + +Self-hosted, mobile-friendly Escape from Tarkov map viewer on Leaflet. Layered +PSDs in, XYZ tile pyramid out, every map placed on one shared pannable canvas. + +**Status legend:** `[ ]` not started · `[~]` in progress · `[x]` done · `[!]` blocked +**Every stage lists `Owner`, `Depends on`, and `Done when`. Don't tick `[x]` until `Done when` is objectively true.** + +> **Revision 2 (2026-08-07)** — scope narrowed to **base map art only**; marker, +> spawn and label overlays are cut. Architecture changed from "one pyramid per +> map plus a switcher" to a **single shared world canvas** holding unrelated +> maps side by side. Phase 1 is built and running. + +--- + +## 1. Goals / Non-goals + +### Goals +- Extract **only the base map** from each PSD. No markers, spawns, extracts, captions, legends or titles. +- All maps — including ones with no geographic relationship, like Customs and its Dorms floor plans — live on **one big canvas** you pan across. +- Adding a map is a **config change**, never a code change, and never re-tiles existing maps. +- Fast on a phone over LAN. +- A flow a teammate can follow from a document without asking questions. + +### Non-goals +- Marker / spawn / extract overlays *(cut in revision 2 — see §8 backlog)*. +- Public internet hosting (licence constrains this — §3). +- Accounts, editing UI, quest tracking, live player position. + +--- + +## 2. Source audit — findings `[x]` + +Measured 2026-08-07 from the two supplied PSDs. + +| | Customs | Customs — Dorms | +| --- | --- | --- | +| PSD canvas | 7832 × 5016 | 4301 × 4904 | +| PSD size | 1.09 GB, 295 layers | 198 MB | +| Base group | `LOCATION` | `LOCATION` | +| Siblings dropped | `LEGEND`, `OVERLAYS`, `TITLE SECTION` | `OVERLAY`, `LEGEND`, `TITLE`, `Credits` | +| Extra exclusion | `Map Borders` (see §6) | none | +| Crop applied | `[0, 860, 7832, 3875]` → 7832 × 3015 | none (art fills canvas) | +| Scale | ≈ **7.39 px/m** from the scale bar | not marked | +| Render time | 158 s | 321 s | +| Tiles | 503 (8.4 MB) | 469 (1.4 MB) | + +**Both PSDs use the same top-level convention** — `LOCATION` next to `OVERLAY`, +`LEGEND`, `TITLE`. That is what makes "render one group, drop the rest" a +general rule rather than a Customs special case. Expect it to hold for other +re3mr maps; verify per map at step 1 of the runbook. + +Licence in both files: **CC BY-NC-SA 4.0**, "Made by re3mr.com". + +--- + +## 3. Constraints + +- **CC BY-NC-SA 4.0.** Attribution stays visible in the viewer; non-commercial only; derived map images inherit the licence. LAN use is fine. **Sign-off required before public hosting.** +- **Source art never enters git.** 1.09 GB + 198 MB + a 608 MB archive for one map. `.gitignore` covers `sources/`, `*.psd`, `*.7z`, `build/`, `web/tiles/`. +- Tooling on the build machine: Python 3.13, Pillow 12, psd-tools 1.18 + scikit-image, Node 22. No ImageMagick / libvips / GDAL needed. + +--- + +## 4. Architecture — as built + +| # | Decision | Notes | +| --- | --- | --- | +| A1 | Leaflet + custom `CRS.Simple`, XYZ pyramid | LatLng is `(y, x)` in world pixels at native resolution | +| A2 | **256 px tiles**, zoom 0–5, 1:1 at z5 | ~500 tiles per map; z0 is a whole-cell thumbnail | +| A3 | **WebP q82**, transparent padding on edge tiles | 9.8 MB for both maps combined | +| A4 | Chrome cropped away, not rebuilt | Scope is base art only, so there is no legend to rebuild | +| A5 | **Shared world canvas on an 8192 px grid** | See below — this is the core of revision 2 | +| A6 | `maps.json` in, `web/data/world.json` out | The app hard-codes nothing about any map | +| A7 | Dependency-free static server, long cache on tiles | Caddy/nginx drop-in later if wanted | +| A8 | Pure-Python pipeline (psd-tools + Pillow) | No native binaries to install on three machines | +| A9 | `excludeLayers` escape hatch | Needed because psd-tools fills stroke-only vector shapes | + +### The world grid (A5) + +Each map is tiled independently, numbered from its own top-left corner. A map in +grid cell `(gx, gy)` sits at world pixel `(gx · cellSize, gy · cellSize)` where + +``` +cellSize = tileSize · 2^maxZoom = 256 · 32 = 8192 +``` + +At that cell size the tile-index shift is exactly `gx · 2^z` at every zoom — +always an integer. So `getTileUrl` converts world tile coords to a map's local +ones with integer arithmetic and no resampling. + +Consequences, and the reason this design was chosen: +- Adding a map **never re-tiles another map**. +- Unrelated maps share one continuous, pannable canvas. +- A map must fit one cell (8192²). `maxZoom + 1` doubles the cell. + +Current layout: Customs `(0,0)`, Customs — Dorms `(1,0)`. + +--- + +## 5. Repository layout + +``` +maps.json the only file you edit to add or change a map +tools/ + psd_tree.py inspect a PSD's layer tree + export_base.py PSD -> build//base.png (base group only) + tile.py base.png -> web/tiles//{z}/{x}/{y}.webp + build.py orchestrator; writes web/data/world.json + preview.py stitch built tiles into one overview image + common.py config loading + world-grid maths +server/serve.py static server, LAN-reachable, cache headers +web/ index.html, app.js, style.css, vendored Leaflet 1.9.4 +docs/adding-a-map.md +sources/ build/ web/tiles/ gitignored +``` + +--- + +## 6. Known issues + +| Issue | Impact | Status | +| --- | --- | --- | +| psd-tools fills stroke-only vector `shape` layers as solid colour | Customs rendered white over the whole playable area until `Map Borders` was excluded | Worked around via `excludeLayers`; documented as a check in the runbook | +| Excluding `Map Borders` also removes the playable-area boundary outline | Customs no longer shows the dotted play-area edge; the out-of-bounds grey-out still marks it | Accepted. Revisit only if the boundary is missed | +| No retina / DPR-2 tiles | Slightly soft on high-DPI phones at 1:1 | Stage 7 | +| `flyToBounds` depends on `requestAnimationFrame` | Picker doesn't move the view in a non-compositing tab | Cosmetic; not seen in a real browser | +| Dorms has no scale bar | No px/m for that map | Fine — `pxPerMeter` is optional | + +--- + +## 7. Stages + +### Phase 1 — pipeline and viewer ✅ **complete** + +#### Stage 0 — Repo foundations `[x]` +- [x] `git init`, `.gitignore` covering sources, build output and tiles +- [x] Directory skeleton, `tools/requirements.txt` +- [x] `README.md` with quickstart +- [x] Sources moved to `sources/customs/` +- [x] Verified nothing large is tracked — 0.43 MB staged +- [ ] **Decide where master PSDs live for the team** (shared drive / NAS / Syncthing) and record the path in the README + +#### Stage 1 — Source audit `[x]` +- [x] Dimensions, layer trees, blend modes, masks for both PSDs +- [x] Identified the shared `LOCATION` convention +- [x] Derived 7.39 px/m for Customs +- [x] Confirmed CC BY-NC-SA 4.0 + +#### Stage 2 — Contracts `[x]` +- [x] `maps.json` schema — the single input contract +- [x] `web/data/world.json` — the single output contract the app reads +- [x] Tile URL scheme `tiles/{id}/{z}/{x}/{y}.webp`, XYZ, y-down +- [x] Coordinate spec: LatLng = `(y, x)` in world pixels; grid maths in `common.py` +- [x] `docs/adding-a-map.md` written as the runbook + +#### Stage 3 — Extraction `[x]` +- [x] `psd_tree.py` for onboarding inspection +- [x] `export_base.py` renders one named group, drops all siblings +- [x] `excludeLayers` escape hatch for the shape-fill bug +- [x] Warns loudly when an `excludeLayers` entry matches nothing +- [x] Both maps verified by eye — no markers, labels, legends or titles survive + +#### Stage 4 — Tiler `[x]` +- [x] Crop, Lanczos pyramid, 256 px WebP tiles, z0–z5 +- [x] Edge tiles padded to square with alpha; fully-empty tiles skipped +- [x] Rejects a map too large for its grid cell with an actionable message +- [x] `build.py` orchestrates and emits `world.json`; skips the slow render when `base.png` is current +- [x] Partial builds keep other maps in `world.json` + +#### Stage 5 — Viewer `[x]` +- [x] Vendored Leaflet 1.9.4 (no CDN — must work offline on LAN) +- [x] Custom CRS, world grid, per-map `OffsetTileLayer` with `bounds` +- [x] Map picker, URL hash state, non-dismissible attribution +- [x] Minimal dark UI, `maxNativeZoom` over-zoom, transparent `errorTileUrl` +- [x] Verified in-browser: 972 tiles, **zero 404s, zero broken tiles**, correct cross-map offsets + +#### Stage 6 — Serving `[~]` +- [x] `server/serve.py` — dependency-free, binds `0.0.0.0`, prints the LAN URL +- [x] `image/webp` MIME, tiles cached 7 days, app shell uncached +- [ ] Windows Firewall rule for the port +- [ ] Confirm from a phone on the LAN and record the URL in the README + +--- + +### Phase 2 — verification and hardening ← **next** + +#### Stage 7 — Mobile pass +`Owner:` __ · `Depends on:` 6 + +- [x] Viewport meta with `viewport-fit=cover`, safe-area insets, 44 px touch targets +- [x] Collapsible picker; zoom buttons hidden under 640 px in favour of pinch +- [ ] **Test on a real iOS Safari and a real Android Chrome over LAN** — nothing here is proven until this happens +- [ ] Check pinch, double-tap and inertial pan don't fight page scroll +- [ ] Decide on retina: one extra zoom level vs. `@2x` tiles vs. accept +- [ ] First-paint budget on LAN (target ~2 s) + +#### Stage 8 — Third map by someone else +`Owner:` __ · `Depends on:` 2 + +The real test of the runbook is a person who has not seen the pipeline. + +- [ ] Pick a third map (Factory is the fastest loop; Woods/Streets stress size) +- [ ] A teammate adds it using **only** `docs/adding-a-map.md` +- [ ] Every question they have to ask is a documentation bug — fix the doc +- [ ] Confirm the `LOCATION` convention holds; if it doesn't, note the variant +- [ ] Confirm no map needs more than one grid cell + +#### Stage 9 — Grid ergonomics +`Owner:` __ · `Depends on:` 8 + +- [ ] Decide grid layout policy as map count grows (`gridCols` is currently 4) +- [ ] Consider labelling each map on the canvas at low zoom, so the overview is readable +- [ ] Consider per-map `maxBounds` snapping so panning between maps feels deliberate + +--- + +### Phase 3 — backlog (only if wanted) + +- [ ] Measure tool using `pxPerMeter` (Customs has it; Dorms doesn't) +- [ ] PWA / offline tile caching for phones that leave the LAN +- [ ] PMTiles single-file archives instead of loose tiles — revisit around 5+ maps +- [ ] Marker/overlay layers — **cut in revision 2.** The PSDs make this cheap to revive: every marker is its own layer with a known bbox, so positions can be extracted programmatically rather than hand-placed +- [ ] Restore the Customs playable-area boundary, if its absence turns out to matter + +--- + +## 8. Parallelisation + +Phase 1 is done, so the tracks are narrower now: + +| Track | Stages | Skills | +| --- | --- | --- | +| **Mobile / frontend** | 7 | JS, Leaflet, touch CSS, real devices | +| **Content** | 8 | Photoshop-adjacent; mostly following the runbook | +| **Ops** | 6 tail | Windows networking, firewall | + +Stages 7 and 8 are fully independent — run them in parallel. + +--- + +## 9. Open questions + +1. Where do master PSDs live so every contributor can reach them? *(blocks Stage 0's last item)* +2. Which maps next, and in what order? +3. Is public hosting ever intended? Changes the licence conversation entirely. +4. Does the missing Customs play-area boundary matter enough to restore? + +--- + +*Last updated: 2026-08-07 · Phase 1 complete and verified; Phase 2 next.* diff --git a/README.md b/README.md new file mode 100644 index 0000000..d7bc959 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# TarkovMap + +Self-hosted, mobile-friendly Escape from Tarkov map viewer. Layered PSDs go in, +a Leaflet tile pyramid comes out, and every map — related or not — sits side by +side on one shared canvas you can pan across. + +Only the **base map art** is extracted. Markers, spawns, legends, captions and +titles are dropped during the render. + +## Quickstart + +```bash +python -m pip install -r tools/requirements.txt +``` + +```bash +python tools/build.py +``` + +```bash +python server/serve.py +``` + +Open the printed URL. The LAN address works from a phone on the same network. + +Source PSDs are not in the repo (see `.gitignore`) — get them from the shared +drive and put them under `sources/`. + +## Adding a map + +See **[docs/adding-a-map.md](docs/adding-a-map.md)**. Short version: run +`tools/psd_tree.py` to find the group holding the art, add an entry to +`maps.json`, run `tools/build.py`. No application code changes. + +## Layout + +``` +maps.json the only thing you edit to add or change a map +tools/ + psd_tree.py inspect a PSD's layer tree + export_base.py PSD -> build//base.png (base group only) + tile.py base.png -> web/tiles//{z}/{x}/{y}.webp + build.py orchestrator; also writes web/data/world.json + preview.py stitch built tiles into one overview image + common.py config loading + the world-grid maths +server/serve.py dependency-free static server with sane cache headers +web/ the site: index.html, app.js, style.css, vendored Leaflet +sources/ gitignored — source PSDs +build/ gitignored — intermediate PNGs +web/tiles/ gitignored — generated tiles +``` + +## How the shared canvas works + +Maps are placed on a grid of 8192 × 8192 px cells (`tileSize · 2^maxZoom`). At +that cell size, a map's tile indices shift into world coordinates by exactly +`cell · 2^z` at every zoom — always an integer. So each map keeps its own +locally numbered pyramid, the browser translates on the fly, and **adding a map +never re-tiles the others**. + +A map must fit in one cell. Raising `maxZoom` in `maps.json` doubles the cell. + +## Current maps + +| Map | Source size | Tiled | Tiles | +| --- | --- | --- | --- | +| Customs | 7832 × 5016 | 7832 × 3015 | 503 (8.4 MB) | +| Customs — Dorms | 4301 × 4904 | 4301 × 4904 | 469 (1.4 MB) | + +## Licence + +Map art is by [re3mr.com](https://re3mr.com) under +**CC BY-NC-SA 4.0**. Attribution is shown in the viewer and must stay there. +Use is non-commercial, and derivative map images inherit the same licence. +Local and LAN hosting is fine; get sign-off before hosting publicly. diff --git a/docs/adding-a-map.md b/docs/adding-a-map.md new file mode 100644 index 0000000..94a635f --- /dev/null +++ b/docs/adding-a-map.md @@ -0,0 +1,151 @@ +# Adding a map + +The whole job is: point the config at a PSD, name the group that holds the map +art, pick a grid cell, build. Everything else is automatic. + +Budget ~10 minutes plus render time (roughly 3 minutes per GB of PSD). + +--- + +## 0. Once per machine + +```bash +python -m pip install -r tools/requirements.txt +``` + +Put the PSD under `sources//`. That directory is gitignored — source art +lives on the shared drive, never in the repo. + +--- + +## 1. Look at the layer tree + +```bash +python tools/psd_tree.py sources/customs/customs.psd +``` + +You are answering two questions. + +**Which top-level group holds the map art?** On every re3mr map so far it is +`LOCATION`, sitting next to `OVERLAY`/`OVERLAYS`, `LEGEND` and `TITLE`. Only the +group you name gets rendered, so markers, legends, captions and titles are +dropped by construction — you never have to hide them one by one. + +**Are there `shape` layers inside it?** Note their names. psd-tools renders a +stroke-only vector shape as a *solid fill*, which can bury the entire map under +one flat colour. These go in `excludeLayers` at step 3. + +--- + +## 2. Add it to `maps.json` + +```json +{ + "id": "factory", + "name": "Factory", + "psd": "sources/factory/factory.psd", + "baseGroup": "LOCATION", + "excludeLayers": [], + "crop": null, + "cell": [2, 0] +} +``` + +| Field | Meaning | +| --- | --- | +| `id` | URL-safe; becomes `web/tiles//` | +| `baseGroup` | the group from step 1 | +| `excludeLayers` | layer names to hide anywhere inside `baseGroup` | +| `crop` | `[x0, y0, x1, y1]` in PSD pixels, or `null` for the full canvas | +| `cell` | `[col, row]` on the world grid — omit it and the next free cell is used | +| `pxPerMeter` | optional, from the map's scale bar; recorded for later use | + +A map must fit inside one grid cell: **8192 × 8192 px** at the default +`maxZoom: 5`. The build fails with a clear message if it doesn't; raising +`maxZoom` by one doubles the cell. + +--- + +## 3. Render the base layer and check it + +```bash +python tools/export_base.py factory +``` + +Open `build/factory/base.png` and actually look at it. You are checking for: + +- **large flat areas of solid colour** — a shape layer is filling. Add its name + to `excludeLayers` and re-run. (Customs needs `"Map Borders"` for exactly + this reason; without it the whole playable area renders white.) +- **leftover markers or text** — you named the wrong group, or the art has + markers nested inside the base group. +- **how much dead canvas surrounds the art** — that sets your `crop`. + +Re-run after any `maps.json` change; `export_base.py` always re-renders. + +--- + +## 4. Set the crop + +Read the pixel bounds of the real map art off `base.png` and put them in +`crop`. Customs uses `[0, 860, 7832, 3875]` — the PSD reserves the top ~860 px +for the title bar and everything below y=3875 for the legend, and tiling that +empty space just makes the map awkward to pan. + +If the art fills the canvas, leave `crop: null`. + +--- + +## 5. Build and verify + +```bash +python tools/build.py factory # export if stale, then tile, then manifest +python tools/preview.py 3 # stitch every map into one overview +``` + +`build/world-preview.png` shows all maps at their world positions. Confirm the +new one landed in the cell you intended and doesn't collide with a neighbour. + +Then: + +```bash +python server/serve.py +``` + +and open the printed URL. + +--- + +## Useful variations + +```bash +python tools/build.py # every map +python tools/build.py --tiles-only # re-tile after a crop change, skip the slow render +python tools/build.py --force-export # re-render even if base.png looks current +``` + +`build.py` skips the PSD render when `base.png` is newer than the PSD, so +iterating on `crop` is fast — that loop is seconds, not minutes. + +Rebuilding one map never touches another map's tiles, and `world.json` keeps +entries for maps that weren't part of this run. + +--- + +## Why the grid works + +Every map is tiled independently, numbered from its own top-left corner. The +world places a map in grid cell `(gx, gy)` at world pixel +`(gx · cellSize, gy · cellSize)`, where + +``` +cellSize = tileSize · 2^maxZoom = 256 · 32 = 8192 +``` + +At that cell size the tile-index shift for a cell is exactly `gx · 2^z` at +every zoom level — always a whole number. So the browser can translate world +tile coordinates into a map's local ones with integer arithmetic and no +resampling (`getTileUrl` in `web/app.js`). + +That is what lets you add a map without re-tiling any other map, and what keeps +unrelated maps sharing one continuous canvas. diff --git a/maps.json b/maps.json new file mode 100644 index 0000000..a22e6e1 --- /dev/null +++ b/maps.json @@ -0,0 +1,29 @@ +{ + "$comment": "Single source of truth for the whole build. See docs/adding-a-map.md.", + + "tileSize": 256, + "maxZoom": 5, + "gridCols": 4, + "attribution": "Maps by re3mr.com · CC BY-NC-SA 4.0", + + "maps": [ + { + "id": "customs", + "name": "Customs", + "psd": "sources/customs/customs.psd", + "baseGroup": "LOCATION", + "excludeLayers": ["Map Borders"], + "crop": [0, 860, 7832, 3875], + "pxPerMeter": 7.39, + "cell": [0, 0] + }, + { + "id": "customs-dorms", + "name": "Customs — Dorms", + "psd": "sources/customs/customs-dorms.psd", + "baseGroup": "LOCATION", + "crop": null, + "cell": [1, 0] + } + ] +} diff --git a/server/serve.py b/server/serve.py new file mode 100644 index 0000000..4e04f4d --- /dev/null +++ b/server/serve.py @@ -0,0 +1,74 @@ +"""Static server for web/, reachable from other devices on the LAN. + + python server/serve.py [port] # default 8080 + +Deliberately dependency-free. Tiles are immutable once built, so they get a +long cache lifetime while the app shell stays uncached -- that is the whole +difference between a snappy second visit and re-downloading every tile. + +For heavier use put Caddy or nginx in front of web/ instead; nothing here is +special. +""" + +from __future__ import annotations + +import functools +import http.server +import socket +import socketserver +import sys +from pathlib import Path + +WEB = Path(__file__).resolve().parent.parent / "web" + + +class Handler(http.server.SimpleHTTPRequestHandler): + extensions_map = {**http.server.SimpleHTTPRequestHandler.extensions_map, + ".webp": "image/webp"} + + def end_headers(self): + if "/tiles/" in self.path: + self.send_header("Cache-Control", "public, max-age=604800") + else: + self.send_header("Cache-Control", "no-cache") + super().end_headers() + + def log_message(self, fmt, *args): + pass # one line per tile is unreadable + + +class Server(socketserver.ThreadingTCPServer): + allow_reuse_address = True + daemon_threads = True + + +def lan_ip() -> str: + s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + try: + s.connect(("10.255.255.255", 1)) # no packets sent; just picks the route + return s.getsockname()[0] + except OSError: + return "127.0.0.1" + finally: + s.close() + + +def main() -> None: + if not (WEB / "data" / "world.json").exists(): + print("warning: web/data/world.json missing -- run tools/build.py first\n") + + port = int(sys.argv[1]) if len(sys.argv) > 1 else 8080 + handler = functools.partial(Handler, directory=str(WEB)) + with Server(("0.0.0.0", port), handler) as httpd: + print(f"serving {WEB}") + print(f" local http://localhost:{port}/") + print(f" LAN http://{lan_ip()}:{port}/") + print("\nCtrl+C to stop") + try: + httpd.serve_forever() + except KeyboardInterrupt: + print("\nstopped") + + +if __name__ == "__main__": + main() diff --git a/tools/build.py b/tools/build.py new file mode 100644 index 0000000..c02ba78 --- /dev/null +++ b/tools/build.py @@ -0,0 +1,76 @@ +"""Orchestrator: maps.json -> tiles + web/data/world.json. + + python tools/build.py # export (if needed) + tile everything + python tools/build.py customs # just one map + python tools/build.py --tiles-only # skip the slow PSD render + python tools/build.py --force-export # re-render even if base.png exists + +Exporting a 1 GB PSD takes minutes, so base.png is reused unless it is older +than the PSD or --force-export is given. +""" + +from __future__ import annotations + +import json +import sys + +import export_base +import tile +from common import BUILD, DATA, ROOT, load_config + + +def needs_export(m: dict, force: bool) -> bool: + base = BUILD / m["id"] / "base.png" + if force or not base.exists(): + return True + psd = ROOT / m["psd"] + return psd.exists() and psd.stat().st_mtime > base.stat().st_mtime + + +def main(argv: list[str]) -> None: + tiles_only = "--tiles-only" in argv + force = "--force-export" in argv + ids = [a for a in argv if not a.startswith("--")] + + cfg = load_config() + targets = [m for m in cfg.maps if m["id"] in ids] if ids else cfg.maps + if ids and len(targets) != len(ids): + raise SystemExit(f"unknown map id in {ids}") + + if not tiles_only: + for m in targets: + if needs_export(m, force): + export_base.export(m) + else: + print(f"[{m['id']}] base.png up to date, skipping export " + f"(--force-export to redo)") + + entries = [tile.tile_map(cfg, m) for m in targets] + + # The world manifest always describes every configured map, not just the + # ones rebuilt this run, so partial builds don't drop maps from the site. + by_id = {e["id"]: e for e in entries} + world_path = DATA / "world.json" + if world_path.exists(): + for e in json.loads(world_path.read_text(encoding="utf-8")).get("maps", []): + by_id.setdefault(e["id"], e) + + known = {m["id"] for m in cfg.maps} + maps = sorted((e for e in by_id.values() if e["id"] in known), + key=lambda e: (e["cell"][1], e["cell"][0])) + + world = { + "tileSize": cfg.tile_size, + "maxZoom": cfg.max_zoom, + "cellSize": cfg.cell_size, + "gridCols": cfg.grid_cols, + "attribution": cfg.attribution, + "maps": maps, + } + DATA.mkdir(parents=True, exist_ok=True) + world_path.write_text(json.dumps(world, indent=2, ensure_ascii=False), encoding="utf-8") + print(f"\nwrote {world_path.relative_to(ROOT)} with {len(maps)} map(s)") + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/tools/common.py b/tools/common.py new file mode 100644 index 0000000..385f3f4 --- /dev/null +++ b/tools/common.py @@ -0,0 +1,73 @@ +"""Shared helpers: config loading and the world-grid maths. + +The whole project rests on one idea: every map is tiled independently, but all +maps share a single world coordinate space so they can sit side by side on one +big canvas. + +That works because placements are snapped to a grid of `cellSize` world pixels, +where + + cellSize = tileSize * 2 ** maxZoom + +At that cell size, a map parked in grid cell (gx, gy) has a tile-index offset of +exactly `gx * 2**z` / `gy * 2**z` at every zoom level z -- always a whole number. +So a map's own tile pyramid, numbered from its own top-left corner, drops into +the world grid with no resampling and no re-tiling of its neighbours. + +Adding a map therefore never touches the tiles of any other map. +""" + +from __future__ import annotations + +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent +CONFIG = ROOT / "maps.json" +BUILD = ROOT / "build" +TILES = ROOT / "web" / "tiles" +DATA = ROOT / "web" / "data" + + +class Config: + def __init__(self, raw: dict): + self.tile_size: int = raw.get("tileSize", 256) + self.max_zoom: int = raw.get("maxZoom", 5) + self.grid_cols: int = raw.get("gridCols", 4) + self.attribution: str = raw.get("attribution", "") + self.maps: list[dict] = raw["maps"] + + @property + def cell_size(self) -> int: + """World pixels per grid cell. Also the largest map we can hold.""" + return self.tile_size * 2**self.max_zoom + + def assign_cells(self) -> None: + """Fill in any missing `cell` by walking the grid left-to-right.""" + taken = {tuple(m["cell"]) for m in self.maps if m.get("cell")} + cursor = 0 + for m in self.maps: + if m.get("cell"): + continue + while (cursor % self.grid_cols, cursor // self.grid_cols) in taken: + cursor += 1 + cell = (cursor % self.grid_cols, cursor // self.grid_cols) + m["cell"] = list(cell) + taken.add(cell) + + def origin(self, m: dict) -> tuple[int, int]: + gx, gy = m["cell"] + return gx * self.cell_size, gy * self.cell_size + + +def load_config() -> Config: + cfg = Config(json.loads(CONFIG.read_text(encoding="utf-8"))) + cfg.assign_cells() + return cfg + + +def find_map(cfg: Config, map_id: str) -> dict: + for m in cfg.maps: + if m["id"] == map_id: + return m + raise SystemExit(f"no map with id {map_id!r} in maps.json") diff --git a/tools/export_base.py b/tools/export_base.py new file mode 100644 index 0000000..50b8c14 --- /dev/null +++ b/tools/export_base.py @@ -0,0 +1,103 @@ +"""PSD -> flat base-map PNG. + +Renders exactly one top-level group (`baseGroup` in maps.json, "LOCATION" for +every re3mr map so far) and discards everything else, so no markers, legend, +title or captions survive into the tiles. + +Individual layers inside that group can be suppressed via `excludeLayers`. +That exists because psd-tools renders stroke-only vector shapes as solid +fills -- Customs' "Map Borders" group paints the whole playable area white +if it is left in. Run psd_tree.py and eyeball the output when onboarding a +new map. + + python tools/export_base.py # every map + python tools/export_base.py customs # one map + +Output: build//base.png (full PSD canvas, uncropped -- tile.py crops) +""" + +from __future__ import annotations + +import sys +import time + +from PIL import Image +from psd_tools import PSDImage + +from common import BUILD, ROOT, find_map, load_config + +Image.MAX_IMAGE_PIXELS = None + + +def hide(group, names: list[str], map_id: str) -> None: + """Hide every descendant layer whose name matches one in `names`.""" + remaining = set(names) + + def walk(node): + for layer in node: + if layer.name in remaining: + layer.visible = False + print(f"[{map_id}] excluding {layer.name!r}") + elif layer.is_group(): + walk(layer) + + walk(group) + # A name that matches nothing is almost always a typo, and it fails + # silently into a bad render, so say so loudly. + found = set() + + def collect(node): + for layer in node: + found.add(layer.name) + if layer.is_group(): + collect(layer) + + collect(group) + for missing in remaining - found: + print(f"[{map_id}] WARNING: excludeLayers entry {missing!r} matched nothing") + + +def export(m: dict) -> None: + psd_path = ROOT / m["psd"] + if not psd_path.exists(): + raise SystemExit(f"missing source PSD: {psd_path}") + + out = BUILD / m["id"] / "base.png" + out.parent.mkdir(parents=True, exist_ok=True) + + print(f"[{m['id']}] opening {psd_path.name} ({psd_path.stat().st_size / 1e6:.0f} MB)") + t0 = time.time() + psd = PSDImage.open(psd_path) + + wanted = m.get("baseGroup", "LOCATION") + group = next((l for l in psd if l.name == wanted), None) + if group is None: + names = ", ".join(repr(l.name) for l in psd) + raise SystemExit(f"[{m['id']}] no top-level layer named {wanted!r}. Found: {names}") + + dropped = [l.name for l in psd if l.name != wanted and l.visible] + print(f"[{m['id']}] canvas {psd.size[0]}x{psd.size[1]}, rendering {wanted!r}") + print(f"[{m['id']}] dropping: {', '.join(repr(n) for n in dropped) or '(nothing)'}") + + if m.get("excludeLayers"): + hide(group, m["excludeLayers"], m["id"]) + + # viewport pins the result to the full canvas so every map's export shares + # the PSD's own coordinate system -- crops in maps.json stay meaningful. + img = group.composite(viewport=psd.viewbox, force=True) + img = img.convert("RGB") + + img.save(out, "PNG", optimize=False, compress_level=1) + print(f"[{m['id']}] wrote {out.relative_to(ROOT)} " + f"{img.size[0]}x{img.size[1]} in {time.time() - t0:.0f}s\n") + + +def main(argv: list[str]) -> None: + cfg = load_config() + targets = [find_map(cfg, i) for i in argv] if argv else cfg.maps + for m in targets: + export(m) + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/tools/preview.py b/tools/preview.py new file mode 100644 index 0000000..400cc5e --- /dev/null +++ b/tools/preview.py @@ -0,0 +1,63 @@ +"""Stitch built tiles into one overview PNG -- a layout sanity check. + + python tools/preview.py [zoom] # default 3 + +Writes build/world-preview.png showing every map at its world position, so you +can confirm a newly added map landed in the grid cell you meant before opening +a browser. +""" + +from __future__ import annotations + +import json +import sys + +from PIL import Image + +from common import BUILD, DATA, ROOT, TILES + +Image.MAX_IMAGE_PIXELS = None + + +def main() -> None: + z = int(sys.argv[1]) if len(sys.argv) > 1 else 3 + world_path = DATA / "world.json" + if not world_path.exists(): + raise SystemExit("web/data/world.json missing -- run tools/build.py first") + world = json.loads(world_path.read_text(encoding="utf-8")) + + ts, zmax = world["tileSize"], world["maxZoom"] + if not 0 <= z <= zmax: + raise SystemExit(f"zoom must be 0..{zmax}") + scale = 2.0 ** (z - zmax) + + def at(v: float) -> int: + return round(v * scale) + + width = max(at(m["origin"][0] + m["size"][0]) for m in world["maps"]) + height = max(at(m["origin"][1] + m["size"][1]) for m in world["maps"]) + canvas = Image.new("RGB", (width, height), (20, 22, 26)) + + for m in world["maps"]: + gx, gy = m["cell"] + ox, oy = at(m["origin"][0]), at(m["origin"][1]) + tdir = TILES / m["id"] / str(z) + if not tdir.exists(): + print(f" {m['id']}: no tiles at z{z}, skipped") + continue + n = 0 + for col in tdir.iterdir(): + for tile in col.glob("*.webp"): + lx, ly = int(col.name), int(tile.stem) + canvas.paste(Image.open(tile).convert("RGB"), + (ox + lx * ts, oy + ly * ts)) + n += 1 + print(f" {m['id']:<16} cell {gx},{gy} world {ox},{oy} {n} tiles") + + out = BUILD / "world-preview.png" + canvas.save(out) + print(f"\nwrote {out.relative_to(ROOT)} {width}x{height} (zoom {z})") + + +if __name__ == "__main__": + main() diff --git a/tools/psd_tree.py b/tools/psd_tree.py new file mode 100644 index 0000000..2eac695 --- /dev/null +++ b/tools/psd_tree.py @@ -0,0 +1,48 @@ +"""Print a PSD's layer tree. Run this first when onboarding a new map. + + python tools/psd_tree.py sources/customs/customs.psd + python tools/psd_tree.py sources/customs/customs.psd --depth 3 + +You are looking for two things: + 1. the name of the top-level group holding the map art -> `baseGroup` + 2. any `shape` layers inside it -> likely `excludeLayers` candidates, + because psd-tools fills stroke-only vector shapes as solid colour. + +Legend: [V] visible [.] hidden +""" + +from __future__ import annotations + +import sys +from pathlib import Path + +from psd_tools import PSDImage + + +def walk(node, depth: int, limit: int) -> None: + for layer in node: + flag = "V" if layer.visible else "." + pad = " " * depth + print(f"{pad}[{flag}] {layer.kind:<11} {layer.name[:44]!r:<46} " + f"blend={layer.blend_mode.name.lower():<12} bbox={layer.bbox}") + if layer.is_group() and depth < limit: + walk(layer, depth + 1, limit) + + +def main() -> None: + args = [a for a in sys.argv[1:] if not a.startswith("--")] + if not args: + raise SystemExit(__doc__) + + limit = 2 + if "--depth" in sys.argv: + limit = int(sys.argv[sys.argv.index("--depth") + 1]) + + path = Path(args[0]) + psd = PSDImage.open(path) + print(f"{path.name}: {psd.size[0]}x{psd.size[1]}, {psd.depth}-bit\n") + walk(psd, 0, limit) + + +if __name__ == "__main__": + main() diff --git a/tools/requirements.txt b/tools/requirements.txt new file mode 100644 index 0000000..234a48c --- /dev/null +++ b/tools/requirements.txt @@ -0,0 +1,4 @@ +# psd-tools needs the [composite] extra: without scikit-image it raises +# ImportError on any layer that carries a stroke or other layer effect. +psd-tools[composite]>=1.18 +Pillow>=11 diff --git a/tools/tile.py b/tools/tile.py new file mode 100644 index 0000000..6e6334d --- /dev/null +++ b/tools/tile.py @@ -0,0 +1,104 @@ +"""Flat PNG -> XYZ tile pyramid. + + python tools/tile.py # every map + python tools/tile.py customs # one map + +Reads build//base.png +Writes web/tiles//{z}/{x}/{y}.webp (z = 0 .. maxZoom, 1:1 at maxZoom) + +Tile indices are local to the map's own top-left corner. The web app shifts +them into world space -- see common.py for why that shift is always exact. +""" + +from __future__ import annotations + +import math +import shutil +import sys +import time + +from PIL import Image + +from common import BUILD, ROOT, TILES, Config, find_map, load_config + +Image.MAX_IMAGE_PIXELS = None + +WEBP = {"format": "WEBP", "quality": 82, "method": 4} + + +def tile_map(cfg: Config, m: dict) -> dict: + src = BUILD / m["id"] / "base.png" + if not src.exists(): + raise SystemExit(f"[{m['id']}] {src.relative_to(ROOT)} missing -- run export_base.py first") + + t0 = time.time() + img = Image.open(src).convert("RGB") + + if m.get("crop"): + x0, y0, x1, y1 = m["crop"] + img = img.crop((x0, y0, x1, y1)) + w, h = img.size + + cell = cfg.cell_size + if w > cell or h > cell: + raise SystemExit( + f"[{m['id']}] cropped size {w}x{h} exceeds the {cell}px grid cell. " + f"Raise maxZoom in maps.json (each +1 doubles the cell)." + ) + + out = TILES / m["id"] + if out.exists(): + shutil.rmtree(out) + + ts = cfg.tile_size + written = skipped = 0 + + for z in range(cfg.max_zoom, -1, -1): + scale = 2.0 ** (z - cfg.max_zoom) + zw, zh = max(1, round(w * scale)), max(1, round(h * scale)) + level = img if z == cfg.max_zoom else img.resize((zw, zh), Image.LANCZOS) + + for ty in range(math.ceil(zh / ts)): + for tx in range(math.ceil(zw / ts)): + box = (tx * ts, ty * ts, min((tx + 1) * ts, zw), min((ty + 1) * ts, zh)) + piece = level.crop(box) + + if piece.size == (ts, ts): + tile = piece # interior tile, stays opaque RGB + else: + # Edge tile: pad to a full square with transparency rather + # than letting the browser stretch a short tile. + tile = Image.new("RGBA", (ts, ts), (0, 0, 0, 0)) + tile.paste(piece, (0, 0)) + if not tile.getbbox(): + skipped += 1 + continue + + dst = out / str(z) / str(tx) + dst.mkdir(parents=True, exist_ok=True) + tile.save(dst / f"{ty}.webp", **WEBP) + written += 1 + + size_mb = sum(f.stat().st_size for f in out.rglob("*.webp")) / 1e6 + print(f"[{m['id']}] {w}x{h} -> {written} tiles ({skipped} empty skipped), " + f"{size_mb:.1f} MB, {time.time() - t0:.0f}s") + + ox, oy = cfg.origin(m) + return { + "id": m["id"], + "name": m["name"], + "cell": m["cell"], + "origin": [ox, oy], + "size": [w, h], + "pxPerMeter": m.get("pxPerMeter"), + } + + +def main(argv: list[str]) -> list[dict]: + cfg = load_config() + targets = [find_map(cfg, i) for i in argv] if argv else cfg.maps + return [tile_map(cfg, m) for m in targets] + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/web/app.js b/web/app.js new file mode 100644 index 0000000..9baa5dd --- /dev/null +++ b/web/app.js @@ -0,0 +1,131 @@ +/* Tarkov Maps -- every map on one shared canvas. + * + * Coordinates: LatLng is (y, x) in *world pixels* at native resolution. + * A map placed in grid cell (gx, gy) occupies the world rectangle + * [gx*cellSize, gy*cellSize] .. [+width, +height]. Because cellSize is + * tileSize * 2**maxZoom, the tile-index shift for a cell is exactly + * cell * 2**z at every zoom -- so each map keeps its own locally numbered + * pyramid and we translate on the way out in getTileUrl(). + */ + +const ZOOM_HEADROOM = 2; // how far past 1:1 the user may zoom +const BLANK = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; + +const OffsetTileLayer = L.TileLayer.extend({ + getTileUrl(coords) { + const n = 2 ** coords.z; + return L.Util.template(this._url, { + z: coords.z, + x: coords.x - this.options.cell[0] * n, + y: coords.y - this.options.cell[1] * n, + }); + }, +}); + +const rectOf = (m) => L.latLngBounds( + [m.origin[1], m.origin[0]], + [m.origin[1] + m.size[1], m.origin[0] + m.size[0]], +); + +function readHash() { + const p = location.hash.replace(/^#/, '').split('/'); + if (p.length !== 3) return null; + const [z, y, x] = p.map(Number); + return [z, y, x].every(Number.isFinite) ? { z, y, x } : null; +} + +async function main() { + const world = await fetch('data/world.json', { cache: 'no-cache' }).then((r) => { + if (!r.ok) throw new Error(`world.json: ${r.status}`); + return r.json(); + }); + + if (!world.maps.length) throw new Error('world.json contains no maps'); + + const ZMAX = world.maxZoom; + + // CRS where one LatLng unit == one source pixel at zoom ZMAX, y pointing + // down so world coordinates read the same way as image coordinates. + const CRS = L.extend({}, L.CRS.Simple, { + transformation: new L.Transformation(1, 0, 1, 0), + scale: (z) => 2 ** (z - ZMAX), + zoom: (s) => Math.log(s) / Math.LN2 + ZMAX, + }); + + const extent = world.maps.reduce( + (acc, m) => (acc ? acc.extend(rectOf(m)) : rectOf(m)), null, + ); + + const map = L.map('map', { + crs: CRS, + minZoom: 0, + maxZoom: ZMAX + ZOOM_HEADROOM, + zoomSnap: 0.25, + zoomDelta: 0.5, + wheelPxPerZoomLevel: 90, + maxBounds: extent.pad(0.08), + maxBoundsViscosity: 0.75, + attributionControl: false, + }); + + L.control.attribution({ prefix: false }) + .addAttribution(world.attribution) + .addTo(map); + + for (const m of world.maps) { + new OffsetTileLayer(`tiles/${m.id}/{z}/{x}/{y}.webp`, { + cell: m.cell, + bounds: rectOf(m), + tileSize: world.tileSize, + minZoom: 0, + maxZoom: ZMAX + ZOOM_HEADROOM, + maxNativeZoom: ZMAX, + noWrap: true, + keepBuffer: 2, + updateWhenIdle: false, + errorTileUrl: BLANK, + }).addTo(map); + } + + // --- picker ----------------------------------------------------------- + const list = document.getElementById('maplist'); + const buttons = world.maps.map((m) => { + const b = document.createElement('button'); + b.textContent = m.name; + b.dataset.id = m.id; + b.addEventListener('click', () => { + map.flyToBounds(rectOf(m), { padding: [20, 20], duration: 0.6 }); + if (window.matchMedia('(max-width: 640px)').matches) { + document.getElementById('panel').open = false; + } + }); + list.appendChild(b); + return b; + }); + + const syncUI = () => { + const c = map.getCenter(); + const active = world.maps.find((m) => rectOf(m).contains(c)); + buttons.forEach((b) => b.setAttribute('aria-current', String(active?.id === b.dataset.id))); + + const z = Math.round(map.getZoom() * 4) / 4; + history.replaceState(null, '', `#${z}/${Math.round(c.lat)}/${Math.round(c.lng)}`); + }; + map.on('moveend zoomend', syncUI); + + // --- initial view ----------------------------------------------------- + const h = readHash(); + if (h) map.setView([h.y, h.x], h.z); + else map.fitBounds(rectOf(world.maps[0]), { padding: [20, 20] }); + + syncUI(); + document.getElementById('boot').remove(); + + window.tarkovMap = map; // handy from the console when checking a new map + window.tarkovWorld = world; +} + +main().catch((err) => { + document.getElementById('boot').textContent = `Failed to load: ${err.message}`; + console.error(err); +}); diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..e0c8e26 --- /dev/null +++ b/web/index.html @@ -0,0 +1,24 @@ + + + + + +Tarkov Maps + + + + + +
+ +
+ Maps + +
+ +
Loading…
+ + + + + diff --git a/web/style.css b/web/style.css new file mode 100644 index 0000000..ee0a5e6 --- /dev/null +++ b/web/style.css @@ -0,0 +1,114 @@ +:root { + --bg: #14161a; + --panel: #1e2229ee; + --line: #333a44; + --text: #e6e8ec; + --muted: #9aa3b0; + --accent: #7fc4a0; +} + +* { box-sizing: border-box; } + +html, body { + margin: 0; + height: 100%; + background: var(--bg); + color: var(--text); + font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; + overscroll-behavior: none; +} + +#map { + position: absolute; + inset: 0; + background: var(--bg); +} + +#boot { + position: absolute; + inset: 0; + display: grid; + place-items: center; + color: var(--muted); + pointer-events: none; +} + +/* --- map picker ------------------------------------------------------- */ + +#panel { + position: absolute; + z-index: 1000; + top: calc(10px + env(safe-area-inset-top)); + left: calc(10px + env(safe-area-inset-left)); + max-width: min(260px, calc(100vw - 20px)); + background: var(--panel); + border: 1px solid var(--line); + border-radius: 8px; + backdrop-filter: blur(6px); + overflow: hidden; +} + +#panel summary { + padding: 10px 14px; + cursor: pointer; + font-weight: 600; + letter-spacing: .04em; + text-transform: uppercase; + font-size: 12px; + color: var(--muted); + user-select: none; + list-style: none; +} +#panel summary::-webkit-details-marker { display: none; } +#panel summary::after { content: " ▾"; } +#panel:not([open]) summary::after { content: " ▸"; } + +#maplist { + display: flex; + flex-direction: column; + border-top: 1px solid var(--line); + max-height: 50vh; + overflow-y: auto; +} + +#maplist button { + all: unset; + padding: 11px 14px; + min-height: 44px; /* touch target */ + cursor: pointer; + color: var(--text); + border-bottom: 1px solid #ffffff0f; + display: flex; + align-items: center; + gap: 8px; +} +#maplist button:last-child { border-bottom: 0; } +#maplist button:hover, +#maplist button:focus-visible { background: #ffffff12; } +#maplist button[aria-current="true"] { color: var(--accent); } +#maplist button[aria-current="true"]::before { content: "●"; font-size: 9px; } +#maplist button:not([aria-current="true"])::before { content: "○"; font-size: 9px; color: var(--muted); } + +/* --- leaflet chrome --------------------------------------------------- */ + +.leaflet-container { background: var(--bg); font: inherit; } + +.leaflet-control-zoom a { + background: var(--panel); + border-color: var(--line) !important; + color: var(--text); +} +.leaflet-control-zoom a:hover { background: #2a303a; } + +.leaflet-control-attribution { + background: var(--panel) !important; + color: var(--muted); + padding: 3px 8px; + font-size: 11px; +} +.leaflet-control-attribution a { color: var(--accent); } + +@media (max-width: 640px) { + #panel { max-width: calc(100vw - 20px); } + .leaflet-control-zoom { display: none; } /* pinch to zoom instead */ +} diff --git a/web/vendor/images/layers-2x.png b/web/vendor/images/layers-2x.png new file mode 100644 index 0000000000000000000000000000000000000000..200c333dca9652ac4cba004d609e5af4eee168c1 GIT binary patch literal 1259 zcmVFhCYNy;#0irRPomHqW|G1C*;4?@4#E?jH>?v@U%cy?3dQAc-DchXVErpOh~ z-jbon+tNbnl6hoEb;)TVk+%hTDDi_G%i3*RZ&15!$Fjr^f;Ke&A@|?=`2&+{zr+3a z{D*=t(`AXyS%X7N z%a#RZw6vD^t_rnM`L4E>m=U&R!A-&}nZIi$BOPvkhrCuUe@BN~-lRD)f44;J%TwgE zcze8u!PQ_NR7?o(NylLXVTfDO zxs5=@|GsYEsNo4M#nT%N!UE(?dnS)t2+{ELYAFp*3=iF=|EQnTp`#vlSXuGVraYo? z+RCzXo6h3qA8{KG?S4nE(lM+;Eb4nT3XV;7gcAxUi5m)`k5tv}cPy()8ZR3TLW3I- zAS^}cq-IJvL7a4RgR!yk@~RT%$lA7{L5ES*hyx)M4(yxI$Ub(4f)K|^v1>zvwQY!_ zIrWw8q9GS^!Dp~}+?mbnB6jDF8mVlbQ!jFKDY;w=7;XO{9bq7>LXGK24WA`;rL)_Z z)&j}pbV(;6gY;VMhbxgvn`X;6x}VUEE-7 z%)7j-%t8S=ZL3yc)HbXDAqJZvBTPoiW_A-+a8m3_Z?v{DN7Tnr#O_VUMT0UBt$;p` zDh6JbGHN8JJ*JN%y2%msb97@_S>9!%Egwk;?PEkU9ntz&3uR}%Fj5d$JHQbQb3}a{ zSzFT^#n=VInPpcAS}CNxj?_ zVscANk5Cfz(51EI1pz};AWWb|kgbYNb4wCEGUn3+eMUMV?1-{=I4TlmLJMot@rd07 zZuo2hk1ccu{YmGkcYdWAVdk{Z4Nm?^cTD&}jGm+Q1SYIXMwmG*oO*83&#>l%nbR`G zhh=lZ%xIb7kU3#;TBbfECrnC9P=-XpL|TG2BoZdj61*XiFbW8?1Z_wp%#;>${SUIy V$8qr;L*)Pf002ovPDHLkV1hYLS~36t literal 0 HcmV?d00001 diff --git a/web/vendor/images/layers.png b/web/vendor/images/layers.png new file mode 100644 index 0000000000000000000000000000000000000000..1a72e5784b2b456eac5d7670738db80697af3377 GIT binary patch literal 696 zcmV;p0!RIcP)*@&l2<6p=!C&s@#ZL+%BQvF&b?w6S%wp=I>1QHj7AP5C)IWy#b znXXB;g;j=$a-tW89K%FbDceHVq&unY*Wx3L#=EGWH=rjqnp|4c_Ulec!ql3#G-5ZF zVlbBA@XP=)C8U&+Lrc)S4O5%1$&{(;7R^K(CSnvSr$v;+B$8q&7Bf|h$#PARo1^%M zf1H^nG-EiXVXr07OH(*8R)xa|FD;lXUlg_-%)~ZGsL2cX0NXaAzN2q%jqLRR6ruVk8`Jb7n#{`T;o@`F= z#3YcynIR^s83UNF3D!f5m#Mg)NJ24&Qfrqb&_z=yF;=B)#9Iq7u-@^O!(mW{D;qvr zPc)gVb%aowtS8m@ElL4A9G>w#ffQ~q{i&_i)*6f^)Sz|C?C>zb4Uo?H<-&Hz@a?J; z$ml@zGygWofb9$ZBj6aLjpLhsT2AzjOu=-*u_gSCUYnU^5s62$4H-fe}gSR(=wKRaTHh!@*b)YV6mo|a4Fn6Rgc&Rpk zvn_X|3VY?v=>nJ{slE^V1GaGWk}m@aIWGIpghbfPh8m@aIWEo_%AZI>==moIFVE^L=C zZJ91?mo03UEp3-BY?wBGur6$uD{Yr9Y?m%SHF8Fk1pc(Nva%QJ+{FLkalfypz3&M|||Fn`7|g3c~4(nXHKFmRnwn$J#_$xE8i z|Ns9!kC;(oC1qQk>LMp3_a2(odYyMT@>voX=UI)k>1cJdn;gjmJ-|6v4nb1Oryh)eQMwHP(i@!36%vGJyFK(JTj?Vb{{C=jx&)@1l zlFmnw%0`&bqruifkkHKC=vbiAM3&E`#Mv>2%tw;VK8?_|&E89cs{a1}$J*!f_xd-C z&F%B|oxRgPlh0F!txkxrQjNA`m9~?&&|jw4W0<`_iNHsX$VQXVK!B}Xkh4>av|f_8 zLY2?t?ejE=%(TnfV5iqOjm?d;&qI~ZGl|SzU77a)002XDQchC<95+*MjE@82?VLm= z3xf6%Vd@99z|q|-ua5l3kJxvZwan-8K1cPiwQAtlcNX~ZqLeoMB+a;7)WA|O#HOB% zg6SX;754xD1{Fy}K~#8Ntklac&zTpadXZ& zC*_=T&g7hfbI$R?v%9?sknIb97gJOJ=`-8YyS3ndqN+Jm+x33!p&Hc@@L$w))s2@N ztv~i}Emc?DykgwFWwma($8+~b>l?tqj$dh13R^nMZnva9 zn0Vflzv2Dvp`oVQw{Guby~i`JGbyBGTEC{y>yzCkg>K&CIeQ$u;lyQ+M{O~gEJ^)Z zrF3p)^>|uT;57}WY&IRwyOQ=dq%Az}_t=_hKowP!Z79q0;@Zu(SWEJJcHY+5T6I({ zw)wj*SNi4wrd+POUfZe4gF77vW?j zoFS}|r2n&$U9Y!S4VEOyN}OpZZi|?cr1VcE_tHsDQgp-ga(SwkBrkCm{|*-yb=}ZW zvcYvLvfA90TPn|!-TuYJV<6`}+RJeRgP3EA=qQcF9k0*#*{f&I_pjam%I6Dd#YE|G zqB!R}tW-K!wV1w+4JcFA_s6~=@9F&j8`u$-ifLN3vK;`lvaA-`jRn_}(8|)!3?-}I zvFi{H;@A$gEZYh?%|Qr_y#*UkOPjwiRCsJQ>mb6h5yGIk6C5_XA=8T?IBfm_?+P0; zhhUs)-(0R*H<&Kku(1>#cGtOpk&Z&kQcw&SJv-4VY<+;=8hYnoX zfNJMCa9)^5Z0;2dCUk;x-%#yS!I~Jr3pNuI!g_tHz!$hKwt1GL~sFvx)3u4TA zv>CLGdQtoZ7Du7ctJRfTqY;FPxs1G{ZJ?73D5J@OO{6BHcPbk{_mjg&p2QFeke%QI zlAJ-kvjuwy1<5D-6>su68A+i998aSZNnQX)+Q}6(GK-C%8G-!1bOJBONU{gT%IOOE z;Yk24YC@^lFW77>r6x7eS1Omc;8=GUp#&zLQ&L{ zv8$hGC`wp~$9pR>f%-_Ps3>YhzP(+vC(E*zr1CVO8ChN^MI-VGMX7+|(r!SGZ9gd5 zzO9sQd>sm|f1|X&oh=8lOzd6+ITvo zCXInR?>RZ#>Hb*PO=7dI!dZ(wY4O}ZGv zdfQFio7+0~PN*RFCZGM6@9-o~y*@?;k00NvOsw54t1^tt{*ATMs^2j}4Wp=4t3RH* z_+8b`F-{E=0sOgM<;VHTo!Ij3u zmmI`2?K7g(GOcGA)@h?$SW&pwHdtj1n57PLI8&6RHhx4R%Q7b z^JEqR)@06V!pbS*@D_ZyRMo_LlT}r{#sXOx4kM-V<_V{!5SSuM^SIVCA37|nY7LWQ zZA#B1h4l`6asz=Lvax_#GMRX|NF>=$=p{Qn0i@ExX1jGhy@B8a*_uR+ODEbVi8ObL zezG?azy>E~S~dl43&8<$(2H}P&*tuBdESUP83KQ?8B z?K(!uS>H1wlWQz;qOfB`T#TZ=EoSp~vZ5XtCvwm1h*Ex6mzTsn_y@_=xREIslV-%- zpdWkEzMjeNOGWrSM32gpBt27*O29NdhGzuDgYxcf`Jjjqw@B;Vmdb@fxdhCRi`Kg> zmUTr$=&@#i!%F4Q6mb&4QKfR^95KJ!<6~fqx-f^66AV!|ywG{6D^Vay-3b99>XOe# e-I|>x8~*?ZhF3snGbtJX0000cOl4 literal 0 HcmV?d00001 diff --git a/web/vendor/images/marker-icon.png b/web/vendor/images/marker-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..950edf24677ded147df13b26f91baa2b0fa70513 GIT binary patch literal 1466 zcmV;r1x5OaP)P001cn1^@s6z>|W`000GnNklGNuHDcIX17Zdjl&3`L?0sTjIws<{((Dh&g-s0<@jYQyl?D*X^?%13;ml^gy> ziMrY_^1WI=(g@LMizu=zCoA>C`6|QEq1eV92k*7m>G65*&@&6)aC&e}G zI)pf-Za|N`DT&Cn1J|o`19mumxW~hiKiKyc-P`S@q)rdTo84@QI@;0yXrG%9uhI>A zG5QHb6s4=<6xy{1 z@NMxEkryp{LS44%z$3lP^cX!9+2-;CTt3wM4(k*#C{aiIiLuB>jJj;KPhPzIC00bL zU3a#;aJld94lCW=`4&aAy8M7PY=HQ>O%$YEP4c4UY#CRxfgbE~(|uiI=YS8q;O9y6 zmIkXzR`}p7ti|PrM3a}WMnR=3NVnWdAAR>b9X@)DKL6=YsvmH%?I24wdq?Gh54_;# z$?_LvgjEdspdQlft#4CQ z`2Zyvy?*)N1Ftw|{_hakhG9WjS?Az@I@+IZ8JbWewR!XUK4&6346+d#~gsE0SY(LX8&JfY>Aj)RxGy96nwhs2rv zzW6pTnMpFkDSkT*a*6Dx|u@ds6ISVn0@^RmIsKZ5Y;bazbc;tTSq(kg(=481ODrPyNB6n z-$+U}(w$m6U6H$w17Bw+wDaFIe~GvNMYvnw31MpY0eQKT9l>SU``8k7w4)z!GZKMI z#_cEKq7k~i%nlK@6c-K?+R;B#5$?T#YpKD`t_4bAs^#E+@5QW$@OX3*`;(#{U^d-vY)&xEE>n5lYl&T?Amke9$Lam@{1K@O ze*LXqlKQHiv=gx+V^Cbb2?z@ISBQ*3amF;9UJ3SBg(N|710TLamQmYZ&Qjn2LuO<* zCZlB4n%@pc&7NNnY1}x+NWpHlq`OJEo|`aYN9<`RBUB+79g;>dgb6YlfN#kGL?lO_ z!6~M^7sOnbsUkKk<@Ysie&`G>ruxH&Mgy&8;i=A zB9OO!xR{AyODw>DS-q5YM{0ExFEAzt zm>RdS+ssW(-8|?xr0(?$vBVB*%(xDLtq3Hf0I5yFm<_g=W2`QWAax{1rWVH=I!VrP zs(rTFX@W#t$hXNvbgX`gK&^w_YD;CQ!B@e0QbLIWaKAXQe2-kkloo;{iF#6}z!4=W zi$giRj1{ zt;2w`VSCF#WE&*ev7jpsC=6175@(~nTE2;7M-L((0bH@yG}-TB$R~WXd?tA$s3|%y zA`9$sA(>F%J3ioz<-LJl*^o1|w84l>HBR`>3l9c8$5Xr@xCiIQ7{x$fMCzOk_-M=% z+{a_Q#;42`#KfUte@$NT77uaTz?b-fBe)1s5XE$yA79fm?KqM^VgLXD07*qoM6N<$ Ef<_J(9smFU literal 0 HcmV?d00001 diff --git a/web/vendor/leaflet.css b/web/vendor/leaflet.css new file mode 100644 index 0000000..9ade8dc --- /dev/null +++ b/web/vendor/leaflet.css @@ -0,0 +1,661 @@ +/* required styles */ + +.leaflet-pane, +.leaflet-tile, +.leaflet-marker-icon, +.leaflet-marker-shadow, +.leaflet-tile-container, +.leaflet-pane > svg, +.leaflet-pane > canvas, +.leaflet-zoom-box, +.leaflet-image-layer, +.leaflet-layer { + position: absolute; + left: 0; + top: 0; + } +.leaflet-container { + overflow: hidden; + } +.leaflet-tile, +.leaflet-marker-icon, +.leaflet-marker-shadow { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + -webkit-user-drag: none; + } +/* Prevents IE11 from highlighting tiles in blue */ +.leaflet-tile::selection { + background: transparent; +} +/* Safari renders non-retina tile on retina better with this, but Chrome is worse */ +.leaflet-safari .leaflet-tile { + image-rendering: -webkit-optimize-contrast; + } +/* hack that prevents hw layers "stretching" when loading new tiles */ +.leaflet-safari .leaflet-tile-container { + width: 1600px; + height: 1600px; + -webkit-transform-origin: 0 0; + } +.leaflet-marker-icon, +.leaflet-marker-shadow { + display: block; + } +/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */ +/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */ +.leaflet-container .leaflet-overlay-pane svg { + max-width: none !important; + max-height: none !important; + } +.leaflet-container .leaflet-marker-pane img, +.leaflet-container .leaflet-shadow-pane img, +.leaflet-container .leaflet-tile-pane img, +.leaflet-container img.leaflet-image-layer, +.leaflet-container .leaflet-tile { + max-width: none !important; + max-height: none !important; + width: auto; + padding: 0; + } + +.leaflet-container img.leaflet-tile { + /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */ + mix-blend-mode: plus-lighter; +} + +.leaflet-container.leaflet-touch-zoom { + -ms-touch-action: pan-x pan-y; + touch-action: pan-x pan-y; + } +.leaflet-container.leaflet-touch-drag { + -ms-touch-action: pinch-zoom; + /* Fallback for FF which doesn't support pinch-zoom */ + touch-action: none; + touch-action: pinch-zoom; +} +.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom { + -ms-touch-action: none; + touch-action: none; +} +.leaflet-container { + -webkit-tap-highlight-color: transparent; +} +.leaflet-container a { + -webkit-tap-highlight-color: rgba(51, 181, 229, 0.4); +} +.leaflet-tile { + filter: inherit; + visibility: hidden; + } +.leaflet-tile-loaded { + visibility: inherit; + } +.leaflet-zoom-box { + width: 0; + height: 0; + -moz-box-sizing: border-box; + box-sizing: border-box; + z-index: 800; + } +/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */ +.leaflet-overlay-pane svg { + -moz-user-select: none; + } + +.leaflet-pane { z-index: 400; } + +.leaflet-tile-pane { z-index: 200; } +.leaflet-overlay-pane { z-index: 400; } +.leaflet-shadow-pane { z-index: 500; } +.leaflet-marker-pane { z-index: 600; } +.leaflet-tooltip-pane { z-index: 650; } +.leaflet-popup-pane { z-index: 700; } + +.leaflet-map-pane canvas { z-index: 100; } +.leaflet-map-pane svg { z-index: 200; } + +.leaflet-vml-shape { + width: 1px; + height: 1px; + } +.lvml { + behavior: url(#default#VML); + display: inline-block; + position: absolute; + } + + +/* control positioning */ + +.leaflet-control { + position: relative; + z-index: 800; + pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ + pointer-events: auto; + } +.leaflet-top, +.leaflet-bottom { + position: absolute; + z-index: 1000; + pointer-events: none; + } +.leaflet-top { + top: 0; + } +.leaflet-right { + right: 0; + } +.leaflet-bottom { + bottom: 0; + } +.leaflet-left { + left: 0; + } +.leaflet-control { + float: left; + clear: both; + } +.leaflet-right .leaflet-control { + float: right; + } +.leaflet-top .leaflet-control { + margin-top: 10px; + } +.leaflet-bottom .leaflet-control { + margin-bottom: 10px; + } +.leaflet-left .leaflet-control { + margin-left: 10px; + } +.leaflet-right .leaflet-control { + margin-right: 10px; + } + + +/* zoom and fade animations */ + +.leaflet-fade-anim .leaflet-popup { + opacity: 0; + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; + } +.leaflet-fade-anim .leaflet-map-pane .leaflet-popup { + opacity: 1; + } +.leaflet-zoom-animated { + -webkit-transform-origin: 0 0; + -ms-transform-origin: 0 0; + transform-origin: 0 0; + } +svg.leaflet-zoom-animated { + will-change: transform; +} + +.leaflet-zoom-anim .leaflet-zoom-animated { + -webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1); + -moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1); + transition: transform 0.25s cubic-bezier(0,0,0.25,1); + } +.leaflet-zoom-anim .leaflet-tile, +.leaflet-pan-anim .leaflet-tile { + -webkit-transition: none; + -moz-transition: none; + transition: none; + } + +.leaflet-zoom-anim .leaflet-zoom-hide { + visibility: hidden; + } + + +/* cursors */ + +.leaflet-interactive { + cursor: pointer; + } +.leaflet-grab { + cursor: -webkit-grab; + cursor: -moz-grab; + cursor: grab; + } +.leaflet-crosshair, +.leaflet-crosshair .leaflet-interactive { + cursor: crosshair; + } +.leaflet-popup-pane, +.leaflet-control { + cursor: auto; + } +.leaflet-dragging .leaflet-grab, +.leaflet-dragging .leaflet-grab .leaflet-interactive, +.leaflet-dragging .leaflet-marker-draggable { + cursor: move; + cursor: -webkit-grabbing; + cursor: -moz-grabbing; + cursor: grabbing; + } + +/* marker & overlays interactivity */ +.leaflet-marker-icon, +.leaflet-marker-shadow, +.leaflet-image-layer, +.leaflet-pane > svg path, +.leaflet-tile-container { + pointer-events: none; + } + +.leaflet-marker-icon.leaflet-interactive, +.leaflet-image-layer.leaflet-interactive, +.leaflet-pane > svg path.leaflet-interactive, +svg.leaflet-image-layer.leaflet-interactive path { + pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */ + pointer-events: auto; + } + +/* visual tweaks */ + +.leaflet-container { + background: #ddd; + outline-offset: 1px; + } +.leaflet-container a { + color: #0078A8; + } +.leaflet-zoom-box { + border: 2px dotted #38f; + background: rgba(255,255,255,0.5); + } + + +/* general typography */ +.leaflet-container { + font-family: "Helvetica Neue", Arial, Helvetica, sans-serif; + font-size: 12px; + font-size: 0.75rem; + line-height: 1.5; + } + + +/* general toolbar styles */ + +.leaflet-bar { + box-shadow: 0 1px 5px rgba(0,0,0,0.65); + border-radius: 4px; + } +.leaflet-bar a { + background-color: #fff; + border-bottom: 1px solid #ccc; + width: 26px; + height: 26px; + line-height: 26px; + display: block; + text-align: center; + text-decoration: none; + color: black; + } +.leaflet-bar a, +.leaflet-control-layers-toggle { + background-position: 50% 50%; + background-repeat: no-repeat; + display: block; + } +.leaflet-bar a:hover, +.leaflet-bar a:focus { + background-color: #f4f4f4; + } +.leaflet-bar a:first-child { + border-top-left-radius: 4px; + border-top-right-radius: 4px; + } +.leaflet-bar a:last-child { + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + border-bottom: none; + } +.leaflet-bar a.leaflet-disabled { + cursor: default; + background-color: #f4f4f4; + color: #bbb; + } + +.leaflet-touch .leaflet-bar a { + width: 30px; + height: 30px; + line-height: 30px; + } +.leaflet-touch .leaflet-bar a:first-child { + border-top-left-radius: 2px; + border-top-right-radius: 2px; + } +.leaflet-touch .leaflet-bar a:last-child { + border-bottom-left-radius: 2px; + border-bottom-right-radius: 2px; + } + +/* zoom control */ + +.leaflet-control-zoom-in, +.leaflet-control-zoom-out { + font: bold 18px 'Lucida Console', Monaco, monospace; + text-indent: 1px; + } + +.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out { + font-size: 22px; + } + + +/* layers control */ + +.leaflet-control-layers { + box-shadow: 0 1px 5px rgba(0,0,0,0.4); + background: #fff; + border-radius: 5px; + } +.leaflet-control-layers-toggle { + background-image: url(images/layers.png); + width: 36px; + height: 36px; + } +.leaflet-retina .leaflet-control-layers-toggle { + background-image: url(images/layers-2x.png); + background-size: 26px 26px; + } +.leaflet-touch .leaflet-control-layers-toggle { + width: 44px; + height: 44px; + } +.leaflet-control-layers .leaflet-control-layers-list, +.leaflet-control-layers-expanded .leaflet-control-layers-toggle { + display: none; + } +.leaflet-control-layers-expanded .leaflet-control-layers-list { + display: block; + position: relative; + } +.leaflet-control-layers-expanded { + padding: 6px 10px 6px 6px; + color: #333; + background: #fff; + } +.leaflet-control-layers-scrollbar { + overflow-y: scroll; + overflow-x: hidden; + padding-right: 5px; + } +.leaflet-control-layers-selector { + margin-top: 2px; + position: relative; + top: 1px; + } +.leaflet-control-layers label { + display: block; + font-size: 13px; + font-size: 1.08333em; + } +.leaflet-control-layers-separator { + height: 0; + border-top: 1px solid #ddd; + margin: 5px -10px 5px -6px; + } + +/* Default icon URLs */ +.leaflet-default-icon-path { /* used only in path-guessing heuristic, see L.Icon.Default */ + background-image: url(images/marker-icon.png); + } + + +/* attribution and scale controls */ + +.leaflet-container .leaflet-control-attribution { + background: #fff; + background: rgba(255, 255, 255, 0.8); + margin: 0; + } +.leaflet-control-attribution, +.leaflet-control-scale-line { + padding: 0 5px; + color: #333; + line-height: 1.4; + } +.leaflet-control-attribution a { + text-decoration: none; + } +.leaflet-control-attribution a:hover, +.leaflet-control-attribution a:focus { + text-decoration: underline; + } +.leaflet-attribution-flag { + display: inline !important; + vertical-align: baseline !important; + width: 1em; + height: 0.6669em; + } +.leaflet-left .leaflet-control-scale { + margin-left: 5px; + } +.leaflet-bottom .leaflet-control-scale { + margin-bottom: 5px; + } +.leaflet-control-scale-line { + border: 2px solid #777; + border-top: none; + line-height: 1.1; + padding: 2px 5px 1px; + white-space: nowrap; + -moz-box-sizing: border-box; + box-sizing: border-box; + background: rgba(255, 255, 255, 0.8); + text-shadow: 1px 1px #fff; + } +.leaflet-control-scale-line:not(:first-child) { + border-top: 2px solid #777; + border-bottom: none; + margin-top: -2px; + } +.leaflet-control-scale-line:not(:first-child):not(:last-child) { + border-bottom: 2px solid #777; + } + +.leaflet-touch .leaflet-control-attribution, +.leaflet-touch .leaflet-control-layers, +.leaflet-touch .leaflet-bar { + box-shadow: none; + } +.leaflet-touch .leaflet-control-layers, +.leaflet-touch .leaflet-bar { + border: 2px solid rgba(0,0,0,0.2); + background-clip: padding-box; + } + + +/* popup */ + +.leaflet-popup { + position: absolute; + text-align: center; + margin-bottom: 20px; + } +.leaflet-popup-content-wrapper { + padding: 1px; + text-align: left; + border-radius: 12px; + } +.leaflet-popup-content { + margin: 13px 24px 13px 20px; + line-height: 1.3; + font-size: 13px; + font-size: 1.08333em; + min-height: 1px; + } +.leaflet-popup-content p { + margin: 17px 0; + margin: 1.3em 0; + } +.leaflet-popup-tip-container { + width: 40px; + height: 20px; + position: absolute; + left: 50%; + margin-top: -1px; + margin-left: -20px; + overflow: hidden; + pointer-events: none; + } +.leaflet-popup-tip { + width: 17px; + height: 17px; + padding: 1px; + + margin: -10px auto 0; + pointer-events: auto; + + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + } +.leaflet-popup-content-wrapper, +.leaflet-popup-tip { + background: white; + color: #333; + box-shadow: 0 3px 14px rgba(0,0,0,0.4); + } +.leaflet-container a.leaflet-popup-close-button { + position: absolute; + top: 0; + right: 0; + border: none; + text-align: center; + width: 24px; + height: 24px; + font: 16px/24px Tahoma, Verdana, sans-serif; + color: #757575; + text-decoration: none; + background: transparent; + } +.leaflet-container a.leaflet-popup-close-button:hover, +.leaflet-container a.leaflet-popup-close-button:focus { + color: #585858; + } +.leaflet-popup-scrolled { + overflow: auto; + } + +.leaflet-oldie .leaflet-popup-content-wrapper { + -ms-zoom: 1; + } +.leaflet-oldie .leaflet-popup-tip { + width: 24px; + margin: 0 auto; + + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)"; + filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678); + } + +.leaflet-oldie .leaflet-control-zoom, +.leaflet-oldie .leaflet-control-layers, +.leaflet-oldie .leaflet-popup-content-wrapper, +.leaflet-oldie .leaflet-popup-tip { + border: 1px solid #999; + } + + +/* div icon */ + +.leaflet-div-icon { + background: #fff; + border: 1px solid #666; + } + + +/* Tooltip */ +/* Base styles for the element that has a tooltip */ +.leaflet-tooltip { + position: absolute; + padding: 6px; + background-color: #fff; + border: 1px solid #fff; + border-radius: 3px; + color: #222; + white-space: nowrap; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + pointer-events: none; + box-shadow: 0 1px 3px rgba(0,0,0,0.4); + } +.leaflet-tooltip.leaflet-interactive { + cursor: pointer; + pointer-events: auto; + } +.leaflet-tooltip-top:before, +.leaflet-tooltip-bottom:before, +.leaflet-tooltip-left:before, +.leaflet-tooltip-right:before { + position: absolute; + pointer-events: none; + border: 6px solid transparent; + background: transparent; + content: ""; + } + +/* Directions */ + +.leaflet-tooltip-bottom { + margin-top: 6px; +} +.leaflet-tooltip-top { + margin-top: -6px; +} +.leaflet-tooltip-bottom:before, +.leaflet-tooltip-top:before { + left: 50%; + margin-left: -6px; + } +.leaflet-tooltip-top:before { + bottom: 0; + margin-bottom: -12px; + border-top-color: #fff; + } +.leaflet-tooltip-bottom:before { + top: 0; + margin-top: -12px; + margin-left: -6px; + border-bottom-color: #fff; + } +.leaflet-tooltip-left { + margin-left: -6px; +} +.leaflet-tooltip-right { + margin-left: 6px; +} +.leaflet-tooltip-left:before, +.leaflet-tooltip-right:before { + top: 50%; + margin-top: -6px; + } +.leaflet-tooltip-left:before { + right: 0; + margin-right: -12px; + border-left-color: #fff; + } +.leaflet-tooltip-right:before { + left: 0; + margin-left: -12px; + border-right-color: #fff; + } + +/* Printing */ + +@media print { + /* Prevent printers from removing background-images of controls. */ + .leaflet-control { + -webkit-print-color-adjust: exact; + print-color-adjust: exact; + } + } diff --git a/web/vendor/leaflet.js b/web/vendor/leaflet.js new file mode 100644 index 0000000..a3bf693 --- /dev/null +++ b/web/vendor/leaflet.js @@ -0,0 +1,6 @@ +/* @preserve + * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com + * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,function(t){"use strict";function l(t){for(var e,i,n=1,o=arguments.length;n=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>=e.x&&n.x<=i.x,t=t.y>=e.y&&n.y<=i.y;return o&&t},overlaps:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>e.x&&n.xe.y&&n.y=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>=e.lat&&n.lat<=i.lat,t=t.lng>=e.lng&&n.lng<=i.lng;return o&&t},overlaps:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>e.lat&&n.late.lng&&n.lng","http://www.w3.org/2000/svg"===(Wt.firstChild&&Wt.firstChild.namespaceURI));function y(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var b={ie:pt,ielt9:mt,edge:n,webkit:ft,android:gt,android23:vt,androidStock:yt,opera:xt,chrome:wt,gecko:bt,safari:Pt,phantom:Lt,opera12:o,win:Tt,ie3d:Mt,webkit3d:zt,gecko3d:_t,any3d:Ct,mobile:Zt,mobileWebkit:St,mobileWebkit3d:Et,msPointer:kt,pointer:Ot,touch:Bt,touchNative:At,mobileOpera:It,mobileGecko:Rt,retina:Nt,passiveEvents:Dt,canvas:jt,svg:Ht,vml:!Ht&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Wt,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Ft=b.msPointer?"MSPointerDown":"pointerdown",Ut=b.msPointer?"MSPointerMove":"pointermove",Vt=b.msPointer?"MSPointerUp":"pointerup",qt=b.msPointer?"MSPointerCancel":"pointercancel",Gt={touchstart:Ft,touchmove:Ut,touchend:Vt,touchcancel:qt},Kt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&O(e);ee(t,e)},touchmove:ee,touchend:ee,touchcancel:ee},Yt={},Xt=!1;function Jt(t,e,i){return"touchstart"!==e||Xt||(document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,Qt,!0),document.addEventListener(Vt,te,!0),document.addEventListener(qt,te,!0),Xt=!0),Kt[e]?(i=Kt[e].bind(this,i),t.addEventListener(Gt[e],i,!1),i):(console.warn("wrong event specified:",e),u)}function $t(t){Yt[t.pointerId]=t}function Qt(t){Yt[t.pointerId]&&(Yt[t.pointerId]=t)}function te(t){delete Yt[t.pointerId]}function ee(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Yt)e.touches.push(Yt[i]);e.changedTouches=[e],t(e)}}var ie=200;function ne(t,i){t.addEventListener("dblclick",i);var n,o=0;function e(t){var e;1!==t.detail?n=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((e=Ne(t)).some(function(t){return t instanceof HTMLLabelElement&&t.attributes.for})&&!e.some(function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement})||((e=Date.now())-o<=ie?2===++n&&i(function(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return(t=n).type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):n=1,o=e))}return t.addEventListener("click",e),{dblclick:i,simDblclick:e}}var oe,se,re,ae,he,le,ue=we(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ce=we(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ce||"OTransition"===ce?ce+"End":"transitionend";function _e(t){return"string"==typeof t?document.getElementById(t):t}function pe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(i=i&&"auto"!==i||!document.defaultView?i:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:i}function P(t,e,i){t=document.createElement(t);return t.className=e||"",i&&i.appendChild(t),t}function T(t){var e=t.parentNode;e&&e.removeChild(t)}function me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ve(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=xe(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function M(t,e){var i;if(void 0!==t.classList)for(var n=F(e),o=0,s=n.length;othis.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),t=this._limitCenter(i,this._zoom,g(t));return i.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=m((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),t=this.project(t),s=this.getPixelBounds(),i=_([s.min.add(i),s.max.subtract(n)]),s=i.getSize();return i.contains(t)||(this._enforcingBounds=!0,n=t.subtract(i.getCenter()),i=i.extend(t).getSize().subtract(s),o.x+=n.x<0?-i.x:i.x,o.y+=n.y<0?-i.y:i.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),n=e.divideBy(2).round(),o=i.divideBy(2).round(),n=n.subtract(o);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){var e,i;return t=this._locateOptions=l({timeout:1e4,watch:!1},t),"geolocation"in navigator?(e=a(this._handleGeolocationResponse,this),i=a(this._handleGeolocationError,this),t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t)):this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,i,n=new v(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(n,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:n,bounds:o,timestamp:t.timestamp});for(i in t.coords)"number"==typeof t.coords[i]&&(r[i]=t.coords[i]);this.fire("locationfound",r)}},addHandler:function(t,e){return e&&(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable()),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),T(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(r(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)T(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){e=P("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new s(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=g(t),i=m(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),t=t.getSouthEast(),i=this.getSize().subtract(i),t=_(this.project(t,n),this.project(r,n)).getSize(),r=b.any3d?this.options.zoomSnap:1,a=i.x/t.x,i=i.y/t.y,t=e?Math.max(a,i):Math.min(a,i),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=e?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new p(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){t=this._getTopLeftPoint(t,e);return new f(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,t=(e=void 0===e?this._zoom:e,i.zoom(t*i.scale(e)));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(w(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(m(t),e)},layerPointToLatLng:function(t){t=m(t).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(t){return this.project(w(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(w(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(g(t))},distance:function(t,e){return this.options.crs.distance(w(t),w(e))},containerPointToLayerPoint:function(t){return m(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return m(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){t=this.containerPointToLayerPoint(m(t));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)))},mouseEventToContainerPoint:function(t){return De(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){t=this._container=_e(t);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");S(t,"scroll",this._onScroll,this),this._containerId=h(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&b.any3d,M(t,"leaflet-container"+(b.touch?" leaflet-touch":"")+(b.retina?" leaflet-retina":"")+(b.ielt9?" leaflet-oldie":"")+(b.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),pe(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Z(this._mapPane,new p(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(M(t.markerPane,"leaflet-zoom-hide"),M(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Z(this._mapPane,new p(0,0));var n=!this._loaded,o=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return r(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Z(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?k:S;e((this._targets[h(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){r(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[h(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!We(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n=n.length||r||o||!this.listens(e,!0)?n:[this]},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,i=t.target||t.srcElement;!this._loaded||i._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(i)||("mousedown"===(e=t.type)&&Me(i),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){"click"===t.type&&((a=l({},t)).type="preclick",this._fireDOMEvent(a,a.type,i));var n=this._findEventTargets(t,e);if(i){for(var o=[],s=0;sthis.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/n);if(!0!==i.animate&&!this.getSize().contains(n))return!1;x(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this)}return!0},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,M(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&z(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ue(t){return new B(t)}var B=et.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),t=t._controlCorners[i];return M(e,"leaflet-control"),-1!==i.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(T(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0",e=document.createElement("div");return e.innerHTML=t,e.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer),n=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+h(this),n),this._layerControlInputs.push(e),e.layerId=h(t.layer),S(e,"click",this._onInputClick,this),document.createElement("span")),o=(n.innerHTML=" "+t.name,document.createElement("span"));return i.appendChild(o),o.appendChild(e),o.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;se.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section,e=(this._preventClick=!0,S(t,"click",O),this.expand(),this);setTimeout(function(){k(t,"click",O),e._preventClick=!1})}})),qe=B.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=P("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){i=P("a",i,n);return i.innerHTML=t,i.href="#",i.title=e,i.setAttribute("role","button"),i.setAttribute("aria-label",e),Ie(i),S(i,"click",Re),S(i,"click",o,this),S(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";z(this._zoomInButton,e),z(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(M(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(M(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Ge=(A.mergeOptions({zoomControl:!0}),A.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))}),B.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=P("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=P("div",e,i)),t.imperial&&(this._iScale=P("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,t=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,t=3.2808399*t;5280'+(b.inlineSvg?' ':"")+"Leaflet"},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=P("div","leaflet-control-attribution"),Ie(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(", ")),this._container.innerHTML=i.join(' ')}}}),n=(A.mergeOptions({attributionControl:!0}),A.addInitHook(function(){this.options.attributionControl&&(new Ke).addTo(this)}),B.Layers=Ve,B.Zoom=qe,B.Scale=Ge,B.Attribution=Ke,Ue.layers=function(t,e,i){return new Ve(t,e,i)},Ue.zoom=function(t){return new qe(t)},Ue.scale=function(t){return new Ge(t)},Ue.attribution=function(t){return new Ke(t)},et.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),ft=(n.addTo=function(t,e){return t.addHandler(e,this),this},{Events:e}),Ye=b.touch?"touchstart mousedown":"mousedown",Xe=it.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){c(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(S(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xe._dragging===this&&this.finishDrag(!0),k(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;this._enabled&&(this._moved=!1,ve(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Xe._dragging===this&&this.finishDrag():Xe._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Xe._dragging=this)._preventOutline&&Me(this._element),Le(),re(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=Ce(this._element),this._startPoint=new p(i.clientX,i.clientY),this._startPos=Pe(this._element),this._parentScale=Ze(e),i="mousedown"===t.type,S(document,i?"mousemove":"touchmove",this._onMove,this),S(document,i?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1e&&(i.push(t[n]),o=n);oe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i}function ri(t,e,i,n){var o=e.x,e=e.y,s=i.x-o,r=i.y-e,a=s*s+r*r;return 0this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||yi.prototype._containsPoint.call(this,t,!0)}});var wi=ci.extend({initialize:function(t,e){c(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=d(t)?t:t.features;if(o){for(e=0,i=o.length;es.x&&(r=i.x+a-s.x+o.x),i.x-r-n.x<(a=0)&&(r=i.x-n.x),i.y+e+o.y>s.y&&(a=i.y+e-s.y+o.y),i.y-a-n.y<0&&(a=i.y-n.y),(r||a)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([r,a]))))},_getAnchor:function(){return m(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Ii=(A.mergeOptions({closePopupOnClick:!0}),A.include({openPopup:function(t,e,i){return this._initOverlay(Bi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),o.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Bi,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof ci||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Re(t),e=t.layer||t.target,this._popup._source!==e||e instanceof fi?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ai.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=P("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,o=i.latLngToContainerPoint(i.getCenter()),i=i.layerPointToContainerPoint(t),s=this.options.direction,r=n.offsetWidth,a=n.offsetHeight,h=m(this.options.offset),l=this._getAnchor(),i="top"===s?(e=r/2,a):"bottom"===s?(e=r/2,0):(e="center"===s?r/2:"right"===s?0:"left"===s?r:i.xthis.options.maxZoom||nthis.options.maxZoom||void 0!==this.options.minZoom&&oi.max.x)||!e.wrapLat&&(t.yi.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),g(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),i=n.add(i);return[e.unproject(n,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){t=this._tileCoordsToNwSe(t),t=new s(t[0],t[1]);return t=this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var t=t.split(":"),e=new p(+t[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(T(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){M(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,b.ielt9&&this.options.opacity<1&&C(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(a(this._tileReady,this,t,null,o)),Z(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(C(i.el,0),r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(M(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),b.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new p(this._wrapX?H(t.x,this._wrapX):t.x,this._wrapY?H(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new f(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var Di=Ni.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=c(this,e)).detectRetina&&b.retina&&0')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),zt={_initContainer:function(){this._container=P("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wi.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Vi("shape");M(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Vi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;T(e),t.removeInteractiveTarget(e),delete this._layers[h(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e=e||(t._stroke=Vi("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=d(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=Vi("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){ge(t._container)}},qi=b.vml?Vi:ct,Gi=Wi.extend({_initContainer:function(){this._container=qi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){T(this._container),k(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Z(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=qi("path");t.options.className&&M(e,t.options.className),t.options.interactive&&M(e,"leaflet-interactive"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){T(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,dt(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",e=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){ge(t._path)}});function Ki(t){return b.svg||b.vml?new Gi(t):null}b.vml&&Gi.include(zt),A.include({getRenderer:function(t){t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){var e;return"overlayPane"!==t&&void 0!==t&&(void 0===(e=this._paneRenderers[t])&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e)},_createRenderer:function(t){return this.options.preferCanvas&&Ui(t)||Ki(t)}});var Yi=xi.extend({initialize:function(t,e){xi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=g(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Gi.create=qi,Gi.pointsToPath=dt,wi.geometryToLayer=bi,wi.coordsToLatLng=Li,wi.coordsToLatLngs=Ti,wi.latLngToCoords=Mi,wi.latLngsToCoords=zi,wi.getFeature=Ci,wi.asFeature=Zi,A.mergeOptions({boxZoom:!0});var _t=n.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){S(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){k(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){T(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),S(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=P("div","leaflet-zoom-box",this._container),M(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var t=new f(this._point,this._startPoint),e=t.getSize();Z(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(T(this._box),z(this._container,"leaflet-crosshair")),ae(),Te(),k(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0),t=new s(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ct=(A.addInitHook("addHandler","boxZoom",_t),A.mergeOptions({doubleClickZoom:!0}),n.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,i=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}})),Zt=(A.addInitHook("addHandler","doubleClickZoom",Ct),A.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),n.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Xe(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),M(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){z(this._map._container,"leaflet-grab"),z(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=g(this._map.options.maxBounds),this._offsetLimit=_(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,n=(n+e+i)%t-e-i,t=Math.abs(o+i)e.getMaxZoom()&&1