@@ -12,7 +12,6 @@ class PlatformMap extends StatefulWidget {
12
12
this .compassEnabled = true ,
13
13
this .trafficEnabled = false ,
14
14
this .mapType,
15
- // this.trackingMode = TrackingMode.none,
16
15
this .rotateGesturesEnabled = true ,
17
16
this .scrollGesturesEnabled = true ,
18
17
this .zoomGesturesEnabled = true ,
@@ -43,9 +42,6 @@ class PlatformMap extends StatefulWidget {
43
42
/// True if the map should display the current traffic.
44
43
final bool trafficEnabled;
45
44
46
- /// The mode used to track the user location.
47
- // final TrackingMode trackingMode;
48
-
49
45
/// Preferred bounds for the camera zoom level.
50
46
///
51
47
/// Actual bounds depend on map data and device.
@@ -127,8 +123,6 @@ class PlatformMap extends StatefulWidget {
127
123
/// By default, the my-location button is enabled (and hence shown when the
128
124
/// my-location layer is enabled).
129
125
///
130
- /// See also:
131
- /// * [myLocationEnabled] parameter.
132
126
final bool myLocationButtonEnabled;
133
127
134
128
/// Which gestures should be consumed by the map.
@@ -171,9 +165,9 @@ class _PlatformMapState extends State<PlatformMap> {
171
165
onTap: widget.onTap,
172
166
onLongPress: widget.onLongPress,
173
167
trafficEnabled: widget.trafficEnabled,
174
- minMaxZoomPreference:
175
- widget.minMaxZoomPreference.googleMapsZoomPreference ??
176
- MinMaxZoomPreference .unbounded ,
168
+ minMaxZoomPreference: widget.minMaxZoomPreference != null
169
+ ? widget.minMaxZoomPreference.googleMapsZoomPreference
170
+ : MinMaxZoomPreference .googleMapsUnboundedZoomPreference ,
177
171
);
178
172
} else if (Platform .isIOS) {
179
173
return appleMaps.AppleMap (
@@ -196,21 +190,25 @@ class _PlatformMapState extends State<PlatformMap> {
196
190
onTap: widget.onTap,
197
191
onLongPress: widget.onLongPress,
198
192
trafficEnabled: widget.trafficEnabled,
199
- minMaxZoomPreference:
200
- widget.minMaxZoomPreference.appleMapsZoomPreference ??
201
- MinMaxZoomPreference .unbounded ,
193
+ minMaxZoomPreference: widget.minMaxZoomPreference != null
194
+ ? widget.minMaxZoomPreference.appleMapsZoomPreference
195
+ : MinMaxZoomPreference .appleMapsUnboundedZoomPreference ,
202
196
);
203
197
} else {
204
198
return Text ("Platform not yet implemented" );
205
199
}
206
200
}
207
201
208
202
_onGoogleMapCreated (googleMaps.GoogleMapController controller) {
209
- widget.onMapCreated (PlatformMapController (controller));
203
+ if (widget.onMapCreated != null ) {
204
+ widget.onMapCreated (PlatformMapController (controller));
205
+ }
210
206
}
211
207
212
208
_onAppleMapCreated (appleMaps.AppleMapController controller) {
213
- widget.onMapCreated (PlatformMapController (controller));
209
+ if (widget.onMapCreated != null ) {
210
+ widget.onMapCreated (PlatformMapController (controller));
211
+ }
214
212
}
215
213
216
214
appleMaps.MapType _getAppleMapType () {
0 commit comments