diff --git a/lib/src/layer/polygon_layer/label.dart b/lib/src/layer/polygon_layer/label.dart index ee9ff0f80..65b9b99ba 100644 --- a/lib/src/layer/polygon_layer/label.dart +++ b/lib/src/layer/polygon_layer/label.dart @@ -77,8 +77,8 @@ LatLng _computeCentroid(List points) { LatLng _computePolylabel(List points) { final labelPosition = polylabel( [ - List.generate(points.length, - (i) => Offset(points[i].longitude, points[i].latitude)), + List>.generate(points.length, + (i) => Point(points[i].longitude, points[i].latitude)), ], // "precision" is a bit of a misnomer. It's a threshold for when to stop // dividing-and-conquering the polygon in the hopes of finding a better diff --git a/lib/src/layer/polygon_layer/polygon_layer.dart b/lib/src/layer/polygon_layer/polygon_layer.dart index a32678fe8..f048fe23c 100644 --- a/lib/src/layer/polygon_layer/polygon_layer.dart +++ b/lib/src/layer/polygon_layer/polygon_layer.dart @@ -1,3 +1,4 @@ +import 'dart:math'; import 'dart:ui'; import 'package:collection/collection.dart';