diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart index 952c381df53..4f54bfa1cc1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart @@ -2009,6 +2009,7 @@ Marker _copyMarkerWithClusterManagerId( position: marker.position, rotation: marker.rotation, visible: marker.visible, + // The deprecated parameter is used here to avoid losing precision. zIndex: marker.zIndex, onTap: marker.onTap, onDragStart: marker.onDragStart, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md index 532ebd289c6..5f48d675c98 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.15.4 + +* Deprecates `zIndex` parameter in Marker in favor of `zIndexInt`. + ## 2.15.3 * Fixes new analysis warnings. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml index 55e93119742..96319023995 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../../ - google_maps_flutter_platform_interface: ^2.11.0 + google_maps_flutter_platform_interface: ^2.12.1 maps_example_dart: path: ../shared/maps_example_dart/ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml index 55e93119742..96319023995 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../../ - google_maps_flutter_platform_interface: ^2.11.0 + google_maps_flutter_platform_interface: ^2.12.1 maps_example_dart: path: ../shared/maps_example_dart/ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_marker.dart b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_marker.dart index d282602d8dc..4291aec8c15 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_marker.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_marker.dart @@ -269,10 +269,10 @@ class PlaceMarkerBodyState extends State { Future _changeZIndex(MarkerId markerId) async { final Marker marker = markers[markerId]!; - final double current = marker.zIndex; + final int current = marker.zIndexInt; setState(() { markers[markerId] = marker.copyWith( - zIndexParam: current == 12.0 ? 0.0 : current + 1.0, + zIndexIntParam: current == 12 ? 0 : current + 1, ); }); } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml index ccfab1b92ff..d1404b7077b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../../../ - google_maps_flutter_platform_interface: ^2.11.0 + google_maps_flutter_platform_interface: ^2.12.1 dev_dependencies: flutter_test: diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapMarkerController.m b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapMarkerController.m index f86cb3620c2..d542f7f8ebe 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapMarkerController.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapMarkerController.m @@ -121,7 +121,7 @@ - (void)updateFromPlatformMarker:(FGMPlatformMarker *)platformMarker [self setConsumeTapEvents:platformMarker.consumeTapEvents]; [self setPosition:FGMGetCoordinateForPigeonLatLng(platformMarker.position)]; [self setRotation:platformMarker.rotation]; - [self setZIndex:platformMarker.zIndex]; + [self setZIndex:(int)platformMarker.zIndex]; FGMPlatformInfoWindow *infoWindow = platformMarker.infoWindow; [self setInfoWindowAnchor:FGMGetCGPointForPigeonPoint(infoWindow.anchor)]; if (infoWindow.title) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h index 0d1c3935e8a..48d44eac213 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.7.4), do not edit directly. +// Autogenerated from Pigeon (v22.6.0), do not edit directly. // See also: https://pub.dev/packages/pigeon #import @@ -283,7 +283,7 @@ typedef NS_ENUM(NSUInteger, FGMPlatformMapBitmapScaling) { position:(FGMPlatformLatLng *)position rotation:(double)rotation visible:(BOOL)visible - zIndex:(double)zIndex + zIndex:(NSInteger)zIndex markerId:(NSString *)markerId clusterManagerId:(nullable NSString *)clusterManagerId; @property(nonatomic, assign) double alpha; @@ -296,7 +296,7 @@ typedef NS_ENUM(NSUInteger, FGMPlatformMapBitmapScaling) { @property(nonatomic, strong) FGMPlatformLatLng *position; @property(nonatomic, assign) double rotation; @property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) double zIndex; +@property(nonatomic, assign) NSInteger zIndex; @property(nonatomic, copy) NSString *markerId; @property(nonatomic, copy, nullable) NSString *clusterManagerId; @end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m index ccf0735ec94..be83df3604b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.7.4), do not edit directly. +// Autogenerated from Pigeon (v22.6.0), do not edit directly. // See also: https://pub.dev/packages/pigeon #import "messages.g.h" @@ -725,7 +725,7 @@ + (instancetype)makeWithAlpha:(double)alpha position:(FGMPlatformLatLng *)position rotation:(double)rotation visible:(BOOL)visible - zIndex:(double)zIndex + zIndex:(NSInteger)zIndex markerId:(NSString *)markerId clusterManagerId:(nullable NSString *)clusterManagerId { FGMPlatformMarker *pigeonResult = [[FGMPlatformMarker alloc] init]; @@ -756,7 +756,7 @@ + (FGMPlatformMarker *)fromList:(NSArray *)list { pigeonResult.position = GetNullableObjectAtIndex(list, 7); pigeonResult.rotation = [GetNullableObjectAtIndex(list, 8) doubleValue]; pigeonResult.visible = [GetNullableObjectAtIndex(list, 9) boolValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 10) doubleValue]; + pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 10) integerValue]; pigeonResult.markerId = GetNullableObjectAtIndex(list, 11); pigeonResult.clusterManagerId = GetNullableObjectAtIndex(list, 12); return pigeonResult; diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart index ab76471fc19..de501b9f71d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart @@ -678,7 +678,7 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { position: _platformLatLngFromLatLng(marker.position), rotation: marker.rotation, visible: marker.visible, - zIndex: marker.zIndex, + zIndex: marker.zIndexInt, markerId: marker.markerId.value, clusterManagerId: marker.clusterManagerId?.value, ); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/messages.g.dart index c7b67e500c9..0a91b92465b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/lib/src/messages.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v22.7.4), do not edit directly. +// Autogenerated from Pigeon (v22.6.0), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers @@ -508,7 +508,7 @@ class PlatformMarker { required this.position, this.rotation = 0.0, this.visible = true, - this.zIndex = 0.0, + this.zIndex = 0, required this.markerId, this.clusterManagerId, }); @@ -533,7 +533,7 @@ class PlatformMarker { bool visible; - double zIndex; + int zIndex; String markerId; @@ -570,7 +570,7 @@ class PlatformMarker { position: result[7]! as PlatformLatLng, rotation: result[8]! as double, visible: result[9]! as bool, - zIndex: result[10]! as double, + zIndex: result[10]! as int, markerId: result[11]! as String, clusterManagerId: result[12] as String?, ); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_ios/pigeons/messages.dart index dcbe6691bd1..8f66adc44b8 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pigeons/messages.dart @@ -187,7 +187,7 @@ class PlatformMarker { required this.position, this.rotation = 0.0, this.visible = true, - this.zIndex = 0.0, + this.zIndex = 0, this.clusterManagerId, }); @@ -202,7 +202,7 @@ class PlatformMarker { final PlatformLatLng position; final double rotation; final bool visible; - final double zIndex; + final int zIndex; final String markerId; final String? clusterManagerId; } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml index f7397a4ddc3..519276f1101 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_ios description: iOS implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.15.3 +version: 2.15.4 environment: sdk: ^3.6.0 @@ -19,7 +19,7 @@ flutter: dependencies: flutter: sdk: flutter - google_maps_flutter_platform_interface: ^2.11.0 + google_maps_flutter_platform_interface: ^2.12.1 stream_transform: ^2.0.0 dev_dependencies: diff --git a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md index 41a9103221b..71dc609eadf 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_web/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 0.5.12+1 +* Deprecates `zIndex` parameter in Marker in favor of `zIndexInt`. * Updates minimum supported SDK version to Flutter 3.27/Dart 3.6. ## 0.5.12 diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/markers_test.dart b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/markers_test.dart index 45b218f139c..39e28509de7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/markers_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/markers_test.dart @@ -536,5 +536,20 @@ void main() { expect(icon2.anchor!.x, width * anchorOffset.dx); expect(icon2.anchor!.y, height * anchorOffset.dy); }); + + testWidgets('interpret correct zIndex in convertsion', + (WidgetTester tester) async { + const MarkerId markerId = MarkerId('1'); + + final Set markers = { + const Marker(markerId: markerId, zIndexInt: 4), + }; + + await controller.addMarkers(markers); + + final gmaps.Marker? gmMarker = controller.markers[markerId]?.marker; + expect(gmMarker, isNotNull); + expect(gmMarker!.zIndex, 4); + }); }); } diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml index f1f0b079fc6..6d404825bc7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml @@ -8,7 +8,7 @@ environment: dependencies: flutter: sdk: flutter - google_maps_flutter_platform_interface: ^2.10.0 + google_maps_flutter_platform_interface: ^2.12.1 google_maps_flutter_web: path: ../ web: ^1.0.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart index 88ae0fb849c..956ca751e93 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/lib/src/convert.dart @@ -272,6 +272,7 @@ gmaps.InfoWindowOptions? _infoWindowOptionsFromMarker(Marker marker) { return gmaps.InfoWindowOptions() ..content = container + // The deprecated parameter is used here to avoid losing precision. ..zIndex = marker.zIndex; // TODO(ditman): Compute the pixelOffset of the infoWindow, from the size of the Marker, // and the marker.infoWindow.anchor property. @@ -453,8 +454,8 @@ Future _gmIconFromBitmapDescriptor( return icon; } -// Computes the options for a new [gmaps.Marker] from an incoming set of options -// [marker], and the existing marker registered with the map: [currentMarker]. +/// Computes the options for a new [gmaps.Marker] from an incoming set of options +/// [marker], and the existing marker registered with the map: [currentMarker]. Future _markerOptionsFromMarker( Marker marker, gmaps.Marker? currentMarker, @@ -465,6 +466,7 @@ Future _markerOptionsFromMarker( marker.position.longitude, ) ..title = sanitizeHtml(marker.infoWindow.title ?? '') + // The deprecated parameter is used here to avoid losing precision. ..zIndex = marker.zIndex ..visible = marker.visible ..opacity = marker.alpha diff --git a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml index 5cbffaec962..c6e57e37f51 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_web description: Web platform implementation of google_maps_flutter repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 0.5.12 +version: 0.5.12+1 environment: sdk: ^3.6.0 @@ -23,7 +23,7 @@ dependencies: flutter_web_plugins: sdk: flutter google_maps: ^8.0.0 - google_maps_flutter_platform_interface: ^2.10.0 + google_maps_flutter_platform_interface: ^2.12.1 sanitize_html: ^2.0.0 stream_transform: ^2.0.0 web: ">=0.5.1 <2.0.0"