Overview
Wonderous integrates Google Maps to provide interactive map views showing the exact locations of the Seven Wonders. Users can view each wonder’s location with satellite imagery and a custom marker.Packages Used
pubspec.yaml
FullscreenMapsViewer
The main component for displaying maps is theFullscreenMapsViewer widget, which provides a fullscreen map view centered on a specific wonder.
lib/ui/common/modals/fullscreen_maps_viewer.dart
Key Features
Wonder-specific positioning: The map automatically centers on the wonder’s coordinates usingWonderData.lat and WonderData.lng
Hybrid map type: Uses MapType.hybrid to show satellite imagery with road labels for better context
Fixed zoom level: Set to zoom level 17 for optimal detail and context
Custom marker: Displays a custom app-branded marker at the wonder location
Transparent header: Overlays the app header on top of the map
Custom Map Marker
The app uses a custom marker instead of the default Google Maps pin:lib/ui/common/google_maps_marker.dart
- Consistent branding with the app’s visual identity
- Better visibility on satellite imagery
- Custom icon from
AppBitmaps.mapMarker
Implementation Details
Camera Position
The camera position is calculated based on wonder data:- Target: Uses latitude and longitude from
WonderData - Zoom: Level 17 provides street-level detail while showing surrounding area
Map Configuration
mapType: MapType.hybrid- Shows satellite imagery with labelsmarkers- Single custom marker at wonder locationinitialCameraPosition- Starting position and zoommyLocationButtonEnabled: false- Disables location button for cleaner UI
Usage in App Flow
The map viewer is typically shown as a modal or fullscreen overlay when users want to explore a wonder’s location:- User selects a wonder to view
- User taps a “View on Map” action
FullscreenMapsVieweris pushed with the wonder’sWonderType- Map loads centered on the wonder with satellite view
- User can pan, zoom, and explore the area
- AppHeader provides navigation back to previous screen
Platform Support
The integration works across platforms:
- Mobile: Uses native Google Maps SDK
- Web: Uses
google_maps_flutter_webfor browser support - Desktop: Embedded web view with Google Maps JavaScript API
API Key Configuration
Google Maps requires platform-specific API keys:Android
android/app/src/main/AndroidManifest.xml
iOS
ios/Runner/AppDelegate.swift
Web
web/index.html
Wonder Location Data
Each wonder’s location is stored inWonderData:
- Great Wall of China
- Petra
- Colosseum
- Chichen Itza
- Machu Picchu
- Taj Mahal
- Christ the Redeemer
Related Files
lib/ui/common/modals/fullscreen_maps_viewer.dart- Main map viewer widgetlib/ui/common/google_maps_marker.dart- Custom marker implementationlib/logic/data/wonder_data.dart- Wonder location data