-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Dual map plugin #933
Dual map plugin #933
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I did not test the code snippet but the plugin code is great. Thanks @Conengmo!
@Conengmo the saved HTML worked just fine but it is not rendering on the notebook (both Firefox and Chrome/Chromium). Rendering on the notebook is nice to have but not a blocker to merge this.That |
Thanks for reviewing this @ocefpaf, nice that you approve. I'll fix the rawgit thing and look into making tests and an example notebook. But then I'll get it to work in a notebook first :) |
No rush. Just ping me again when you are done. |
I think it's done. Here is an example notebook (and the entry in the Plugins notebook): @ocefpaf do you want to review? |
I made a plugin using the Leaflet.Sync plugin: https://github.com/jieter/Leaflet.Sync
You can create two maps in the same screen, where position and zoom level are synchronized. This is handy when you want to compare two datasets that don't display well when put on the same map.
I tried to make this as close to the regular
Map
class as possible.Map
(except the positioning arguments).DualMap
, they are added to both the submaps. Data is duplicated.DualMap.m1
andDualMap.m2
.LayerControl
before saving/rendering works.Here's a minimal working example:
I would like to get some feedback on this before adding tests and an example in the notebooks.