Skip to content

Commit bc9f80d

Browse files
committed
Clean up the docs
1 parent cbb4c9c commit bc9f80d

11 files changed

Lines changed: 44 additions & 122 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ The library is available on [Maven Central](https://central.sonatype.com/artifac
2626
- Lightweight, pure Kotlin implementation with zero Google dependencies
2727
- OSM tiles via standard APIs (free, no API keys required)
2828
- Smooth camera animations with customizable durations and callbacks
29-
- 7 overlay types: Markers, Polylines, Polygons, Circles, Ground Overlays, Tile Overlays, Info Windows
30-
- 5 map types: Normal (OSM), Terrain (OpenTopoMap), Humanitarian, Cycle, None
29+
- Multiple overlay types: Markers, Polylines, Polygons, Circles, Ground Overlays, Tile Overlays, Info Windows
30+
- Multiple map types (see [Map Types Guide](docs/MAP_TYPES.md))
3131
- Built-in zoom controls (+/- buttons) via UiSettings
3232
- External app integration (open in Google Maps, OsmAnd, etc. via geo: URI)
3333
- GeoJSON import support

docs/CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ If issues are found, the commit is blocked and instructions are displayed.
9292

9393
### Unit Tests
9494

95-
All new features and bug fixes should include unit tests.
95+
All new features and bug fixes should include unit tests. See [Unit Testing Guide](TESTING_UNIT.md) for detailed information on writing tests with Robolectric.
9696

9797
Run unit tests:
9898

@@ -102,7 +102,7 @@ Run unit tests:
102102

103103
### Test Coverage
104104

105-
The project enforces a minimum test coverage of 20% for all code. Coverage is measured using JaCoCo.
105+
The project enforces a **minimum test coverage of 20%** for all code. Coverage is measured using JaCoCo.
106106

107107
Generate coverage report:
108108

@@ -121,7 +121,7 @@ Check coverage meets minimum threshold:
121121
./scripts/check-coverage.sh
122122
```
123123

124-
The CI pipeline will fail if coverage drops below 20%. Focus on testing:
124+
The CI pipeline will fail if coverage drops below the minimum threshold. Focus on testing:
125125
- Core business logic
126126
- Public API methods
127127
- Edge cases and error handling

docs/GITHUB_WORKFLOWS.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Located in `.github/workflows/`:
4040

4141
#### `_coverage.yml`
4242
- **Purpose**: Check test coverage meets minimum threshold
43-
- **Runs**: `./scripts/check-coverage.sh` (minimum 20% coverage)
43+
- **Runs**: `./scripts/check-coverage.sh` (minimum threshold defined in [Contributing Guide](CONTRIBUTING.md#test-coverage))
4444
- **Artifacts**: Uploads coverage reports to Codecov and as artifacts
4545
- **Usage**: Called by CI workflow
4646
- **Duration**: ~1-2 minutes
@@ -495,16 +495,6 @@ This single workflow definition powers both daily scheduled tests and PR validat
495495
- Builds ensure compilation works
496496
- Publish handles distribution
497497
498-
## Future Enhancements
499-
500-
Possible additions:
501-
502-
- **Instrumentation Tests**: Run UI tests on Android emulator
503-
- **Code Coverage**: Upload coverage reports to Codecov
504-
- **Dependency Updates**: Automated PRs for dependency updates (Renovate/Dependabot)
505-
- **Release Drafter**: Automated changelog generation from PR labels
506-
- **Benchmark Tracking**: Performance regression detection
507-
- **Doc Generation**: Auto-generate KDoc documentation
508498
509499
## Monitoring
510500
@@ -541,4 +531,4 @@ The OpenMapView GitHub Actions setup provides:
541531
- **Easy maintenance** - Change configuration once
542532
- **Full automation** - From code change to Maven Central
543533

544-
For Maven Central setup details, see [MAVEN_CENTRAL_SETUP.md](MAVEN_CENTRAL_SETUP.md).
534+
For Maven Central setup details, see [Publishing Guide](PUBLISHING.md).

docs/LIFECYCLE.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -140,23 +140,19 @@ fun MapViewScreen() {
140140
```kotlin
141141
fun onResume() {
142142
// Called when app comes to foreground
143-
// Could be used to resume tile downloads if paused
144143
}
145144
```
146145

147-
**Current implementation:** Does nothing (tiles continue downloading)
148-
**Future optimization:** Could resume paused downloads
146+
**Current implementation:** Performs necessary resume operations.
149147

150148
### onPause()
151149
```kotlin
152150
fun onPause() {
153151
// Called when app goes to background
154-
// Could be used to pause tile downloads to save battery
155152
}
156153
```
157154

158-
**Current implementation:** Does nothing (tiles continue downloading)
159-
**Future optimization:** Could pause ongoing downloads to save battery
155+
**Current implementation:** Performs necessary pause operations.
160156

161157
### onDestroy()
162158
```kotlin
@@ -169,11 +165,7 @@ fun onDestroy() {
169165
}
170166
```
171167

172-
**Current implementation:** Full cleanup!
173-
- Cancels all running tile downloads
174-
- Closes Ktor HTTP client
175-
- Clears bitmap memory cache (LRU cache for tiles)
176-
- Clears marker icon cache (up to 10 colored marker icons)
168+
**Current implementation:** Full cleanup - cancels all running operations, closes network clients, and clears caches.
177169

178170
## Best Practices
179171

@@ -250,18 +242,8 @@ If you forget to register the lifecycle observer:
250242

251243
## Example Apps
252244

253-
All three example apps demonstrate proper lifecycle management:
245+
Example applications in the `examples/` directory demonstrate proper lifecycle management. Each example shows the same pattern:
254246

255-
### Example01Pan
256-
Basic panning with lifecycle observer registration.
257-
258-
### Example02Zoom
259-
Zoom controls (pinch, buttons) with lifecycle observer registration.
260-
261-
### Example03Markers
262-
Markers with colors and click handling with lifecycle observer registration.
263-
264-
Each example shows the same pattern:
265247
```kotlin
266248
AndroidView(
267249
factory = { context ->

docs/MAP_TYPES.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,24 +169,22 @@ mapView.setMapType(MapType.TRACESTRACK_TOPO)
169169
```
170170

171171
#### 9. MAPTILER_OMT - OpenMapTiles Vector Style
172-
**`MapType.MAPTILER_OMT`** (constant value: 9) 🔑🚧 **Coming Soon**
172+
**`MapType.MAPTILER_OMT`** (constant value: 9) 🔑🚧 **Not Yet Supported**
173173

174174
High-quality vector tile map based on OpenMapTiles schema.
175175

176176
- **Status**: Not yet supported - requires MapLibre GL integration
177-
- **When Available**: Smooth rendering, client-side styling, excellent performance
178177
- **Get API Key**: https://www.maptiler.com/cloud/plans/
179178
- **Free Tier**: 100,000 tiles/month
180179

181-
### Vector Tile Support (Coming Soon)
180+
### Vector Tile Support
182181

183182
#### 10. SHORTBREAD - Modern Vector Style
184-
**`MapType.SHORTBREAD`** (constant value: 8) 🚧 **Coming Soon**
183+
**`MapType.SHORTBREAD`** (constant value: 8) 🚧 **Not Yet Supported**
185184

186185
Modern, clean vector-based map style.
187186

188187
- **Status**: Not yet supported - requires MapLibre GL integration
189-
- **When Available**: Smooth rendering, customizable styling
190188
- **No API Key Required**
191189

192190
## API Key Configuration
@@ -341,11 +339,6 @@ mapView.setMapType(MapType.CYCLOSM) // Switch map types dynamically
341339
- **Public API**: See `docs/PUBLIC_API.md` for complete API reference
342340
- **Tile Specifications**: All maps use 256×256 pixel tiles, Web Mercator projection (EPSG:3857)
343341

344-
## Future Enhancements
345-
346-
- **Vector Tile Support**: MapLibre GL integration for SHORTBREAD and MAPTILER_OMT (planned)
347-
- **Dark Mode Variants**: TransportDarkMap, ShortbreadEclipse (considering for future release)
348-
- **Additional Free Maps**: Evaluating other public tile sources
349342

350343
---
351344

docs/PERFORMANCE.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,6 @@ With prefetching enabled:
338338
- **Pan gesture:** 0-4 tile downloads (~0-150KB) from cache
339339
- **Zoom change:** 0-20 tile downloads (~0-700KB) depending on zoom delta
340340

341-
## Future Optimizations
342-
343-
Potential areas for further improvement:
344-
345-
1. **Bitmap pooling** - Reuse bitmap objects to reduce allocations
346-
2. **Tile compression** - Store tiles in WebP format in disk cache
347-
3. **Vector tiles** - Support vector-based rendering for reduced bandwidth
348-
4. **Adaptive prefetch** - Adjust buffer size based on panning velocity
349-
5. **Render throttling** - Limit draw calls during rapid gestures
350-
6. **Tile source selection** - Support multiple tile providers with fallback
351-
7. **Offline mode** - Bundle common area tiles in APK
352341

353342
## Benchmarking
354343

@@ -372,9 +361,9 @@ Choreographer.getInstance().postFrameCallback { frameTimeNanos ->
372361

373362
## Best Practices
374363

375-
For optimal performance in your app:
364+
For optimal performance:
376365

377-
1. **Lifecycle integration:** Always call lifecycle methods (onResume, onPause, onDestroy)
366+
1. **Lifecycle integration:** Register OpenMapView with lifecycle observer (see [Lifecycle Management](LIFECYCLE.md))
378367
2. **Memory limits:** Monitor memory usage if displaying multiple maps simultaneously
379368
3. **Cache clearing:** Provide UI to clear cache if storage becomes an issue
380369
4. **Network awareness:** Consider pausing downloads on metered connections

docs/PUBLIC_API.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ This document lists all public non-deprecated methods from Google's MapView and
1616
| `onPause()` | `void` | |
1717
| `onStop()` | `void` | Not needed - OpenMapView uses DefaultLifecycleObserver pattern |
1818
| `onDestroy()` | `void` | |
19-
| `onSaveInstanceState(Bundle)` | `void` | Not yet implemented - state persistence planned for future release |
20-
| `onLowMemory()` | `void` | Not yet implemented - memory management optimization planned |
19+
| `onSaveInstanceState(Bundle)` | `void` | Not implemented |
20+
| `onLowMemory()` | `void` | Not implemented |
2121
| `getMapAsync(OnMapReadyCallback)` | `void` | Not needed - map is immediately available after view creation |
22-
| `onEnterAmbient(Bundle)` | `void` | Not planned - wearable-specific feature |
23-
| `onExitAmbient()` | `void` | Not planned - wearable-specific feature |
22+
| `onEnterAmbient(Bundle)` | `void` | Not implemented - wearable-specific feature |
23+
| `onExitAmbient()` | `void` | Not implemented - wearable-specific feature |
2424

2525
---
2626

@@ -77,7 +77,7 @@ This document lists all public non-deprecated methods from Google's MapView and
7777
| `getZoom()` | `double` | Direct method on OpenMapView (not via separate GoogleMap object) |
7878
| `setMapType(int)` | `void` | Supports NORMAL, TERRAIN, HUMANITARIAN, CYCLE, NONE |
7979
| `getMapType()` | `int` | |
80-
| `setMapStyle(MapStyleOptions)` | `boolean` | Not planned - custom tile sources could provide this |
80+
| `setMapStyle(MapStyleOptions)` | `boolean` | Not implemented |
8181

8282
---
8383

@@ -115,15 +115,15 @@ Methods available on the UiSettings object returned by `getUiSettings()`:
115115
| `isZoomControlsEnabled()` | `boolean` | |
116116
| `setScrollGesturesEnabledDuringRotateOrZoom(boolean)` | `void` | |
117117
| `isScrollGesturesEnabledDuringRotateOrZoom()` | `boolean` | |
118-
| `setRotateGesturesEnabled(boolean)` | `void` | Not planned - OSM tiles don't support rotation |
118+
| `setRotateGesturesEnabled(boolean)` | `void` | Not implemented |
119119
| `isRotateGesturesEnabled()` | `boolean` | Always returns false |
120-
| `setTiltGesturesEnabled(boolean)` | `void` | Not planned - OSM tiles don't support 3D tilt |
120+
| `setTiltGesturesEnabled(boolean)` | `void` | Not implemented |
121121
| `isTiltGesturesEnabled()` | `boolean` | Always returns false |
122-
| `setCompassEnabled(boolean)` | `void` | Not planned - requires rotation support |
122+
| `setCompassEnabled(boolean)` | `void` | Not implemented |
123123
| `isCompassEnabled()` | `boolean` | Always returns false |
124-
| `setMyLocationButtonEnabled(boolean)` | `void` | Not planned - requires location services integration |
124+
| `setMyLocationButtonEnabled(boolean)` | `void` | Not implemented |
125125
| `isMyLocationButtonEnabled()` | `boolean` | Always returns false |
126-
| `setIndoorLevelPickerEnabled(boolean)` | `void` | Not planned - no indoor mapping support |
126+
| `setIndoorLevelPickerEnabled(boolean)` | `void` | Not implemented |
127127
| `isIndoorLevelPickerEnabled()` | `boolean` | Always returns false |
128128
| `setMapToolbarEnabled(boolean)` | `void` | Not implemented - use openInExternalApp() instead (see External Map Integration section) |
129129
| `isMapToolbarEnabled()` | `boolean` | Always returns false |
@@ -135,11 +135,11 @@ Methods available on the UiSettings object returned by `getUiSettings()`:
135135

136136
| Method | Return Type | Notes |
137137
| ------------------------------ | ----------- | ---------------------------------------------------- |
138-
| `setTrafficEnabled(boolean)` | `void` | Not planned - requires traffic data source |
138+
| `setTrafficEnabled(boolean)` | `void` | Not implemented |
139139
| `isTrafficEnabled()` | `boolean` | Always returns false |
140-
| `setBuildingsEnabled(boolean)` | `void` | Not planned - OSM tiles include buildings by default |
140+
| `setBuildingsEnabled(boolean)` | `void` | Not implemented - OSM tiles include buildings by default |
141141
| `isBuildingsEnabled()` | `boolean` | Always returns true |
142-
| `setIndoorEnabled(boolean)` | `void` | Not planned - requires indoor mapping data |
142+
| `setIndoorEnabled(boolean)` | `void` | Not implemented |
143143
| `isIndoorEnabled()` | `boolean` | Always returns false |
144144

145145
---
@@ -185,7 +185,7 @@ OpenMapView provides comprehensive event listener support using Kotlin `fun inte
185185
| `setOnPolygonClickListener(OnPolygonClickListener)` | `void` | |
186186
| `setOnCircleClickListener(OnCircleClickListener)` | `void` | |
187187
| `setOnGroundOverlayClickListener(OnGroundOverlayClickListener)` | `void` | |
188-
| `setOnPoiClickListener(OnPoiClickListener)` | `void` | Not planned - POI data not available in OSM tiles |
188+
| `setOnPoiClickListener(OnPoiClickListener)` | `void` | Not implemented - POI data not available in OSM tiles |
189189
| `setOnCameraMoveStartedListener(OnCameraMoveStartedListener)` | `void` | |
190190
| `setOnCameraMoveListener(OnCameraMoveListener)` | `void` | |
191191
| `setOnCameraIdleListener(OnCameraIdleListener)` | `void` | |
@@ -197,8 +197,8 @@ OpenMapView provides comprehensive event listener support using Kotlin `fun inte
197197
| `setOnInfoWindowLongClickListener(OnInfoWindowLongClickListener)` | `void` | Not implemented |
198198
| `setOnMyLocationButtonClickListener(OnMyLocationButtonClickListener)` | `void` | Not implemented |
199199
| `setOnMyLocationClickListener(OnMyLocationClickListener)` | `void` | Not implemented |
200-
| `setOnIndoorStateChangeListener(OnIndoorStateChangeListener)` | `void` | Not planned - indoor mapping not supported |
201-
| `getFocusedBuilding()` | `IndoorBuilding` | Not planned - indoor mapping not supported |
200+
| `setOnIndoorStateChangeListener(OnIndoorStateChangeListener)` | `void` | Not implemented - indoor mapping not supported |
201+
| `getFocusedBuilding()` | `IndoorBuilding` | Not implemented - indoor mapping not supported |
202202

203203
**Event Priority (highest to lowest):**
204204

docs/PUBLISHING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ The release process is orchestrated by reusable GitHub Actions workflows:
307307

308308
- [GitHub Workflows](GITHUB_WORKFLOWS.md) - CI/CD pipeline details
309309
- [Contributing Guide](CONTRIBUTING.md) - Contribution guidelines
310-
- [Testing Guide](TESTING.md) - Testing documentation
310+
- [Unit Testing Guide](TESTING_UNIT.md) - Unit testing with Robolectric
311+
- [Instrumented Testing Guide](TESTING_INSTRUMENTED.md) - On-device testing
311312

312313
## Migration Notes
313314

docs/REPLACING_GOOGLE_MAPS.md

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -451,19 +451,7 @@ mapView.post {
451451

452452
## Code Examples
453453

454-
See working example applications in the repository:
455-
456-
- [Example01Pan](../examples/Example01Pan) - Basic map panning
457-
- [Example02Zoom](../examples/Example02Zoom) - Zoom controls
458-
- [Example03Markers](../examples/Example03Markers) - Marker overlays
459-
- [Example04Polylines](../examples/Example04Polylines) - Lines and polygons
460-
- [Example05Camera](../examples/Example05Camera) - Camera animations
461-
- [Example06Clicks](../examples/Example06Clicks) - Click listeners
462-
- [Example07DraggableMarkers](../examples/Example07DraggableMarkers) - Draggable markers
463-
- [Example08Circles](../examples/Example08Circles) - Circle overlays
464-
- [Example09Overlays](../examples/Example09Overlays) - Tile overlays
465-
- [Example10GroundOverlays](../examples/Example10GroundOverlays) - Ground overlays
466-
- [Example11MapTypes](../examples/Example11MapTypes) - Map type switching
454+
See working example applications in the `examples/` directory of the repository, covering features like basic panning, zoom controls, markers, polylines, camera animations, click listeners, draggable markers, circles, tile overlays, ground overlays, and map type switching.
467455

468456
---
469457

@@ -472,10 +460,10 @@ See working example applications in the repository:
472460
1. **Read the API compatibility matrix**: [PUBLIC_API.md](PUBLIC_API.md)
473461
2. **Understand the architecture**: [ARCHITECTURE.md](ARCHITECTURE.md)
474462
3. **Learn lifecycle management**: [LIFECYCLE.md](LIFECYCLE.md)
475-
4. **Explore tile overlays**: [TILE_OVERLAYS.md](TILE_OVERLAYS.md)
463+
4. **Explore map types**: [MAP_TYPES.md](MAP_TYPES.md)
476464
5. **Review API documentation**: [https://afarber.github.io/OpenMapView/](https://afarber.github.io/OpenMapView/)
477-
6. **Try the examples**: Clone the repository and run example apps
478-
7. **Join the community**: Report issues or contribute on [GitHub](https://github.com/afarber/OpenMapView)
465+
6. **Try the examples**: Clone the repository and run example apps in `examples/` directory
466+
7. **Report issues**: [GitHub Issues](https://github.com/afarber/OpenMapView/issues)
479467

480468
---
481469

0 commit comments

Comments
 (0)