Closed twitcher07 closed 9 months ago
Hi @twitcher07, thanks for reporting. Glad you're digging the plugin! 🙏
This turned out to be a very tricky issue to solve. Clustering is managed by a separate external library, which was only acquired by Google within the past few years. There are some notable gaps between the two libraries... in this case, it turns out there is no callback when a marker becomes hidden within a cluster.
I tried several different hacky solutions, but most of them didn't even work. Hats off to @zizther, who gave me a fix early on which largely resolved the problem. His solution gets us about 90% of the way there. And after battling with it for a few days, I now believe that last 10% may be impossible to achieve.
The remaining 10% is simply when the map animates while zooming. This zoom animation cannot be controlled or disabled. The timing of this animation disrupts our solution, with no alternative workarounds available to replace it. We may have to accept that our 90% is as good as it's going to get.
When you get a chance, would you mind testing this patch?
"doublesecretagency/craft-googlemaps": "dev-v4-dev"
Hope that helps, let me know if it does the trick for you!
Good news, this fix has been officially released in v4.3.6. 👍
@lindseydiloreto Sounds like it was a really tricky issue. I appreciate you looking into it.
I installed v4.3.6 of the plugin and can confirm that what you have done solves the bug I was experiencing. Thank you so much!
Excellent, thanks for reporting back! 🍺
Hi there,
First of all, let me say I love using this plugin for Craft. It's always been a useful tool in my web development process.
However, I'm using the marker clustering feature for the first time and I seem to be experiencing a bug. I'm using just the default cluster rendering (no custom rendering in my example) and markers have info windows associated with them. I can replicate the bug usually by following these steps:
For me the bug (like you will see in the screen recording below) is that the map will zoom into the cluster in step #4 but then will quickly pan to the info window that wasn't closed in step #2.
https://github.com/doublesecretagency/craft-googlemaps/assets/8517321/0d8bbc63-09ba-4ae5-9771-823663023340
Let me know if you need to see any examples of my code or what i should do to fix this bug. Thank you!