Skip to content

Commit 54ef96e

Browse files
authored
[google_maps_flutter] Support for Ground Overlay - platform interface (#8518)
This PR contains platform interface for the upcoming ground overlays support (#8432). Original PR with all the changes hasn't been approved yet but it was [okayed](#8432 (review)) to create the first sub-PR. I'm not the author of the original PR but helping @jokerttu while he's on vacation. Linked issue: flutter/flutter#26479
1 parent 45c1997 commit 54ef96e

File tree

12 files changed

+886
-8
lines changed

12 files changed

+886
-8
lines changed

packages/google_maps_flutter/google_maps_flutter_platform_interface/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## NEXT
1+
## 2.10.0
22

33
* Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
4+
* Adds support for ground overlay.
45

56
## 2.9.5
67

packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/events/map_event.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,14 @@ class CircleTapEvent extends MapEvent<CircleId> {
152152
CircleTapEvent(super.mapId, super.circleId);
153153
}
154154

155+
/// An event fired when a [GroundOverlay] is tapped.
156+
class GroundOverlayTapEvent extends MapEvent<GroundOverlayId> {
157+
/// Build a GroundOverlayTap Event triggered from the map represented by `mapId`.
158+
///
159+
/// The `value` of this event is a [GroundOverlayId] object that represents the tapped GroundOverlay.
160+
GroundOverlayTapEvent(super.mapId, super.croundOverlayId);
161+
}
162+
155163
/// An event fired when a Map is tapped.
156164
class MapTapEvent extends _PositionedMapEvent<void> {
157165
/// Build an MapTap Event triggered from the map represented by `mapId`.

packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/platform_interface/google_maps_flutter_platform.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ abstract class GoogleMapsFlutterPlatform extends PlatformInterface {
169169
'updateClusterManagers() has not been implemented.');
170170
}
171171

172+
/// Updates ground overlay configuration.
173+
///
174+
/// The returned [Future] completes once the update has been made on the
175+
/// platform side.
176+
Future<void> updateGroundOverlays(
177+
GroundOverlayUpdates groundOverlayUpdates, {
178+
required int mapId,
179+
}) {
180+
throw UnimplementedError(
181+
'updateGroundOverlays() has not been implemented.');
182+
}
183+
172184
/// Clears the tile cache so that all tiles will be requested again from the
173185
/// [TileProvider].
174186
///
@@ -389,6 +401,11 @@ abstract class GoogleMapsFlutterPlatform extends PlatformInterface {
389401
throw UnimplementedError('onClusterTap() has not been implemented.');
390402
}
391403

404+
/// A [GroundOverlay] has been tapped.
405+
Stream<GroundOverlayTapEvent> onGroundOverlayTap({required int mapId}) {
406+
throw UnimplementedError('onGroundOverlayTap() has not been implemented.');
407+
}
408+
392409
/// Dispose of whatever resources the `mapId` is holding on to.
393410
void dispose({required int mapId}) {
394411
throw UnimplementedError('dispose() has not been implemented.');

packages/google_maps_flutter/google_maps_flutter_platform_interface/lib/src/platform_interface/google_maps_inspector_platform.dart

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,7 @@ abstract class GoogleMapsInspectorPlatform extends PlatformInterface {
117117
}
118118

119119
/// If the platform supports getting information about heatmaps.
120-
bool supportsGettingHeatmapInfo() {
121-
throw UnimplementedError(
122-
'supportsGettingHeatmapInfo() has not been implemented.',
123-
);
124-
}
120+
bool supportsGettingHeatmapInfo() => false;
125121

126122
/// Returns information about the heatmap with the given ID.
127123
///
@@ -132,6 +128,20 @@ abstract class GoogleMapsInspectorPlatform extends PlatformInterface {
132128
throw UnimplementedError('getHeatmapInfo() has not been implemented.');
133129
}
134130

131+
/// If the platform supports getting information about ground overlays.
132+
bool supportsGettingGroundOverlayInfo() => false;
133+
134+
/// Returns information about the ground overlay with the given ID.
135+
///
136+
/// The returned object will be synthesized from platform data, so will not
137+
/// be the same Dart object as the original [GroundOverlay] provided to the
138+
/// platform interface with that ID, and not all fields will be populated.
139+
Future<GroundOverlay?> getGroundOverlayInfo(GroundOverlayId groundOverlayId,
140+
{required int mapId}) {
141+
throw UnimplementedError(
142+
'getGroundOverlayInfo() has not been implemented.');
143+
}
144+
135145
/// Returns current clusters from [ClusterManager].
136146
Future<List<Cluster>> getClusters(
137147
{required int mapId, required ClusterManagerId clusterManagerId}) {

0 commit comments

Comments
 (0)