Skip to content

Commit

Permalink
Merge pull request #4 from DISCOOS/issue/150
Browse files Browse the repository at this point in the history
Merge Issue/150 to master
  • Loading branch information
kengu committed Oct 26, 2018
2 parents 3ed9b8b + 747333c commit 47b3b1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/src/layer/circle_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import 'package:latlong/latlong.dart' hide Path; // conflict with Path from UI

class CircleLayerOptions extends LayerOptions {
final List<CircleMarker> circles;
CircleLayerOptions({this.circles = const []});
CircleLayerOptions({this.circles = const [], rebuild})
: super(rebuild: rebuild);
}

class CircleMarker {
Expand All @@ -29,7 +30,8 @@ class CircleMarker {
class CircleLayer extends StatelessWidget {
final CircleLayerOptions circleOpts;
final MapState map;
CircleLayer(this.circleOpts, this.map);
final Stream<Null> stream;
CircleLayer(this.circleOpts, this.map, this.stream);

Widget build(BuildContext context) {
return new LayoutBuilder(
Expand All @@ -42,7 +44,7 @@ class CircleLayer extends StatelessWidget {

Widget _build(BuildContext context, Size size) {
return new StreamBuilder<int>(
stream: map.onMoved, // a Stream<int> or null
stream: stream, // a Stream<int> or null
builder: (BuildContext context, _) {
var circleWidgets = <Widget>[];
for (var circle in circleOpts.circles) {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/map/flutter_map_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class FlutterMapState extends MapGestureMixin {
return new PolygonLayer(options, mapState, _merge(options));
}
if (options is CircleLayerOptions) {
return new CircleLayer(options, mapState);
return new CircleLayer(options, mapState, _merge(options));
}
for (var plugin in plugins) {
if (plugin.supportsLayer(options)) {
Expand Down

0 comments on commit 47b3b1a

Please sign in to comment.