googlemaps/js-markerclusterer

The property 'setIcon' does not exist for the type 'Marker'.

hnakatar opened this issue · 3 comments

Environment details

  1. OS type and version: MacOS Ventura 13.4
  2. Library version and other environment information : 2.5.0

Code example

import { Cluster } from '@googlemaps/markerclusterer';

const disableActiveCluster = useCallback((cluster: Cluster) => {
    cluster.marker?.setIcon(setClusterMarkerIcon(cluster.count));
  }, []);

Stack trace

Property 'setIcon' does not exist for type 'Marker'.
Property 'setIcon' does not exist for type 'AdvancedMarkerElement'.

I see in index.d.ts that there is a setIcon in Marker.

If you would like to upvote the priority of this issue, please comment below or react on the original post above with 👍 so we can see what is popular when we triage.

@hnakatar Thank you for opening this issue. 🙏
Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

Cluster.marker can be either a google.maps.Marker or a google.maps.marker.AdvancedMarkerElement ; to handle the icon, you would need to create a custom renderer similar to the ones shown on https://googlemaps.github.io/js-markerclusterer/public/renderers/