Skip to content

Commit 25837e3

Browse files
Hari-07vashworth
authored andcommitted
[google_maps_flutter_platform_(web/android/ios)] Add a new zIndexInt param to marker and deprecate zIndex (flutter#9408)
*List which issues are fixed by this PR. You must list at least one issue.* This is just the `web`, `android` and `ios` package part of flutter#8012 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent dc4b4c4 commit 25837e3

File tree

18 files changed

+50
-27
lines changed

18 files changed

+50
-27
lines changed

packages/google_maps_flutter/google_maps_flutter_android/example/integration_test/google_maps_tests.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,6 +2009,7 @@ Marker _copyMarkerWithClusterManagerId(
20092009
position: marker.position,
20102010
rotation: marker.rotation,
20112011
visible: marker.visible,
2012+
// The deprecated parameter is used here to avoid losing precision.
20122013
zIndex: marker.zIndex,
20132014
onTap: marker.onTap,
20142015
onDragStart: marker.onDragStart,

packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.15.4
2+
3+
* Deprecates `zIndex` parameter in Marker in favor of `zIndexInt`.
4+
15
## 2.15.3
26

37
* Fixes new analysis warnings.

packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
# The example app is bundled with the plugin so we use a path dependency on
1919
# the parent directory to use the current plugin's version.
2020
path: ../../
21-
google_maps_flutter_platform_interface: ^2.11.0
21+
google_maps_flutter_platform_interface: ^2.12.1
2222
maps_example_dart:
2323
path: ../shared/maps_example_dart/
2424

packages/google_maps_flutter/google_maps_flutter_ios/example/ios15/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
# The example app is bundled with the plugin so we use a path dependency on
1919
# the parent directory to use the current plugin's version.
2020
path: ../../
21-
google_maps_flutter_platform_interface: ^2.11.0
21+
google_maps_flutter_platform_interface: ^2.12.1
2222
maps_example_dart:
2323
path: ../shared/maps_example_dart/
2424

packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/lib/place_marker.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ class PlaceMarkerBodyState extends State<PlaceMarkerBody> {
269269

270270
Future<void> _changeZIndex(MarkerId markerId) async {
271271
final Marker marker = markers[markerId]!;
272-
final double current = marker.zIndex;
272+
final int current = marker.zIndexInt;
273273
setState(() {
274274
markers[markerId] = marker.copyWith(
275-
zIndexParam: current == 12.0 ? 0.0 : current + 1.0,
275+
zIndexIntParam: current == 12 ? 0 : current + 1,
276276
);
277277
});
278278
}

packages/google_maps_flutter/google_maps_flutter_ios/example/shared/maps_example_dart/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
# The example app is bundled with the plugin so we use a path dependency on
1919
# the parent directory to use the current plugin's version.
2020
path: ../../../
21-
google_maps_flutter_platform_interface: ^2.11.0
21+
google_maps_flutter_platform_interface: ^2.12.1
2222

2323
dev_dependencies:
2424
flutter_test:

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapMarkerController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ - (void)updateFromPlatformMarker:(FGMPlatformMarker *)platformMarker
121121
[self setConsumeTapEvents:platformMarker.consumeTapEvents];
122122
[self setPosition:FGMGetCoordinateForPigeonLatLng(platformMarker.position)];
123123
[self setRotation:platformMarker.rotation];
124-
[self setZIndex:platformMarker.zIndex];
124+
[self setZIndex:(int)platformMarker.zIndex];
125125
FGMPlatformInfoWindow *infoWindow = platformMarker.infoWindow;
126126
[self setInfoWindowAnchor:FGMGetCGPointForPigeonPoint(infoWindow.anchor)];
127127
if (infoWindow.title) {

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v22.7.4), do not edit directly.
4+
// Autogenerated from Pigeon (v22.6.0), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
#import <Foundation/Foundation.h>
@@ -283,7 +283,7 @@ typedef NS_ENUM(NSUInteger, FGMPlatformMapBitmapScaling) {
283283
position:(FGMPlatformLatLng *)position
284284
rotation:(double)rotation
285285
visible:(BOOL)visible
286-
zIndex:(double)zIndex
286+
zIndex:(NSInteger)zIndex
287287
markerId:(NSString *)markerId
288288
clusterManagerId:(nullable NSString *)clusterManagerId;
289289
@property(nonatomic, assign) double alpha;
@@ -296,7 +296,7 @@ typedef NS_ENUM(NSUInteger, FGMPlatformMapBitmapScaling) {
296296
@property(nonatomic, strong) FGMPlatformLatLng *position;
297297
@property(nonatomic, assign) double rotation;
298298
@property(nonatomic, assign) BOOL visible;
299-
@property(nonatomic, assign) double zIndex;
299+
@property(nonatomic, assign) NSInteger zIndex;
300300
@property(nonatomic, copy) NSString *markerId;
301301
@property(nonatomic, copy, nullable) NSString *clusterManagerId;
302302
@end

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/messages.g.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2013 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
4-
// Autogenerated from Pigeon (v22.7.4), do not edit directly.
4+
// Autogenerated from Pigeon (v22.6.0), do not edit directly.
55
// See also: https://pub.dev/packages/pigeon
66

77
#import "messages.g.h"
@@ -725,7 +725,7 @@ + (instancetype)makeWithAlpha:(double)alpha
725725
position:(FGMPlatformLatLng *)position
726726
rotation:(double)rotation
727727
visible:(BOOL)visible
728-
zIndex:(double)zIndex
728+
zIndex:(NSInteger)zIndex
729729
markerId:(NSString *)markerId
730730
clusterManagerId:(nullable NSString *)clusterManagerId {
731731
FGMPlatformMarker *pigeonResult = [[FGMPlatformMarker alloc] init];
@@ -756,7 +756,7 @@ + (FGMPlatformMarker *)fromList:(NSArray<id> *)list {
756756
pigeonResult.position = GetNullableObjectAtIndex(list, 7);
757757
pigeonResult.rotation = [GetNullableObjectAtIndex(list, 8) doubleValue];
758758
pigeonResult.visible = [GetNullableObjectAtIndex(list, 9) boolValue];
759-
pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 10) doubleValue];
759+
pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 10) integerValue];
760760
pigeonResult.markerId = GetNullableObjectAtIndex(list, 11);
761761
pigeonResult.clusterManagerId = GetNullableObjectAtIndex(list, 12);
762762
return pigeonResult;

packages/google_maps_flutter/google_maps_flutter_ios/lib/src/google_maps_flutter_ios.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform {
678678
position: _platformLatLngFromLatLng(marker.position),
679679
rotation: marker.rotation,
680680
visible: marker.visible,
681-
zIndex: marker.zIndex,
681+
zIndex: marker.zIndexInt,
682682
markerId: marker.markerId.value,
683683
clusterManagerId: marker.clusterManagerId?.value,
684684
);

0 commit comments

Comments
 (0)