-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MarkerClustererPlus does not exec click on cluster on some aspect ratios #437
Comments
This may have something to do with fitBounds, not sure. I'll try to take a look into this, but in the meantime, you can experiment yourself by turning off the default click handler (by setting the zoomOnClick property to false), then providing a custom click handler for the markerclusterer. The default hander looks like this (mc is the markerclusterer object and cClusterIcon.cluster_ is passed to the click event handler:
|
Thank you for the fast response. In my case I now handle it like that.
This is actually OK for me. So I always zoom in one level. But guess it is not the right approach for the framework. |
Always zoom in when you click the cluster marker. If zoomOnClick is enabled and the map aspect ration is special the zoom in does not work. See issue googlemaps#437 for more information.
I took a look at your code and came up with the following solution; let me know if this works for you: google.maps.event.addDomListener(this.div_, "click", function (e) {
|
@garylittleRLP Thank you for the solution. |
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you! |
Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution. |
@googlebot don't do it! |
@jpoehnelt I would say it kinda a fix: #437 (comment) But main problem somewhere inside of |
I'm experiencing this using jquery. When I am zoomed to 6 and have a map.getBounds response of: |
This bug still exists and should be fixed. I disabled zoomOnClick and added following modified the code from @garylittleRLP as a custom event handler, but this fix should be made in the package rather than in a custom handler.
|
For me it is happening on a desktop resolution so it seems to be resolution independent. |
It depends to size of gmap element (as mention in the top post) |
Like the old library the current one has the problem that on some aspect ratios of the map the click handler on a cluster does not zoom in.
googlearchive/js-marker-clusterer#135
The is reproduceable in the examples. When you define a small height for the canvas like 200 pixels or so. In my page it does not work for a width of 850 px and a height of 250 pixels. When I use a height of 500 pixels everything is fine.
The text was updated successfully, but these errors were encountered: