diff --git a/src/Global.d.ts b/src/Global.d.ts index 38f41db0..2555d0a3 100644 --- a/src/Global.d.ts +++ b/src/Global.d.ts @@ -20,6 +20,7 @@ declare global { //The types below, are useful for TypeScript intellisense. type GoogleMapsAlgorithm = OriginalAlgorithm; type GoogleMapsCluster = OriginalCluster; + type GoogleMapsMarker = google.maps.Marker | google.maps.marker.AdvancedMarkerElement; type GoogleMapsMarkerClusterer = OriginalMarkerClusterer; type GoogleMapsMarkerClustererOptions = OriginalMarkerClustererOptions; type GoogleMapsClusterRenderer = OriginalRenderer; diff --git a/src/Providers/Maps/Google/Features/GoogleMarkerClusterer.ts b/src/Providers/Maps/Google/Features/GoogleMarkerClusterer.ts index b3cd30c8..5f52f416 100644 --- a/src/Providers/Maps/Google/Features/GoogleMarkerClusterer.ts +++ b/src/Providers/Maps/Google/Features/GoogleMarkerClusterer.ts @@ -89,7 +89,7 @@ namespace Provider.Maps.Google.Feature { public addMarker(marker: OSFramework.Maps.Marker.IMarker): void { if (this.isEnabled && marker.isReady) { // We need to make sure that a redraw is triggered whenever a new marker is added to the clusters - this._markerClusterer.addMarker(marker.provider, false); + this._markerClusterer.addMarker(marker.provider as GoogleMapsMarker, false); } } @@ -146,7 +146,7 @@ namespace Provider.Maps.Google.Feature { public removeMarker(marker: OSFramework.Maps.Marker.IMarker): void { if (this.isEnabled && marker.isReady) { // We need to make sure that a redraw is triggered whenever a new marker is removed from the clusters - this._markerClusterer?.removeMarker(marker.provider, false); + this._markerClusterer?.removeMarker(marker.provider as GoogleMapsMarker, false); } } @@ -155,7 +155,7 @@ namespace Provider.Maps.Google.Feature { } public setClusterRenderer(renderer: OSFramework.Maps.Feature.IMarkerClustererRender) { - this._renderer = renderer; + this._renderer = renderer as GoogleMapsClusterRenderer; if (this.isEnabled) { this._rebuildClusters(); }