Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Cannot find name 'ClusterIconStyle' with googlemaps marker clusterer

I just update to the following "@types/google.maps": "3.49.2" and I’m using the following "@googlemaps/markerclusterer": "2.0.7".

Doing so I see the following error Cannot find name 'ClusterIconStyle'.

I was using this interface to change the colors of the clusterer icon.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

markerClusterIconStyles: ClusterIconStyle[] = [
    {
      textColor: 'white',
      url: 'https://assets.my-folder.com/images/maps/m/m1.png',
      height: 42,
      width: 42,
    },
    {
      textColor: 'white',
      url: 'https://assets.my-folder.com/images/maps/m/m2.png',
      height: 42,
      width: 42,
    }
]
<map-marker-clusterer [zoomOnClick]="true" [gridSize]="20" [styles]="markerClusterIconStyles">
  <!-- My code -->
</map-marker-clusterer>

I looked into the code, but couldn’t find any replacement for this interface. Also, textColor doesn’t seems to exists anymore.

Did somebody already faced the same error and did find a workaround ?

>Solution :

Make sure that you have (at the top):

import { ClusterIconStyle } from '@angular/google-maps';
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading