Update: 2026-06-26 04:04:03
This commit is contained in:
@@ -482,7 +482,19 @@ class LocationSearchController extends GetxController {
|
||||
bool _pendingGeocode = true;
|
||||
|
||||
void updateCurrentLocationFromCamera(LatLng target) {
|
||||
Log.print('📍 updateCurrentLocationFromCamera: $target');
|
||||
// ✅ FIX P3: Guard — تجاهل التحديثات إذا كانت المسافة < 20 متر
|
||||
final double distanceDelta = Geolocator.distanceBetween(
|
||||
newMyLocation.latitude,
|
||||
newMyLocation.longitude,
|
||||
target.latitude,
|
||||
target.longitude,
|
||||
);
|
||||
if (distanceDelta < 20.0) {
|
||||
Log.print('📍 updateCurrentLocationFromCamera: Skipped (المسافة ${distanceDelta.toStringAsFixed(1)}م < 20م)');
|
||||
return;
|
||||
}
|
||||
|
||||
Log.print('📍 updateCurrentLocationFromCamera: $target (تغيير ${distanceDelta.toStringAsFixed(1)}م)');
|
||||
newMyLocation = target;
|
||||
|
||||
if (_pendingGeocode) {
|
||||
@@ -522,7 +534,16 @@ class LocationSearchController extends GetxController {
|
||||
void onCameraMoveThrottled(CameraPosition pos) {
|
||||
_camThrottle?.cancel();
|
||||
_camThrottle = Timer(const Duration(milliseconds: 160), () {
|
||||
Log.print('📸 onCameraMoveThrottled: ${pos.target}');
|
||||
// ✅ FIX P3: Guard — تجاهل التحديث إذا كان التغيير ضئيلاً (< 20م)
|
||||
final double distanceDelta = Geolocator.distanceBetween(
|
||||
newMyLocation.latitude,
|
||||
newMyLocation.longitude,
|
||||
pos.target.latitude,
|
||||
pos.target.longitude,
|
||||
);
|
||||
if (distanceDelta < 20.0) return;
|
||||
|
||||
Log.print('📸 onCameraMoveThrottled: ${pos.target} (تغيير ${distanceDelta.toStringAsFixed(1)}م)');
|
||||
int waypointsLength = Get.find<WayPointController>().wayPoints.length;
|
||||
int index = wayPointIndex;
|
||||
if (waypointsLength > 0 && index < placesCoordinate.length) {
|
||||
|
||||
Reference in New Issue
Block a user