This commit is contained in:
Hamza-Ayed
2024-10-10 16:22:30 +03:00
parent ebb57a699b
commit 9b0caf3bed
21 changed files with 1142 additions and 630 deletions

View File

@@ -28,39 +28,34 @@ class GoogleDriverMap extends StatelessWidget {
onMapCreated: controller.onMapCreated,
zoomControlsEnabled: true,
initialCameraPosition: CameraPosition(
// bearing: 45,
target: locationController.myLocation,
zoom: 13,
bearing: locationController.heading,
tilt: 40,
),
// onCameraMoveStarted: () {},
cameraTargetBounds: CameraTargetBounds(controller.boundsData),
cameraTargetBounds:
CameraTargetBounds.unbounded, // Allow unrestricted movement
onCameraMove: (position) {
locationController.myLocation = position.target;
controller.mapController!
.animateCamera(CameraUpdate.newCameraPosition(position));
// controller.mapController
// ?.animateCamera(CameraUpdate.newCameraPosition(position));
},
minMaxZoomPreference: const MinMaxZoomPreference(8, 15),
myLocationEnabled: true, myLocationButtonEnabled: true,
myLocationEnabled: true,
myLocationButtonEnabled: true,
compassEnabled: true,
mapType: MapType.terrain,
rotateGesturesEnabled: true,
scrollGesturesEnabled: true,
trafficEnabled: false,
// liteModeEnabled: true,
buildingsEnabled: true,
mapToolbarEnabled: true,
// zoomControlsEnabled: true,
fortyFiveDegreeImageryEnabled: true,
zoomGesturesEnabled: true,
polylines: {
Polyline(
zIndex: 2,
consumeTapEvents: true,
geodesic: true,
endCap: Cap.buttCap,
startCap: Cap.buttCap,
visible: true,
polylineId: const PolylineId('route1'),
points: controller.polylineCoordinates,
color: const Color.fromARGB(255, 163, 81, 246),
@@ -68,11 +63,7 @@ class GoogleDriverMap extends StatelessWidget {
),
Polyline(
zIndex: 2,
consumeTapEvents: true,
geodesic: true,
endCap: Cap.buttCap,
startCap: Cap.buttCap,
visible: true,
polylineId: const PolylineId('route'),
points: controller.polylineCoordinatesDestination,
color: const Color.fromARGB(255, 10, 29, 126),
@@ -81,11 +72,12 @@ class GoogleDriverMap extends StatelessWidget {
},
markers: {
Marker(
markerId: MarkerId('MyLocation'.tr),
position: locationController.myLocation,
draggable: true,
icon: controller.carIcon,
rotation: locationController.heading),
markerId: MarkerId('MyLocation'.tr),
position: locationController.myLocation,
draggable: true,
icon: controller.carIcon,
rotation: locationController.heading,
),
Marker(
markerId: MarkerId('start'.tr),
position: controller.latLngPassengerLocation,