@@ -12,7 +12,6 @@ class PlatformMap extends StatefulWidget {
1212 this .compassEnabled = true ,
1313 this .trafficEnabled = false ,
1414 this .mapType,
15- // this.trackingMode = TrackingMode.none,
1615 this .rotateGesturesEnabled = true ,
1716 this .scrollGesturesEnabled = true ,
1817 this .zoomGesturesEnabled = true ,
@@ -43,9 +42,6 @@ class PlatformMap extends StatefulWidget {
4342 /// True if the map should display the current traffic.
4443 final bool trafficEnabled;
4544
46- /// The mode used to track the user location.
47- // final TrackingMode trackingMode;
48-
4945 /// Preferred bounds for the camera zoom level.
5046 ///
5147 /// Actual bounds depend on map data and device.
@@ -127,8 +123,6 @@ class PlatformMap extends StatefulWidget {
127123 /// By default, the my-location button is enabled (and hence shown when the
128124 /// my-location layer is enabled).
129125 ///
130- /// See also:
131- /// * [myLocationEnabled] parameter.
132126 final bool myLocationButtonEnabled;
133127
134128 /// Which gestures should be consumed by the map.
@@ -171,9 +165,9 @@ class _PlatformMapState extends State<PlatformMap> {
171165 onTap: widget.onTap,
172166 onLongPress: widget.onLongPress,
173167 trafficEnabled: widget.trafficEnabled,
174- minMaxZoomPreference:
175- widget.minMaxZoomPreference.googleMapsZoomPreference ??
176- MinMaxZoomPreference .unbounded ,
168+ minMaxZoomPreference: widget.minMaxZoomPreference != null
169+ ? widget.minMaxZoomPreference.googleMapsZoomPreference
170+ : MinMaxZoomPreference .googleMapsUnboundedZoomPreference ,
177171 );
178172 } else if (Platform .isIOS) {
179173 return appleMaps.AppleMap (
@@ -196,21 +190,25 @@ class _PlatformMapState extends State<PlatformMap> {
196190 onTap: widget.onTap,
197191 onLongPress: widget.onLongPress,
198192 trafficEnabled: widget.trafficEnabled,
199- minMaxZoomPreference:
200- widget.minMaxZoomPreference.appleMapsZoomPreference ??
201- MinMaxZoomPreference .unbounded ,
193+ minMaxZoomPreference: widget.minMaxZoomPreference != null
194+ ? widget.minMaxZoomPreference.appleMapsZoomPreference
195+ : MinMaxZoomPreference .appleMapsUnboundedZoomPreference ,
202196 );
203197 } else {
204198 return Text ("Platform not yet implemented" );
205199 }
206200 }
207201
208202 _onGoogleMapCreated (googleMaps.GoogleMapController controller) {
209- widget.onMapCreated (PlatformMapController (controller));
203+ if (widget.onMapCreated != null ) {
204+ widget.onMapCreated (PlatformMapController (controller));
205+ }
210206 }
211207
212208 _onAppleMapCreated (appleMaps.AppleMapController controller) {
213- widget.onMapCreated (PlatformMapController (controller));
209+ if (widget.onMapCreated != null ) {
210+ widget.onMapCreated (PlatformMapController (controller));
211+ }
214212 }
215213
216214 appleMaps.MapType _getAppleMapType () {
0 commit comments