Skip to content
Open
Changes from all 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
5 changes: 3 additions & 2 deletions plugin/src/web.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -382,7 +382,7 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle
}
}

async enableClustering(_args: EnableClusteringArgs): Promise<void> {
async enableClustering(_args: EnableClusteringArgs, _renderer = new DefaultRenderer): Promise<void> {
const markers: google.maps.Marker[] = [];

for (const id in this.maps[_args.id].markers) {
Expand All @@ -396,6 +396,7 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle
minPoints: _args.minClusterSize ?? 4,
}),
onClusterClick: this.onClusterClickHandler,
renderer: _renderer,
});
}

Expand Down