Map Perspective
This example demonstrates how to toggle the map view angle between 2D (vertical look-down at the map) and 3D (perspective, tilted map, looking toward the horizon).
How it works
This example demonstrates the following features:
- Toggle between 2D (vertical) and 3D (perspective) map views.
- Adjust the map tilt angle dynamically based on the selected mode.
- Interact with the map’s settings through GemMapController.
Displaying a map with a tilt angle of 30 degrees
Displaying a map with a tilt angle of 90 degrees
UI and Map Integration
The dart material package is imported, along with the required gem_kit packages.
The map view angle is set using _mapPreferences.tiltAngle , where the map preferences are obtained from the GemMapController controller that is passed into the _onMapCreated() callback, which is called when the interactive map is initialized and ready to use.
The map view angle is set to 90 degrees (looking vertically downward at the map) for 2D mode.
The map view angle is set to 30 degrees (looking 30 degrees downward from the horizon) for 3D mode.
Displaying a map with a two-dimensional perspective
Displaying a map with a three-dimensional perspective