The property 'setIcon' does not exist for the type 'Marker'.
hnakatar opened this issue · 3 comments
hnakatar commented
Environment details
- OS type and version: MacOS Ventura 13.4
- 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.
wangela commented
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:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
- StackOverflow - use the
google-maps
tag
This is an automated message, feel free to ignore.
taserian commented
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/