File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed
Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff 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,
You can’t perform that action at this time.
0 commit comments