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

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

AGENTS.md2.7 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- Gradle: :library:map / dir: library/map/
6- Package roots present: (vector-map renderer — one package + Rust core)
7- Entry files: VectorMap.kt + MapScope.kt (no MainActivity/Route — library)
8- Deps: (none — no project dependencies by design)
9- Network: tile range fetches reach the host app's `NetworkClient` over JNI
10 (`NativeHttpBridge`, resolved at runtime from the app classpath — every map
11 host already depends on `:library:network` directly); the live
12 online/offline signal is injected per call site via `VectorMap(online = …)`
13 for the same reason. This module declares INTERNET itself.
14- Metadata: metadata_data/library-map.md (absent — libraries have none by design)
15- Rust: yes / screenshotTest: no
16
17## Overview
18**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.
19**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`).
20**Entry points:** `VectorMap.kt` → `MapScope.kt` → `MapStyle.kt` → `SurfaceMapRenderer.kt`.
21**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.
22
23## Key files
24- com/vayunmathur/library/map/VectorMap.kt
25- com/vayunmathur/library/map/MapScope.kt
26- com/vayunmathur/library/map/MapStyle.kt
27- com/vayunmathur/library/map/MapNative.kt — Rust bridge
28- com/vayunmathur/library/map/SurfaceMapRenderer.kt
29- com/vayunmathur/library/map/VulkanMapSurface.kt
30- com/vayunmathur/library/map/CameraState.kt
31- com/vayunmathur/library/map/MapRenderState.kt
32- com/vayunmathur/library/map/MapGestures.kt
33- com/vayunmathur/library/map/MapMarker.kt
34- com/vayunmathur/library/map/LayerOptions.kt
35- com/vayunmathur/library/map/RouteOverlay.kt
36- com/vayunmathur/library/map/RouteStyle.kt
37- com/vayunmathur/library/map/SurfaceMapOverlays.kt
38- com/vayunmathur/library/map/ImageOverlay.kt
39- com/vayunmathur/library/map/UserPuck.kt
40- com/vayunmathur/library/map/TrafficColorTable.kt
41- com/vayunmathur/library/map/GeoTypes.kt
42- com/vayunmathur/library/map/Mercator.kt
43- com/vayunmathur/library/map/Projection.kt
44- com/vayunmathur/library/map/FrameStatsOverlay.kt
45
46## Verify (this module only)
47```
48./gradlew :library:map:compileDevKotlin
49./gradlew :library:map:lint
50```