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

Can`t open cluster #6

Closed
Pepslee opened this issue Mar 11, 2023 · 21 comments
Closed

Can`t open cluster #6

Pepslee opened this issue Mar 11, 2023 · 21 comments

Comments

@Pepslee
Copy link

Pepslee commented Mar 11, 2023

If I have several markers very close to each other, I can't zoom deeper to open cluster because map has some max zoom parameter.

@rorystephenson
Copy link
Owner

rorystephenson commented Mar 11, 2023

@Pepslee It's on my todo list to add a 'spiderfy' effect which lets you open up the cluster when it's not possible to zoom it (flutter_map_marker_cluster has this aleady). It hasn't caused me issues yet in my usage but I am aware of the issue. I'm open to PRs as well.

EDIT: The spiderfy work is likely to take some time but if it is useful to you I can expose the maxZoom option of the underlying supercluster package. This means that you can set the clustering maxZoom to one less than your map's max zoom which means at the maximum zoom all of your markers will be unclustered. Let me know if that can help you out.

@Pepslee
Copy link
Author

Pepslee commented Mar 12, 2023

@rorystephenson Thank you)
Exposed MaxZoom could help me, it is a good feature which could be useful in other cases too. But I'm afraid that in my case I have too close several markers, and even they are not clustered I can't click to some marker to show pop up because one marker can obscure another.

@Pepslee
Copy link
Author

Pepslee commented Apr 1, 2023

@Pepslee It's on my todo list to add a 'spiderfy' effect which lets you open up the cluster when it's not possible to zoom it (flutter_map_marker_cluster has this aleady). It hasn't caused me issues yet in my usage but I am aware of the issue. I'm open to PRs as well.

EDIT: The spiderfy work is likely to take some time but if it is useful to you I can expose the maxZoom option of the underlying supercluster package. This means that you can set the clustering maxZoom to one less than your map's max zoom which means at the maximum zoom all of your markers will be unclustered. Let me know if that can help you out.

Can you expose the maxZoom ?

@rorystephenson
Copy link
Owner

rorystephenson commented Apr 3, 2023

@Pepslee it is now exposed in 2.3.0.

Leaving this issue open as it's still not a real fix as discussed.

@rorystephenson
Copy link
Owner

@Pepslee I've just added a new 'splaying' feature in 3.0.0. This is enabled by default and will spread the markers out when the cluster is tapped. The spreading is customisable, the default implementation just spreads the markers in a circle around the cluster with lines drawn from the marker to the cluster centre.

I would like to add an implementation which allows draws lines from the marker to their original location (with the markers positioned such that the lines do not cross) but this was proving a bit more tricky than expected so I decided to release this version without that for now although you can implement this with a custom ClusterSplayDelegate.

Let me know what you think of the implementation and if it works for you.

@Pepslee
Copy link
Author

Pepslee commented May 15, 2023

@rorystephenson I have tested new feature "splaying". It looks really cool, thank you very much.
I found some bug (I think): when cluster is splayed, there are appear several markers connected by black line with cluster center. But when I tap to one of this marker, there is error
image
But when I tap to the original marker (not splayed) popUp shows correct. The problem with popUp of splayed markers

What additional functional is in DisplacedMarker ?

@rorystephenson
Copy link
Owner

Thanks for the report @Pepslee. I think I know what's causing this, I hope I'll get a chance to look today or tomorrow. DisplacedMarker is used for the displaying of the splayed markers and it shouldn't be exposed outside of this package so it's a bug. Will let you know when I have a fix ready.

@rorystephenson
Copy link
Owner

Just a little update... I'm working on this although the changes, in conjunction with changes that I was already making to flutter_map_marker_popup to support multiple layers with popups, are fairly big and I hope to finish this week.

@rorystephenson
Copy link
Owner

Hi @Pepslee, I've just release 4.0.0 which hopefully resolves the issue you were having. It's quite a big release, the CHANGELOG should cover the changes you need to make.

@Vafin84
Copy link

Vafin84 commented May 31, 2023

Hi @rorystephenson . Could you please return the maxZoom parameter? I need the "spider" effect to be at a certain magnification, for example, maximum magnification = 16.

@rorystephenson
Copy link
Owner

rorystephenson commented Jun 5, 2023

Hi @Vafin84, this can be achieved by setting the FlutterMap's maxZoom to 16. If that's undesirable let me know and I can add back maxZoom (I'd be curious to know how more about why you use a supercluster maxZoom that is different from the map maxZoom in this case).

@Vafin84
Copy link

Vafin84 commented Jun 5, 2023

Hi @Vafin84, this can be achieved by setting the FlutterMap's maxZoom to 16. If that's undesirable let me know and I can add back maxZoom (I'd be curious to know how more about why you use a supercluster maxZoom that is different from the map maxZoom in this case).

Some tile vendors use a max zoom of 16 or 17 for locations where there are no large cities (for example, small villages). So I wouldn't want the user clicking on the cluster marker to see gray tiles.

@rorystephenson
Copy link
Owner

@Vafin84 Have you tried setting the maxZoom on FlutterMap?

@Vafin84
Copy link

Vafin84 commented Jun 5, 2023

@Vafin84 Have you tried setting the maxZoom on FlutterMap?

Yes, I know that I can set the maximum scale for Flutter Map and it will be the same for clustering. But in my case it may be a different value, so I would like more flexibility in managing clustering.

@jonasblendstrup
Copy link

Hello @rorystephenson great work on this package, we love it!

With regards to markers that are too close to uncluster, we have a map where many markers may share the same coordinates, too many for splaying to make sense, and instead we were hoping to be able to override the splaying, and have a method that gives us the items of the cluster, which we may then use to open a listview in a modal. This would be more scalable and safe for an unknown and large amount of markers, contrary to the splaying which we believe could become troublesome for the user with too many markers. Is such a feature anything your package could support?

@rorystephenson
Copy link
Owner

Hello @rorystephenson great work on this package, we love it!

With regards to markers that are too close to uncluster, we have a map where many markers may share the same coordinates, too many for splaying to make sense, and instead we were hoping to be able to override the splaying, and have a method that gives us the items of the cluster, which we may then use to open a listview in a modal. This would be more scalable and safe for an unknown and large amount of markers, contrary to the splaying which we believe could become troublesome for the user with too many markers. Is such a feature anything your package could support?

Hi @jonasblendstrup, thank you :).

Your request is definitely do-able and I can understand the desire for it. It will take some re-working of the splay cluster code, I am not sure when I will be able to get to it but I will get there eventually. I'm open to PRs but I'm also aware it's no longer a trivial codebase and there is a lot to understand.

@rorystephenson
Copy link
Owner

rorystephenson commented Jun 10, 2023

@Vafin84 Have you tried setting the maxZoom on FlutterMap?

Yes, I know that I can set the maximum scale for Flutter Map and it will be the same for clustering. But in my case it may be a different value, so I would like more flexibility in managing clustering.

Sorry I forgot to reply. I started on this but got sidetracked by a flutter_map issue that made it hard for me to add an assertion related to this option. That has since become a large PR which I want to finish before making more changes to my flutter_map packages.

@rorystephenson
Copy link
Owner

@Vafin84 I haven't forgotten about this, it's just been delayed by what turned out to be a huge FlutterMap refactor which hopefully will land soon. When this PR lands I will release a new version which re-instates maxZoom plus a bunch of other improvements.

@jonasblendstrup I don't currently have time for implementing the feature you requested as I'm in the middle of looking for Flutter contracting work or a job. If it's a big priority for you and you have budget I could implement this on a freelancing basis, otherwise it's something I will hopefully get to when I have time.

@jonasblendstrup
Copy link

@rorystephenson Hello Rory, thanks for the update!

Unfortunately I'm the only developer assigned to this project, and it doesn't exactly have a great budget (to put it mildly). We also have found an alternative (albeit one that is not ideal) so I won't be able to convince the bosses to fund this feature. I'm truly sorry, and I hope that some time in the future I'll be in a position where I will be able to fund open source contributors like yourself, because your work goes a long way and is great for the development community, but for now all I can give is my appreciation.

There's no rush for the feature, and you don't have to spend time on it if it's outside the scope of your package, or simply not a feature you intend to support. I hope you find a great Flutter job soon, where you can actually get paid for your great work.

@rorystephenson
Copy link
Owner

rorystephenson commented Jul 6, 2023

Unfortunately I'm the only developer assigned to this project, and it doesn't exactly have a great budget (to put it mildly). We also have found an alternative (albeit one that is not ideal) so I won't be able to convince the bosses to fund this feature. I'm truly sorry, and I hope that some time in the future I'll be in a position where I will be able to fund open source contributors like yourself, because your work goes a long way and is great for the development community, but for now all I can give is my appreciation.

Thank you for the kind words! There's no need to apologise, I develop this and other packages out of passion 🙂. If someone needs help and has the budget that can be a great situation all-round, otherwise I will eventually get to the various feature requests as my other commitments allow.

Good luck with you project!

EDIT: I've opened a separate issue to track this: #13

@rorystephenson
Copy link
Owner

I'm closing this as the original issue is resolved. I've opened #14 to track re-adding the maximum cluster zoom option (cc @Vafin84).

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

4 participants