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

How can I stop the map from grouping close markers into one? #498

Closed
danielp3011 opened this issue Feb 2, 2020 · 2 comments
Closed

How can I stop the map from grouping close markers into one? #498

danielp3011 opened this issue Feb 2, 2020 · 2 comments

Comments

@danielp3011
Copy link

Hi there,

I have a map with around 100 marks. Right now, the library groups close marks and just says the number of marks which were grouped to one mark.
How can I stop that from happening?

I could not find it in the documentation.

Thanks a lot!

Best regards,
Daniel

@martinRenou
Copy link
Member

Hi! I suppose you are using a MarkerCluster if they are grouping? If you don't want this behavior simply don't use this class.

So this code:

from ipyleaflet import Map, Marker, MarkerCluster

m = Map(center=(50, 0), zoom=5)

marker1 = Marker(location=(48, -2))
marker2 = Marker(location=(50, 0))
marker3 = Marker(location=(52, 2))

marker_cluster = MarkerCluster(
    markers=(marker1, marker2, marker3)
)

m.add_layer(marker_cluster);

m

becomes:

from ipyleaflet import Map, Marker

m = Map(center=(50, 0), zoom=5)

marker1 = Marker(location=(48, -2))
marker2 = Marker(location=(50, 0))
marker3 = Marker(location=(52, 2))

m.add_layer(marker1)
m.add_layer(marker2)
m.add_layer(marker3)

m

@danielp3011
Copy link
Author

super, vielen dank :)

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

2 participants