Skip to content

Commit 17f16d4

Browse files
committed
Various bug fixes
1 parent dfee27f commit 17f16d4

File tree

8 files changed

+33
-29
lines changed

8 files changed

+33
-29
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## [0.0.1] - TODO: Add release date.
1+
# 0.1.0
22

3-
* TODO: Describe initial release.
3+
* Initial release.

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@ This package combines the [google_maps_flutter]("https://pub.dev/packages/google
88

99
# Screenshots
1010

11-
| Example 1 | Example 2 |
12-
| :---------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------: |
13-
| ![Example 1](https://github.com/LuisThein/apple_maps_flutter/blob/master/resources/example_img01.png) | ![Example 2](https://github.com/LuisThein/apple_maps_flutter/blob/master/resources/example_img02.png) |
11+
| Android | iOS |
12+
| :---------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: |
13+
| ![Example 1](https://github.com/LuisThein/apple_maps_flutter/blob/master/resources/android_screenshot1.png) | ![Example 2](https://github.com/LuisThein/apple_maps_flutter/blob/master/resources/ios_screenshot1.png) |
14+
| ![Example 1](https://github.com/LuisThein/apple_maps_flutter/blob/master/resources/android_screenshot2.png) | ![Example 2](https://github.com/LuisThein/apple_maps_flutter/blob/master/resources/ios_screenshot2.png) |
15+
16+
# Current functionality
17+
18+
- Camera movement including bearing, heading, tilt (also animated)
19+
- Markers, including custom marker images and Info windows
20+
- Different map types
21+
- Map manipulation, enable/disable gestures, show current location, show compass ...
22+
1423

1524
# iOS
1625

lib/src/platform_maps.dart

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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() {

lib/src/ui.dart

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,16 @@ class MinMaxZoomPreference
3030
/// The preferred maximum zoom level or null, if unbounded from above.
3131
final double maxZoom;
3232

33-
/// Unbounded zooming.
34-
static MinMaxZoomPreference get unbounded {
35-
if (Platform.isIOS) {
36-
return appleMaps.MinMaxZoomPreference.unbounded;
37-
} else if (Platform.isAndroid) {
38-
return googleMaps.MinMaxZoomPreference.unbounded;
39-
}
40-
return null;
41-
}
42-
4333
appleMaps.MinMaxZoomPreference get appleMapsZoomPreference =>
4434
appleMaps.MinMaxZoomPreference(this.maxZoom, this.maxZoom);
4535

4636
googleMaps.MinMaxZoomPreference get googleMapsZoomPreference =>
4737
googleMaps.MinMaxZoomPreference(this.maxZoom, this.maxZoom);
38+
39+
static appleMaps.MinMaxZoomPreference get appleMapsUnboundedZoomPreference =>
40+
appleMaps.MinMaxZoomPreference.unbounded;
41+
42+
static googleMaps.MinMaxZoomPreference
43+
get googleMapsUnboundedZoomPreference =>
44+
googleMaps.MinMaxZoomPreference.unbounded;
4845
}

resources/android_screenshot1.png

7.8 MB
Loading

resources/android_screenshot2.png

710 KB
Loading

resources/ios_screenshot1.png

6.15 MB
Loading

resources/ios_screenshot2.png

933 KB
Loading

0 commit comments

Comments
 (0)