Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/flutter_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/src/layer/marker_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/map/map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a better way would be to expose this method on MapControllerImpl and MapController instead. Their purpose is to expose the methods on MapState

Copy link
Copy Markdown
Contributor Author

@lpongetti lpongetti Jun 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inside a plugin theres mapstate and not mapcontroller. So i need getBoundsCenterZoom public from mapstate.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks for the clarification.

move(target.center, target.zoom);
}

Expand All @@ -161,7 +161,7 @@ class MapState {
);
}

CenterZoom _getBoundsCenterZoom(
CenterZoom getBoundsCenterZoom(
LatLngBounds bounds, FitBoundsOptions options) {
var paddingTL =
CustomPoint<double>(options.padding.left, options.padding.top);
Expand Down