Skip to content
Merged
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
6 changes: 4 additions & 2 deletions flutter_map/lib/src/layer/marker_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ class Marker {
final WidgetBuilder builder;
final double width;
final double height;
final List<double> anchor;
Marker({
this.point,
this.builder,
this.width = 30.0,
this.height = 30.0,
this.anchor = const [15.0, 15.0]
});
}

Expand All @@ -40,8 +42,8 @@ class MarkerLayer extends StatelessWidget {
new Positioned(
width: markerOpt.width,
height: markerOpt.height,
left: (pos.x - markerOpt.width / 2).toDouble(),
top: (pos.y - markerOpt.height / 2).toDouble(),
left: (pos.x - (markerOpt.width - markerOpt.anchor[0])).toDouble(),
top: (pos.y - (markerOpt.height - markerOpt.anchor[1])).toDouble(),
child: markerOpt.builder(context),
),
);
Expand Down