@@ -2,7 +2,6 @@ part of flutter_platform_maps;
2
2
3
3
typedef void MapCreatedCallback (PlatformMapController controller);
4
4
5
- /// A Calculator.
6
5
class PlatformMap extends StatefulWidget {
7
6
const PlatformMap ({
8
7
Key key,
@@ -19,6 +18,7 @@ class PlatformMap extends StatefulWidget {
19
18
this .myLocationEnabled = false ,
20
19
this .myLocationButtonEnabled = true ,
21
20
this .markers,
21
+ this .polylines,
22
22
this .onCameraMoveStarted,
23
23
this .onCameraMove,
24
24
this .onCameraIdle,
@@ -62,6 +62,9 @@ class PlatformMap extends StatefulWidget {
62
62
/// Markers to be placed on the map.
63
63
final Set <Marker > markers;
64
64
65
+ /// Polylines to be placed on the map.
66
+ final Set <Polyline > polylines;
67
+
65
68
/// Called when the camera starts moving.
66
69
///
67
70
/// This can be initiated by the following:
@@ -150,7 +153,12 @@ class _PlatformMapState extends State<PlatformMap> {
150
153
widget.initialCameraPosition.googleMapsCameraPosition,
151
154
compassEnabled: widget.compassEnabled,
152
155
mapType: _getGoogleMapType (),
153
- markers: Marker .toGoogleMapsMarkerSet (widget.markers),
156
+ markers: widget.markers != null
157
+ ? Marker .toGoogleMapsMarkerSet (widget.markers)
158
+ : widget.markers,
159
+ polylines: widget.polylines != null
160
+ ? Polyline .toGoogleMapsPolylines (widget.polylines)
161
+ : widget.polylines,
154
162
gestureRecognizers: widget.gestureRecognizers,
155
163
onCameraIdle: widget.onCameraIdle,
156
164
myLocationButtonEnabled: widget.myLocationButtonEnabled,
@@ -175,7 +183,12 @@ class _PlatformMapState extends State<PlatformMap> {
175
183
widget.initialCameraPosition.appleMapsCameraPosition,
176
184
compassEnabled: widget.compassEnabled,
177
185
mapType: _getAppleMapType (),
178
- annotations: Marker .toAppleMapsAnnotationSet (widget.markers),
186
+ annotations: widget.markers != null
187
+ ? Marker .toAppleMapsAnnotationSet (widget.markers)
188
+ : widget.markers,
189
+ polylines: widget.polylines != null
190
+ ? Polyline .toAppleMapsPolylines (widget.polylines)
191
+ : widget.polylines,
179
192
gestureRecognizers: widget.gestureRecognizers,
180
193
onCameraIdle: widget.onCameraIdle,
181
194
myLocationButtonEnabled: widget.myLocationButtonEnabled,
0 commit comments