From e3dab739b5f9634a2cfb251befb13d3586d2b8fe Mon Sep 17 00:00:00 2001 From: lorenzo Date: Tue, 4 Jun 2019 16:08:14 +0200 Subject: [PATCH 1/2] expose centerzoom and public getBoundsCenterZoom --- lib/flutter_map.dart | 1 + lib/src/map/map.dart | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/flutter_map.dart b/lib/flutter_map.dart index 84d7705f6..8351c54c1 100644 --- a/lib/flutter_map.dart +++ b/lib/flutter_map.dart @@ -24,6 +24,7 @@ export 'src/layer/polygon_layer.dart'; export 'src/layer/polyline_layer.dart'; export 'src/layer/tile_layer.dart'; export 'src/plugins/plugin.dart'; +export 'src/core/center_zoom.dart'; class FlutterMap extends StatefulWidget { /// A set of layers' options to used to create the layers on the map diff --git a/lib/src/map/map.dart b/lib/src/map/map.dart index c70312b09..fb916c0fc 100644 --- a/lib/src/map/map.dart +++ b/lib/src/map/map.dart @@ -134,7 +134,7 @@ class MapState { if (!bounds.isValid) { throw Exception('Bounds are not valid.'); } - var target = _getBoundsCenterZoom(bounds, options); + var target = getBoundsCenterZoom(bounds, options); move(target.center, target.zoom); } @@ -161,7 +161,7 @@ class MapState { ); } - CenterZoom _getBoundsCenterZoom( + CenterZoom getBoundsCenterZoom( LatLngBounds bounds, FitBoundsOptions options) { var paddingTL = CustomPoint(options.padding.left, options.padding.top); From 231b4bfcacb6a0e6f353348d09e22a86b2ed07c2 Mon Sep 17 00:00:00 2001 From: lorenzo Date: Wed, 5 Jun 2019 12:07:17 +0200 Subject: [PATCH 2/2] Anchor._forPos to Anchor.forPos --- lib/src/layer/marker_layer.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/layer/marker_layer.dart b/lib/src/layer/marker_layer.dart index dec91a149..a55c28d10 100644 --- a/lib/src/layer/marker_layer.dart +++ b/lib/src/layer/marker_layer.dart @@ -47,7 +47,7 @@ class Anchor { } } - factory Anchor._forPos(AnchorPos pos, double width, double height) { + factory Anchor.forPos(AnchorPos pos, double width, double height) { if (pos == null) return Anchor._(width, height, null); if (pos.value is AnchorAlign) return Anchor._(width, height, pos.value); if (pos.value is Anchor) return pos.value; @@ -83,7 +83,7 @@ class Marker { this.width = 30.0, this.height = 30.0, AnchorPos anchorPos, - }) : anchor = Anchor._forPos(anchorPos, width, height); + }) : anchor = Anchor.forPos(anchorPos, width, height); } class MarkerLayer extends StatelessWidget {