I am using the library supercluster-googlemaps-adapter and following their official document to create cluster map, but have encountered the following error.
Here is my code :
import { SuperClusterAdapterLoader } from 'supercluster-googlemaps-adapter';
initializeNewMap(
mapElement: HTMLElement,
options: google.maps.MapOptions,
geoData
) {
this.map = new google.maps.Map(mapElement, options);
this.featureLayer = this.map.getFeatureLayer(
google.maps.FeatureType.ADMINISTRATIVE_AREA_LEVEL_1
);
google.maps.event.addListenerOnce(this.map, 'tilesloaded', () => {
SuperClusterAdapterLoader.getClusterer().then((Clusterer) => {
if (Clusterer) {
const clusterer = new Clusterer.Builder(this.map)
.withRadius(80)
.withMaxZoom(19)
.withMinZoom(0)
.build();
clusterer.load(geoData);
}
});
});
}
