Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
cov/c3 ▾

Modern-Apps.git / library / map / AGENTS.md

AGENTS.md2.8 KiBRenderedCodeRaw
1# AGENTS.md — library/map/ (':library:map')
2
3> Scoped supplement. Global rules in root `AGENTS.md` apply. Stay inside `library/map/` + allowed shared modules. Do not root-scan.
4
5<!-- last-reviewed: 2026-10-16 -->
6- Gradle: :library:map / dir: library/map/
7- Package roots present: (vector-map renderer — one package + Rust core)
8- Entry files: VectorMap.kt + MapScope.kt (no MainActivity/Route — library)
9- Deps: (none — no project dependencies by design, #884)
10- Network: tile range fetches reach the host app's `NetworkClient` over JNI
11 (`NativeHttpBridge`, resolved at runtime from the app classpath — every map
12 host already depends on `:library:network` directly); the live
13 online/offline signal is injected per call site via `VectorMap(online = …)`
14 for the same reason. This module declares INTERNET itself.
15- Metadata: metadata_data/library-map.md (absent — libraries have none by design)
16- Rust: yes / screenshotTest: no
17
18## Overview
19**Purpose:** Offline vector-map renderer on a Rust core — Vulkan surface, layers/markers/routes/traffic, gestures, camera state. Declares INTERNET itself (tile fetches). Used by maps, weather, taxi, fooddelivery.
20**How to use:** `VectorMap` composable in a `MapScope` with `MapStyle` + `LayerOptions`; camera via `CameraState`; overlays for routes/markers/image layers; gestures via `MapGestures`. Tile/bridge work crosses JNI (`MapNative`).
21**Entry points:** `VectorMap.kt` → `MapScope.kt` → `MapStyle.kt` → `SurfaceMapRenderer.kt`.
22**Gotchas:** Another agent is mid-refactor here (tile cache moved `tile/cache.rs` → `tile/cache/` dir, `MapTileCache` touched in maps/) — check `git status`/`git log` on this module before deep work; rendering bugs are usually Rust-side.
23
24## Key files
25- com/vayunmathur/library/map/VectorMap.kt
26- com/vayunmathur/library/map/MapScope.kt
27- com/vayunmathur/library/map/MapStyle.kt
28- com/vayunmathur/library/map/MapNative.kt — Rust bridge
29- com/vayunmathur/library/map/SurfaceMapRenderer.kt
30- com/vayunmathur/library/map/VulkanMapSurface.kt
31- com/vayunmathur/library/map/CameraState.kt
32- com/vayunmathur/library/map/MapRenderState.kt
33- com/vayunmathur/library/map/MapGestures.kt
34- com/vayunmathur/library/map/MapMarker.kt
35- com/vayunmathur/library/map/LayerOptions.kt
36- com/vayunmathur/library/map/RouteOverlay.kt
37- com/vayunmathur/library/map/RouteStyle.kt
38- com/vayunmathur/library/map/SurfaceMapOverlays.kt
39- com/vayunmathur/library/map/ImageOverlay.kt
40- com/vayunmathur/library/map/UserPuck.kt
41- com/vayunmathur/library/map/TrafficColorTable.kt
42- com/vayunmathur/library/map/GeoTypes.kt
43- com/vayunmathur/library/map/Mercator.kt
44- com/vayunmathur/library/map/Projection.kt
45- com/vayunmathur/library/map/RegionLevel.kt
46- com/vayunmathur/library/map/FrameStatsOverlay.kt
47
48## Verify (this module only)
49```
50./gradlew :library:map:compileDevKotlin
51./gradlew :library:map:lint
52```