@@ -15,11 +15,11 @@ class LayersMixedPage extends StatefulWidget {
1515
1616class _LayersMixedPageState extends State <LayersMixedPage > {
1717 final _random = Random .secure ();
18- final _circlePoints = < Point > [
19- const Point (Geographic (lon: 9.17 , lat: 47.68 )),
20- const Point (Geographic (lon: 9.17 , lat: 48 )),
21- const Point (Geographic (lon: 9 , lat: 48 )),
22- const Point (Geographic (lon: 9.5 , lat: 48 )),
18+ final _circlePoints = < Feature < Point > > [
19+ const Feature (geometry : Point (Geographic (lon: 9.17 , lat: 47.68 ) )),
20+ const Feature (geometry : Point (Geographic (lon: 9.17 , lat: 48 ) )),
21+ const Feature (geometry : Point (Geographic (lon: 9 , lat: 48 ) )),
22+ const Feature (geometry : Point (Geographic (lon: 9.5 , lat: 48 ) )),
2323 ];
2424 Color _circleColor = Colors .orange.withValues (alpha: 0.5 );
2525 PolylineLayer ? _polylineLayer;
@@ -56,12 +56,14 @@ class _LayersMixedPageState extends State<LayersMixedPage> {
5656 if (_polylineLayer == null ) {
5757 _polylineLayer = PolylineLayer (
5858 polylines: [
59- LineString .from (
60- const [
61- Geographic (lon: 9.17 , lat: 47.68 ),
62- Geographic (lon: 9.5 , lat: 48 ),
63- Geographic (lon: 9 , lat: 48 ),
64- ],
59+ Feature (
60+ geometry: LineString .from (
61+ const [
62+ Geographic (lon: 9.17 , lat: 47.68 ),
63+ Geographic (lon: 9.5 , lat: 48 ),
64+ Geographic (lon: 9 , lat: 48 ),
65+ ],
66+ ),
6567 ),
6668 ],
6769 );
@@ -87,7 +89,7 @@ class _LayersMixedPageState extends State<LayersMixedPage> {
8789 onEvent: (event) {
8890 if (event case MapEventClick ()) {
8991 setState (() {
90- _circlePoints.add (Point (event.point));
92+ _circlePoints.add (Feature (geometry : Point (event.point) ));
9193 });
9294 }
9395 },
0 commit comments