I am using expo sdk and Linux to develop mobile app. I don’t have a mac, but I published on PlayStore and on Apple Store. You may adapt the following code to your needs but the following should be working for any kind of project .
I give you my…
You use GoogleMap in a Typescript Angular App and you’d like to display marker cluster.
The wrong way:
Add script in your index.html (or angular-cli.json)
And use it in your component like this :
declare var MarkerClusterer: any;
Why is it wrong ? Because you will load this .js file even if you don’t need it. You don’t leverage lazy loading.
The right way:
In your console
npm i @google/markerclusterer -S
And in your component, in the method where you handle markers and clusters, just use it as it is : a class. Instanciate it.
import * as MarkerClusterer from "@google/markerclusterer"new MarkerClusterer(map, opt_markers, opt_options)