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

InfoWindow for cluster #77

Closed
aaronkelly6 opened this issue Apr 10, 2014 · 7 comments
Closed

InfoWindow for cluster #77

aaronkelly6 opened this issue Apr 10, 2014 · 7 comments

Comments

@aaronkelly6
Copy link

Hi guys,

Great work on this lib, it's so good. I have a problem though. I have ried for hours and tried every conceivable combination I think of to get a cluster items info window to show.

My scenario is I have a cluster item which has it's info window displayed, when I zoom out it get's clustered and I lose the marker and the infowindow. Ideally I would like my 'selected' marker to not cluster but if I could populate the cluster's infowindow with the info that was on the item marker that would be fine too but as I said I just can't get it to display at all. I've tried the simplest of edits in the custom cluster demo but no joy.

Can anyone get a clusters infowindow to display?

Thanks,

Aaron

@ericpanorel
Copy link

" but if I could populate the cluster's infowindow with the info that was on the item marker that would be fine too"

I think, if you return a false to the method (override) onClusterClick of your class that implements ClusterManager.OnClusterClickListener, you will be able to show the related InfoWindow

To "prepare" what needs to be shown in the InfoWindow, I think you need to override the method onBeforeClusterRendered in your renderer class...

@aaronkelly6
Copy link
Author

You are the man! Thanks so much. Is there somewhere I should have read that?

FYI the preparation requires markerOptions.visibility(true) to be called just where you said.

Again, many thanks, I'd never have figured that out.

@broady
Copy link
Contributor

broady commented Apr 11, 2014

This is probably deserving of a code sample :)

@aaronkelly6
Copy link
Author

Actually, turns out that returning false wasn't necessary after all...

@aaronkelly6
Copy link
Author

Just setting the markerOptions visibility did the trick on it's own...

@aaronkelly6
Copy link
Author

I didn't like it in the end..sorry(!)...not pretty enough. So I ended up adding a temp marker to the raw map in onBeforeClusterRendered and popping it's infowindow with the stuff that was already there and make sure to remove it when another marker is clicked. Hacky but looks good.

Ideally if we could flag a marker as 'active' i.e. last clicked or has infowindow showing or something and have the cluster manager NOT cluster it then that would obsolete this workaround.

Thanks again for your help.

@aaronkelly6
Copy link
Author

Didn't realise I could comment without re-opening!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants