Currently, I am in the process of setting up Google Maps and Marker Clustering without using AGM. The map loads successfully and I have added multiple markers to it. However, when attempting to incorporate marker clusterer, I encounter a type error which states:
ERROR TypeError: "_google_markerclusterer__WEBPACK_IMPORTED_MODULE_7__ is not a constructor"
I have installed marker clusterer via npm with the following command:
npm i @google/markerclusterer --save-dev
Following that, I included the following in my component file along with other imports related to markers/clustering:
import * as MarkerClusterer from "@google/markerclusterer";
In my class, I implemented it as per the example provided:
const gmarkers = [];
_.each(this.venueData.venues, (venue) => {
const mPosition = new google.maps.LatLng(venue.latlng.lat, venue.latlng.lng);
const marker = new google.maps.Marker({position: mPosition, map: this.map});
gmarkers.push(marker);
});
const test = new MarkerClusterer(this.map, gmarkers,
{imagePath: 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m'}
);
I have attempted uninstalling and reinstalling google marker clusterer and also switching to marker clusterer plus, yet the issue persists.