js-markerclusterer
js-markerclusterer copied to clipboard
addMarker does not update cluster number
When adding new marker to the clusterer (at least when clusterer is not visible, map is zoomed in), then zooming out to show clusters, the marker seems not to be counted in the cluster.
// SuperClusterAlgorithm
clusterer.addMarker(marker);
clusterer.render(); // optional?
@Tukkan Thank you for opening this issue. 🙏 Please check out these other resources that might be applicable:
- Support Console - If you have a support contract.
- Discord - chat with other developers
-
StackOverflow - use the
google-maps
tag - Google Maps Platform issue trackers
This is an automated message, feel free to ignore.
Google, it's been 5 months. When are you going to fix this?
Getting issues too when loading the website:
js?v=3&language=nl&libraries=places,drawing&key=AIzaSyCB5INXV0cEMf0y741bCvlSC2MG-veEhPQ:268 google.maps.event.addDomListener() is deprecated, use the standard addEventListener() method instead: https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener The feature will continue to work and there is no plan to decommission it.
WHEN U GONNA FIX THIS????
I figured I could help look into this, but I can't reproduce the issue.
Can you provide a minimal reproducible example of this happening? @lafllamme
@nora-soderlund I am using the MarkerClusterer inside a Vue 2 Application. Adding the
<gmap-cluster
:zoomOnClick="true"
:averageCenter="true"
:minimumClusterSize="2"
:gridSize="20"
:enableRetinaIcons="true"
:styles="clusterStyles"
>
<!-- items location marker-->
<gmap-custom-marker
:key="m.uid"
v-for="(m, index) in items"
:marker="{lat: m.latitude, lng:m.longitude}"
:clickable="true"
:draggable="false"
:z-index="showByIndex === index ? 1000 : 1"
@click.native="center = {lat: m.latitude, lng:m.longitude}"
@mouseover.native="showItem(m, index)"
@mouseout.native="hideItem()"
>
<!-- icon items and info window -->
<div class="gmap-marker-icon-container">
<component
:is="icons[m.category] ? icons[m.category] : icons['default']"
:fillColor="setColorPin(m,index)"
:strokeColor="colorOptions.defaultWhite"
/>
<div class="info-window"
v-if="showByIndex === index">
<p>{{ m.name }}</p>
</div>
</div>
</gmap-custom-marker>
</gmap-cluster>
I receive: google.maps.event.addDomListener() is deprecated, use the standard addEventListener() method instead: https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener The feature will continue to work and there is no plan to decommission it.
and don't know how to prevent or catch this.
@lafllamme please use this issue or refer to one of the other technical support forums found at https://developers.google.com/maps/support
This issue is for the original “addMarker does not update cluster count”.
@Sintmacro please take care to delete the API key above and replace it in any projects that use it.