Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hnakatar opened this issue Nov 19, 2023 · 3 comments
Open

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

hnakatar opened this issue Nov 19, 2023 · 3 comments
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@hnakatar
Copy link

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.

@hnakatar hnakatar added triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Nov 19, 2023
@wangela
Copy link
Member

wangela commented Nov 19, 2023

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.

@taserian
Copy link

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/

@t53m1
Copy link

t53m1 commented Mar 1, 2024

@taserian I have tried returning AdvancedMarkerElement from the rendering function but it's throwing TypeError

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
4 participants