diff --git a/lib/src/layer/polyline_layer/painter.dart b/lib/src/layer/polyline_layer/painter.dart index ca5fdc87b..d47c45671 100644 --- a/lib/src/layer/polyline_layer/painter.dart +++ b/lib/src/layer/polyline_layer/painter.dart @@ -107,8 +107,7 @@ base class _PolylinePainter paint = Paint(); } - final origin = - camera.project(camera.center) - camera.size / 2; + final origin = camera.project(camera.center) - camera.size / 2; for (final projectedPolyline in polylines) { final polyline = projectedPolyline.polyline; diff --git a/lib/src/layer/polyline_layer/polyline_layer.dart b/lib/src/layer/polyline_layer/polyline_layer.dart index 615362ffb..18a5161a3 100644 --- a/lib/src/layer/polyline_layer/polyline_layer.dart +++ b/lib/src/layer/polyline_layer/polyline_layer.dart @@ -157,7 +157,8 @@ class _PolylineLayerState extends State> final p1 = projectedPolyline.points[i]; final p2 = projectedPolyline.points[i + 1]; - containsSegment = projBounds.aabbContainsLine(p1.dx, p1.dy, p2.dx, p2.dy); + containsSegment = + projBounds.aabbContainsLine(p1.dx, p1.dy, p2.dx, p2.dy); if (containsSegment) { if (start == -1) { start = i; diff --git a/lib/src/layer/tile_layer/tile_bounds/tile_bounds.dart b/lib/src/layer/tile_layer/tile_bounds/tile_bounds.dart index 27b370a3a..5f66bb9be 100644 --- a/lib/src/layer/tile_layer/tile_bounds/tile_bounds.dart +++ b/lib/src/layer/tile_layer/tile_bounds/tile_bounds.dart @@ -138,23 +138,27 @@ class WrappedTileBounds extends TileBounds { (int, int)? wrapX; if (crs.wrapLng case final wrapLng?) { - final wrapXMin = (crs.latLngToPoint(LatLng(0, wrapLng.$1), zoomDouble).dx / - _tileDimension) - .floor(); - final wrapXMax = (crs.latLngToPoint(LatLng(0, wrapLng.$2), zoomDouble).dx / - _tileDimension) - .ceil(); + final wrapXMin = + (crs.latLngToPoint(LatLng(0, wrapLng.$1), zoomDouble).dx / + _tileDimension) + .floor(); + final wrapXMax = + (crs.latLngToPoint(LatLng(0, wrapLng.$2), zoomDouble).dx / + _tileDimension) + .ceil(); wrapX = (wrapXMin, wrapXMax - 1); } (int, int)? wrapY; if (crs.wrapLat case final wrapLat?) { - final wrapYMin = (crs.latLngToPoint(LatLng(wrapLat.$1, 0), zoomDouble).dy / - _tileDimension) - .floor(); - final wrapYMax = (crs.latLngToPoint(LatLng(wrapLat.$2, 0), zoomDouble).dy / - _tileDimension) - .ceil(); + final wrapYMin = + (crs.latLngToPoint(LatLng(wrapLat.$1, 0), zoomDouble).dy / + _tileDimension) + .floor(); + final wrapYMax = + (crs.latLngToPoint(LatLng(wrapLat.$2, 0), zoomDouble).dy / + _tileDimension) + .ceil(); wrapY = (wrapYMin, wrapYMax - 1); } diff --git a/lib/src/map/camera/camera_fit.dart b/lib/src/map/camera/camera_fit.dart index cb72df35c..fe3d1ec2f 100644 --- a/lib/src/map/camera/camera_fit.dart +++ b/lib/src/map/camera/camera_fit.dart @@ -435,8 +435,8 @@ class FitCoordinates extends CameraFit { final projectedPoints = coordinates.map((coord) => camera.project(coord, newZoom)); - final rotatedPoints = projectedPoints - .map((point) => point.rotate(-camera.rotationRad)); + final rotatedPoints = + projectedPoints.map((point) => point.rotate(-camera.rotationRad)); final rotatedBounds = Bounds.containing(rotatedPoints); @@ -467,8 +467,8 @@ class FitCoordinates extends CameraFit { for (final coord in coordinates) camera.project(coord) ]; - final rotatedPoints = projectedPoints - .map((point) => point.rotate(-camera.rotationRad)); + final rotatedPoints = + projectedPoints.map((point) => point.rotate(-camera.rotationRad)); final rotatedBounds = Bounds.containing(rotatedPoints); final boundsSize = rotatedBounds.size; diff --git a/lib/src/misc/extensions.dart b/lib/src/misc/extensions.dart index 4f7fc5e44..d9f145a54 100644 --- a/lib/src/misc/extensions.dart +++ b/lib/src/misc/extensions.dart @@ -24,13 +24,11 @@ extension PointExtension on Point { } /// Converts to offset - Offset toOffset () => Offset(x.toDouble(), y.toDouble()); - + Offset toOffset() => Offset(x.toDouble(), y.toDouble()); } /// Extension methods for [Offset] extension OffsetToPointExtension on Offset { - /// Creates a [Point] representation of this offset. This is ONLY used for backwards compatibility @Deprecated('Only used for backwards compatibility') Point toPoint() => Point(dx, dy); @@ -50,5 +48,4 @@ extension OffsetToPointExtension on Offset { /// returns new [Offset] where roundToDouble() is called on [dx] and [dy] independently Offset round() => Offset(dx.roundToDouble(), dy.roundToDouble()); - }