Skip to content

[google_maps_flutter] Support for Ground Overlay - platform interface #8518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## NEXT
## 2.10.0

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

## 2.9.5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ class CircleTapEvent extends MapEvent<CircleId> {
CircleTapEvent(super.mapId, super.circleId);
}

/// An event fired when a [GroundOverlay] is tapped.
class GroundOverlayTapEvent extends MapEvent<GroundOverlayId> {
/// Build a GroundOverlayTap Event triggered from the map represented by `mapId`.
///
/// The `value` of this event is a [GroundOverlayId] object that represents the tapped GroundOverlay.
GroundOverlayTapEvent(super.mapId, super.croundOverlayId);
}

/// An event fired when a Map is tapped.
class MapTapEvent extends _PositionedMapEvent<void> {
/// Build an MapTap Event triggered from the map represented by `mapId`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@ abstract class GoogleMapsFlutterPlatform extends PlatformInterface {
'updateClusterManagers() has not been implemented.');
}

/// Updates ground overlay configuration.
///
/// The returned [Future] completes once the update has been made on the
/// platform side.
Future<void> updateGroundOverlays(
GroundOverlayUpdates groundOverlayUpdates, {
required int mapId,
}) {
throw UnimplementedError(
'updateGroundOverlays() has not been implemented.');
}

/// Clears the tile cache so that all tiles will be requested again from the
/// [TileProvider].
///
Expand Down Expand Up @@ -389,6 +401,11 @@ abstract class GoogleMapsFlutterPlatform extends PlatformInterface {
throw UnimplementedError('onClusterTap() has not been implemented.');
}

/// A [GroundOverlay] has been tapped.
Stream<GroundOverlayTapEvent> onGroundOverlayTap({required int mapId}) {
throw UnimplementedError('onGroundOverlayTap() has not been implemented.');
}

/// Dispose of whatever resources the `mapId` is holding on to.
void dispose({required int mapId}) {
throw UnimplementedError('dispose() has not been implemented.');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,7 @@ abstract class GoogleMapsInspectorPlatform extends PlatformInterface {
}

/// If the platform supports getting information about heatmaps.
bool supportsGettingHeatmapInfo() {
throw UnimplementedError(
'supportsGettingHeatmapInfo() has not been implemented.',
);
}
bool supportsGettingHeatmapInfo() => false;

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

/// If the platform supports getting information about ground overlays.
bool supportsGettingGroundOverlayInfo() => false;

/// Returns information about the ground overlay with the given ID.
///
/// The returned object will be synthesized from platform data, so will not
/// be the same Dart object as the original [GroundOverlay] provided to the
/// platform interface with that ID, and not all fields will be populated.
Future<GroundOverlay?> getGroundOverlayInfo(GroundOverlayId groundOverlayId,
{required int mapId}) {
throw UnimplementedError(
'getGroundOverlayInfo() has not been implemented.');
}

/// Returns current clusters from [ClusterManager].
Future<List<Cluster>> getClusters(
{required int mapId, required ClusterManagerId clusterManagerId}) {
Expand Down
Loading