From 17ad233fa1d003e4efeb551069538dc301d16317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Balet?= Date: Mon, 29 Apr 2024 15:24:31 +0200 Subject: [PATCH] feat(web/enableClustering): enable passing renderer with Enable changing clustering UI by adding `_renderer = new DefaultRenderer` as the method argument --- plugin/src/web.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/src/web.ts b/plugin/src/web.ts index 87cea938..89e983e8 100644 --- a/plugin/src/web.ts +++ b/plugin/src/web.ts @@ -1,6 +1,6 @@ import { WebPlugin } from '@capacitor/core'; import type { Cluster, onClusterClickHandler } from '@googlemaps/markerclusterer'; -import { MarkerClusterer, SuperClusterAlgorithm } from '@googlemaps/markerclusterer'; +import { DefaultRenderer, MarkerClusterer, SuperClusterAlgorithm } from '@googlemaps/markerclusterer'; import type { Marker } from './definitions'; import { MapType, LatLngBounds } from './definitions'; @@ -382,7 +382,7 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle } } - async enableClustering(_args: EnableClusteringArgs): Promise { + async enableClustering(_args: EnableClusteringArgs, _renderer = new DefaultRenderer): Promise { const markers: google.maps.Marker[] = []; for (const id in this.maps[_args.id].markers) { @@ -396,6 +396,7 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle minPoints: _args.minClusterSize ?? 4, }), onClusterClick: this.onClusterClickHandler, + renderer: _renderer, }); }