|
3 | 3 | // found in the LICENSE file.
|
4 | 4 |
|
5 | 5 | import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart';
|
| 6 | +import '../google_maps_flutter_web.dart'; |
6 | 7 |
|
7 | 8 | /// Function that gets the [MapConfiguration] for a given `mapId`.
|
8 | 9 | typedef ConfigurationProvider = MapConfiguration Function(int mapId);
|
9 | 10 |
|
| 11 | +/// Function that gets the [ClusterManagersController] for a given `mapId`. |
| 12 | +typedef ClusterManagersControllerProvider = ClusterManagersController? Function( |
| 13 | + int mapId); |
| 14 | + |
10 | 15 | /// This platform implementation allows inspecting the running maps.
|
11 | 16 | class GoogleMapsInspectorWeb extends GoogleMapsInspectorPlatform {
|
12 | 17 | /// Build an "inspector" that is able to look into maps.
|
13 |
| - GoogleMapsInspectorWeb(ConfigurationProvider configurationProvider) |
14 |
| - : _configurationProvider = configurationProvider; |
| 18 | + GoogleMapsInspectorWeb(ConfigurationProvider configurationProvider, |
| 19 | + ClusterManagersControllerProvider clusterManagersControllerProvider) |
| 20 | + : _configurationProvider = configurationProvider, |
| 21 | + _clusterManagersControllerProvider = clusterManagersControllerProvider; |
15 | 22 |
|
16 | 23 | final ConfigurationProvider _configurationProvider;
|
| 24 | + final ClusterManagersControllerProvider _clusterManagersControllerProvider; |
17 | 25 |
|
18 | 26 | @override
|
19 | 27 | Future<bool> areBuildingsEnabled({required int mapId}) async {
|
@@ -85,4 +93,14 @@ class GoogleMapsInspectorWeb extends GoogleMapsInspectorPlatform {
|
85 | 93 | Future<bool> isTrafficEnabled({required int mapId}) async {
|
86 | 94 | return _configurationProvider(mapId).trafficEnabled ?? false;
|
87 | 95 | }
|
| 96 | + |
| 97 | + @override |
| 98 | + Future<List<Cluster>> getClusters({ |
| 99 | + required int mapId, |
| 100 | + required ClusterManagerId clusterManagerId, |
| 101 | + }) async { |
| 102 | + return _clusterManagersControllerProvider(mapId) |
| 103 | + ?.getClusters(clusterManagerId) ?? |
| 104 | + <Cluster>[]; |
| 105 | + } |
88 | 106 | }
|
0 commit comments