@@ -2,7 +2,6 @@ part of flutter_platform_maps;
22
33typedef void MapCreatedCallback (PlatformMapController controller);
44
5- /// A Calculator.
65class PlatformMap extends StatefulWidget {
76 const PlatformMap ({
87 Key key,
@@ -19,6 +18,7 @@ class PlatformMap extends StatefulWidget {
1918 this .myLocationEnabled = false ,
2019 this .myLocationButtonEnabled = true ,
2120 this .markers,
21+ this .polylines,
2222 this .onCameraMoveStarted,
2323 this .onCameraMove,
2424 this .onCameraIdle,
@@ -62,6 +62,9 @@ class PlatformMap extends StatefulWidget {
6262 /// Markers to be placed on the map.
6363 final Set <Marker > markers;
6464
65+ /// Polylines to be placed on the map.
66+ final Set <Polyline > polylines;
67+
6568 /// Called when the camera starts moving.
6669 ///
6770 /// This can be initiated by the following:
@@ -150,7 +153,12 @@ class _PlatformMapState extends State<PlatformMap> {
150153 widget.initialCameraPosition.googleMapsCameraPosition,
151154 compassEnabled: widget.compassEnabled,
152155 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,
154162 gestureRecognizers: widget.gestureRecognizers,
155163 onCameraIdle: widget.onCameraIdle,
156164 myLocationButtonEnabled: widget.myLocationButtonEnabled,
@@ -175,7 +183,12 @@ class _PlatformMapState extends State<PlatformMap> {
175183 widget.initialCameraPosition.appleMapsCameraPosition,
176184 compassEnabled: widget.compassEnabled,
177185 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,
179192 gestureRecognizers: widget.gestureRecognizers,
180193 onCameraIdle: widget.onCameraIdle,
181194 myLocationButtonEnabled: widget.myLocationButtonEnabled,
0 commit comments