Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to this file can be reverted as well; we don't need to CHANGELOG an integration test comment.

Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Deprecates `zIndex` parameter in Marker in favor of `zIndexInt`.

## 2.16.1

* Removes obsolete code related to supporting SDK <21.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 2.15.3

* Deprecates `zIndex` parameter in Marker in favor of `zIndexInt`.
* Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.

## 2.15.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ class PlaceMarkerBodyState extends State<PlaceMarkerBody> {

Future<void> _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,
);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <Foundation/Foundation.h>
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -756,7 +756,7 @@ + (FGMPlatformMarker *)fromList:(NSArray<id> *)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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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,
});
Expand All @@ -533,7 +533,7 @@ class PlatformMarker {

bool visible;

double zIndex;
int zIndex;

String markerId;

Expand Down Expand Up @@ -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?,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});

Expand All @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.2
version: 2.15.3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, the only change to this package is to a file in the example app that's not the one visible on pub.dev, so this should be exempt from versioning.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, why is only the example changing for iOS? Shouldn't it be using zIndexInt instead of the deprecated zIndex now, since it can't use any fractional values anyway?

Copy link
Contributor Author

@Hari-07 Hari-07 Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, not sure how that ended up getting removed or at what point. I think the reasonable thing to do would be to make ios's PlatformMarker expect an integral zIndex, so that this truncation would now be a type error to which we can pass zIndexInt

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, the iOS changes look good here.

Based on the CI failure though, it appears that the Obj-C compiler flags 64-bit int assignment to 32-bit int assignment as lossy, but did not flag it when it was assigning a double to a 32-bit int. Odd, but you'll need to add an explicit cast here to make the analysis check happy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's seems reasonable from flags.
-Wno-float-conversion looks like it allows implicit float conversion which is what was happening
-Wshorten-64-to-32 would disallow the long to int cast that's happening at the line you pointed out


environment:
sdk: ^3.6.0
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Marker> markers = <Marker>{
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);
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -453,8 +454,8 @@ Future<gmaps.Icon?> _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<gmaps.MarkerOptions> _markerOptionsFromMarker(
Marker marker,
gmaps.Marker? currentMarker,
Expand All @@ -465,6 +466,7 @@ Future<gmaps.MarkerOptions> _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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down