Skip to content

Commit 6b32005

Browse files
committed
Reverting change to map_controller since I can not reproduce issue where drag would stop working when crossing date line.
1 parent 12ea190 commit 6b32005

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

lib/src/map/controller/map_controller_impl.dart

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -376,30 +376,7 @@ class MapControllerImpl extends ValueNotifier<_MapControllerState>
376376
void dragUpdated(MapEventSource source, Offset offset) {
377377
final oldCenterPt = camera.projectAtZoom(camera.center);
378378
final newCenterPt = oldCenterPt + offset;
379-
380-
// Account for world wrapping at 180/-180 boundary
381-
final LatLng newCenter;
382-
if (camera.crs.replicatesWorldLongitude) {
383-
final worldWidth = camera.getWorldWidthAtZoom();
384-
385-
// If worldWidth is 0, it means world replication is irrelevant
386-
if (worldWidth > 0) {
387-
// Apply the same logic used in fling animation for consistency
388-
final Offset bestCenterPoint;
389-
if (newCenterPt.dx > worldWidth) {
390-
bestCenterPoint = Offset(newCenterPt.dx - worldWidth, newCenterPt.dy);
391-
} else if (newCenterPt.dx < 0) {
392-
bestCenterPoint = Offset(newCenterPt.dx + worldWidth, newCenterPt.dy);
393-
} else {
394-
bestCenterPoint = newCenterPt;
395-
}
396-
newCenter = camera.unprojectAtZoom(bestCenterPoint);
397-
} else {
398-
newCenter = camera.unprojectAtZoom(newCenterPt);
399-
}
400-
} else {
401-
newCenter = camera.unprojectAtZoom(newCenterPt);
402-
}
379+
final newCenter = camera.unprojectAtZoom(newCenterPt);
403380

404381
moveRaw(
405382
newCenter,

0 commit comments

Comments
 (0)