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

Support GeoJson layer in MarkerCluster #882

Merged
merged 3 commits into from
Nov 16, 2021

Conversation

mangecoeur
Copy link
Contributor

@mangecoeur mangecoeur commented Nov 8, 2021

Initial PR (needs review, maybe tests...) addessing #881

Made it possible to use a GeoJson layer as the data source for Marker Cluster, this makes it much faster when creating large numbers of markers (but not having bidirectional sync on individual Marker widgets).

Implemented by copying the behaviour of LayerGroup, it will simply attempt to add the model of whatever is provided in the marker list to the marker group: this allows to mix geojson and Marker elements.

@mangecoeur mangecoeur changed the title Support GeoJson layer in MarkerCluster #881 Support GeoJson layer in MarkerCluster Nov 8, 2021
@martinRenou
Copy link
Member

That's very neat! Thanks a lot! And thanks for using a view list, when looking at the code yesterday I thought we should do that.

I will review more deeply and test it today 😊

@mangecoeur
Copy link
Contributor Author

Thanks! Would be great to have this enabled.

Copy link
Member

@martinRenou martinRenou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! Works like a charm :)

It's a really nice improvement, I've just got two small comments and it's good to go

Comment on lines 47 to 48
console.log(this.model.get('markers'));
console.log(child_model);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some leftover logs

Suggested change
console.log(this.model.get('markers'));
console.log(child_model);

@@ -0,0 +1,104 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you clean the Notebook outputs?

@mangecoeur
Copy link
Contributor Author

Great thanks, just pushed a commit to remove console.log and clean the nb outputs.

@martinRenou martinRenou merged commit 2b6e5c4 into jupyter-widgets:master Nov 16, 2021
@martinRenou
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants