Skip to content

feat: Maps 3D Compose Wrapper and Samples#39

Open
dkhawk wants to merge 23 commits intomainfrom
feat/new-compose-wrapper
Open

feat: Maps 3D Compose Wrapper and Samples#39
dkhawk wants to merge 23 commits intomainfrom
feat/new-compose-wrapper

Conversation

@dkhawk
Copy link
Copy Markdown
Collaborator

@dkhawk dkhawk commented Apr 14, 2026

This PR introduces a new Jetpack Compose wrapper for the Maps 3D SDK (GoogleMap3D) and implements several sample activities to demonstrate its usage:

  • HelloMapActivity: Basic map display.
  • CameraControlsActivity: Demonstrates camera state hoisting and control.
  • MapInteractionsActivity: Shows how to handle map clicks and interact with the scene.
  • MarkersActivity: Demonstrates adding custom markers (like the alien on Devils Tower) with interactive popovers.

Key features added to the wrapper:

  • Declarative marker support via MarkerConfig.
  • Support for click listeners on markers returning the native Marker instance for popover anchoring.
  • Map mode selection.
  • Steady state callbacks.

All activities are exported in the manifest for direct launching.

@dkhawk dkhawk marked this pull request as draft April 14, 2026 00:04
dkhawk added 8 commits April 14, 2026 11:03
- Added PolylineConfig enhancements (drawsOccludedSegments, onClick).
- Created PolylinesActivity with Sanitas Loop demo (double polyline, hovering).
- Wired click listener to show Toast via rememberCoroutineScope.
- Removed useless MAPS_API_KEY warning from build files.
- Added extruded museum building to PolygonsActivity.kt using a custom extrusion helper.
- Added onClick callback to PolygonConfig in DataModels.kt and handled it in Map3DState.kt.
- Updated PolygonsActivity.kt to use click listeners on the zoo and museum polygons.
- Expanded unit tests in MappersTest.kt to cover default values.
- Cleaned up fully qualified names in DataModels.kt.
- Added missing imports in PolygonsActivity.kt to resolve compilation errors.
…striction crash

- Add MapOptionsActivity to demonstrate map options and camera restrictions.
- Add PopoversActivity to demonstrate popovers.
- Implement toValidCameraRestriction() extension function to sanitize CameraRestriction parameters.
- Provide safe defaults from defined ranges when parameters are null to prevent crashes in the native SDK.
- Ensure min <= max for altitude, heading, and tilt by swapping values if necessary.
- Refactor GoogleMap3D.kt to use the new extension function.
- Update MainActivity and AndroidManifest to include new samples.
- Clean up SampleScreens.kt.
…tecture

- Moved BasicMapSample to its own file for better modularity.

- Implemented ModelsActivity to demonstrate loading 3D models and orchestrating cinematic camera animations.

- Registered ModelsActivity in the manifest and updated MainActivity to launch it.

- Added unit tests in UtilitiesTest.kt for CameraRestriction validation.

- Removed old placeholders from SampleScreens.kt.

- Included pre-existing changes in PolylinesActivity and deletion of properties file.
- Refactor "Basic Map with Marker & Polyline" sample to launch BasicMapActivity instead of using inline state.
- Create BasicMapActivity and register it in the manifest.
- Delete empty SampleScreens.kt file.
- Simplify polyline in PolylinesActivity to fix visual test failure.
- Increase timeout and add delay in Maps3DVisualTest for map interactions.
- Add log in MapInteractionsActivity for debugging clicks.
- Fix ktlint violations and clean up unused imports across the project.
…mentation

- Implement `PopoverConfig` in `DataModels.kt` to support declarative popovers in Compose.
- Add `popovers` parameter and `onMapClick` callback to `GoogleMap3D` composable to enable state-driven popover management and map interaction.
- Implement `syncPopovers` in `Map3DState.kt` to handle the mapping between Compose configurations and native SDK Popover instances.
- Refactor `PopoversActivity` in `maps3d-compose-demo` to demonstrate the declarative API, setting `autoPanEnabled` and `autoCloseEnabled` to false for predictable, state-driven UI behavior.
- Add `README.md` files to both `maps3d-compose` and `maps3d-compose-demo` modules to clarify their purpose as reference implementations.
- Relocate and expand `compose_api_coverage.md` into a comprehensive checklist tracking specific SDK classes and listeners, highlighting unsupported features like `Map3DViewUiController`.
- Update root `README.md` to document the new modules with explicit warnings about their experimental nature.
@dkhawk dkhawk requested a review from kikoso April 14, 2026 21:14
@dkhawk dkhawk marked this pull request as ready for review April 14, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant