Update: 2026-06-26 04:53:05
This commit is contained in:
@@ -44,6 +44,7 @@ class MapEngineController extends GetxController {
|
||||
String carIcon = "car_icon";
|
||||
String motoIcon = "moto_icon";
|
||||
String ladyIcon = "lady_icon";
|
||||
int _routeRenderRevision = 0;
|
||||
|
||||
double height = 150;
|
||||
double heightMenu = 0;
|
||||
@@ -59,6 +60,7 @@ class MapEngineController extends GetxController {
|
||||
_isPickerShown = value;
|
||||
update();
|
||||
}
|
||||
|
||||
bool isPointsPageForRider = false;
|
||||
bool isBottomSheetShown = false;
|
||||
bool reloadStartApp = false;
|
||||
@@ -218,7 +220,7 @@ class MapEngineController extends GetxController {
|
||||
}
|
||||
|
||||
void clearPolyline() {
|
||||
polyLines.clear();
|
||||
polyLines = <Polyline>{};
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -255,6 +257,8 @@ class MapEngineController extends GetxController {
|
||||
|
||||
Future<void> playRouteAnimation(
|
||||
List<LatLng> coords, LatLngBounds? bounds) async {
|
||||
_routeRenderRevision++;
|
||||
|
||||
const List<Color> segmentColors = [
|
||||
Color(0xFF109642), // Green
|
||||
Color(0xFFF59E0B), // Amber
|
||||
@@ -296,7 +300,7 @@ class MapEngineController extends GetxController {
|
||||
final color = segmentColors[s % segmentColors.length];
|
||||
|
||||
newPolylines.add(Polyline(
|
||||
polylineId: PolylineId('segment_$s'),
|
||||
polylineId: PolylineId('route_primary_${_routeRenderRevision}_$s'),
|
||||
points: segCoords,
|
||||
color: color,
|
||||
width: 6,
|
||||
@@ -304,7 +308,7 @@ class MapEngineController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
newPolylines.add(Polyline(
|
||||
polylineId: const PolylineId('route_primary'),
|
||||
polylineId: PolylineId('route_primary_${_routeRenderRevision}_0'),
|
||||
points: coords,
|
||||
color: AppColor.primaryColor,
|
||||
width: 6,
|
||||
@@ -414,7 +418,7 @@ class MapEngineController extends GetxController {
|
||||
markerId: mId,
|
||||
position: newPosition,
|
||||
rotation: newHeading,
|
||||
icon: InlqBitmap.fromStyleImage(icon),
|
||||
icon: InlqBitmap.fromAsset(icon),
|
||||
anchor: const Offset(0.5, 0.5),
|
||||
),
|
||||
};
|
||||
@@ -465,7 +469,7 @@ class MapEngineController extends GetxController {
|
||||
final updatedMarker = oldMarker.copyWith(
|
||||
position: currentPos,
|
||||
rotation: currentHeading,
|
||||
icon: InlqBitmap.fromStyleImage(icon),
|
||||
icon: InlqBitmap.fromAsset(icon),
|
||||
);
|
||||
|
||||
markers = {
|
||||
@@ -715,6 +719,8 @@ class MapEngineController extends GetxController {
|
||||
|
||||
Future<void> _playRouteAnimation(
|
||||
List<LatLng> coords, LatLngBounds? bounds) async {
|
||||
_routeRenderRevision++;
|
||||
|
||||
const List<Color> segmentColors = [
|
||||
Color(0xFF109642), // Green
|
||||
Color(0xFFF59E0B), // Amber
|
||||
@@ -756,7 +762,7 @@ class MapEngineController extends GetxController {
|
||||
final color = segmentColors[s % segmentColors.length];
|
||||
|
||||
newPolylines.add(Polyline(
|
||||
polylineId: PolylineId('segment_$s'),
|
||||
polylineId: PolylineId('route_primary_${_routeRenderRevision}_$s'),
|
||||
points: segCoords,
|
||||
color: color,
|
||||
width: 6,
|
||||
@@ -764,7 +770,7 @@ class MapEngineController extends GetxController {
|
||||
}
|
||||
} else {
|
||||
newPolylines.add(Polyline(
|
||||
polylineId: const PolylineId('route_primary'),
|
||||
polylineId: PolylineId('route_primary_${_routeRenderRevision}_0'),
|
||||
points: coords,
|
||||
color: AppColor.primaryColor,
|
||||
width: 6,
|
||||
@@ -803,8 +809,8 @@ class MapEngineController extends GetxController {
|
||||
mainBottomMenuMapHeight = Get.height * 0.22;
|
||||
wayPointSheetHeight = 0;
|
||||
|
||||
markers.clear();
|
||||
polyLines.clear();
|
||||
markers = <Marker>{};
|
||||
polyLines = <Polyline>{};
|
||||
polylineCoordinates.clear();
|
||||
|
||||
_animationTimers.forEach((key, timer) => timer.cancel());
|
||||
|
||||
Reference in New Issue
Block a user