Update: 2026-07-10 16:09:37
This commit is contained in:
@@ -3719,18 +3719,18 @@ class RideLifecycleController extends GetxController {
|
||||
|
||||
// بناء الـ markers أولاً ثم وضعها معاً مع polylines في تحديث واحد
|
||||
final Set<Marker> newMarkers = {
|
||||
// لا نمرر InfoWindow هنا: صور A/B تحتوي الحرف أصلاً، وأي textField
|
||||
// إضافي يرسم حرفاً مكرراً فوق الدبوس بعد إصلاح الخطوط في الـ SDK.
|
||||
Marker(
|
||||
markerId: const MarkerId('start'),
|
||||
position: startLoc,
|
||||
icon: InlqBitmap.fromAsset('assets/images/A.png'),
|
||||
infoWindow: const InfoWindow(title: 'A'),
|
||||
icon: InlqBitmap.fromStyleImage('start_icon'),
|
||||
anchor: const Offset(0.5, 1.0),
|
||||
),
|
||||
Marker(
|
||||
markerId: const MarkerId('end'),
|
||||
position: endLoc,
|
||||
icon: InlqBitmap.fromAsset('assets/images/b.png'),
|
||||
infoWindow: const InfoWindow(title: 'B'),
|
||||
icon: InlqBitmap.fromStyleImage('end_icon'),
|
||||
anchor: const Offset(0.5, 1.0),
|
||||
),
|
||||
};
|
||||
@@ -3742,11 +3742,9 @@ class RideLifecycleController extends GetxController {
|
||||
newMarkers.add(Marker(
|
||||
markerId: MarkerId('waypoint_$i'),
|
||||
position: wp,
|
||||
icon: InlqBitmap.fromAsset(isFirstWaypoint
|
||||
? 'assets/images/A.png'
|
||||
: 'assets/images/b.png'),
|
||||
infoWindow:
|
||||
InfoWindow(title: isFirstWaypoint ? 'Stop 1' : 'Stop 2'),
|
||||
icon: InlqBitmap.fromStyleImage(isFirstWaypoint
|
||||
? 'start_icon'
|
||||
: 'end_icon'),
|
||||
anchor: const Offset(0.5, 1.0),
|
||||
));
|
||||
}
|
||||
@@ -3758,27 +3756,12 @@ class RideLifecycleController extends GetxController {
|
||||
Log.print(
|
||||
'✅ FIX P1 v2: ${newMarkers.length} markers placed — start: $startLoc, end: $endLoc');
|
||||
|
||||
// إضافة الـ markers مباشرة عبر الـ controller لضمان ظهورها
|
||||
try {
|
||||
final ctrl = mapEngine.mapController;
|
||||
if (ctrl != null) {
|
||||
for (final m in newMarkers) {
|
||||
await ctrl.addMarker(m);
|
||||
}
|
||||
Log.print(
|
||||
'✅ Added ${newMarkers.length} markers via controller.addMarker()');
|
||||
} else {
|
||||
Log.print('⚠️ mapController is null, relying on declarative markers');
|
||||
}
|
||||
} catch (e) {
|
||||
Log.print('⚠️ addMarker via controller failed: $e');
|
||||
}
|
||||
|
||||
await bottomSheet();
|
||||
|
||||
await mapEngine.playRouteAnimation(
|
||||
mapEngine.polylineCoordinates, mapEngine.lastComputedBounds);
|
||||
|
||||
mapEngine.update(); // Make sure the map UI rebuilds with the new markers
|
||||
update();
|
||||
} catch (e, stackTrace) {
|
||||
if (isDrawingRoute) {
|
||||
|
||||
Reference in New Issue
Block a user