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

create maps with synchronization #232

Closed
PBrockmann opened this issue Nov 2, 2015 · 9 comments
Closed

create maps with synchronization #232

PBrockmann opened this issue Nov 2, 2015 · 9 comments
Labels
enhancement Feature request or idea about how to make folium better plugin This issue/PR is about an existing or new plugin

Comments

@PBrockmann
Copy link

Any interest to have synchronized view of maps.
There is plugin for that: https://github.com/turban/Leaflet.Sync and a nice example http://blog.thematicmapping.org/2013/06/creating-synchronized-view-of-two-maps.html

I would need some advices on how to start this implementation.

@ocefpaf ocefpaf added enhancement Feature request or idea about how to make folium better plugin This issue/PR is about an existing or new plugin labels Nov 2, 2015
@ocefpaf
Copy link
Member

ocefpaf commented Nov 2, 2015

👍

@ocefpaf ocefpaf added this to the v0.2.1 milestone Dec 4, 2015
@ocefpaf ocefpaf modified the milestones: v0.2.1, v0.3.0 Dec 17, 2015
@ocefpaf
Copy link
Member

ocefpaf commented Jan 15, 2016

@BibMartin any idea on how to proper implement this?

In the old days of folium I would probably overload the Map() object to take a second synced_tiles kwarg. However, I am sure that the new concept of Figures and Elements allow some flexibility to implement this properly.

@BibMartin
Copy link
Contributor

Yes, it can either be an attribute in the Map object. I would think of something like

mapA.syncWith = [mapB, mapC]

yielding

mapA.sync(mapB);
mapA.sync(mapC);

Or it can be a plugin.

mapA.add_children(plugins.SyncWith(mapB))

In both cases, I guess a function creating back-and-forth sync would be useful.

def sync_maps(mapA,mapB):
    mapA.syncWith.append(mapB)     # or the other syntax
    mapB.syncWith.append(mapA)     # or the other syntax

I'd be glad to do this as soon as v0.2 is out 😉

@ocefpaf
Copy link
Member

ocefpaf commented Jan 15, 2016

I'd be glad to do this as soon as v0.2 is out

Indeed! Let's put out efforts on getting v0.2 out of the door. (Says the guy who got distracted by #330 😜)

@BibMartin
Copy link
Contributor

And by jwass/mplleaflet#35 (comment) 👻

@ocefpaf
Copy link
Member

ocefpaf commented Jan 15, 2016

Guilty 😳

@ocefpaf
Copy link
Member

ocefpaf commented Sep 23, 2016

This can be done with branca leaving folium only for single maps and branca for other rich visualizations like cross-filter and sync maps. Here is an example:

http://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/Features.ipynb

(Although syncing is not enabled there.)

@ocefpaf ocefpaf closed this as completed Sep 23, 2016
@PBrockmann
Copy link
Author

PBrockmann commented Sep 23, 2016

Ok thanks for the link on branca project.
My target was to provide synchronous slippy maps. But also think on how to produce tiles and get a Web Map Service from calculs made in previous cells.
I have worked following this idea and have achieved a functionnal python script based on gunicorn for the python WSGI server and pyferret for the graphic and calculs engine. Have a look to https://github.com/PBrockmann/wms-pyferret.
Sorry for the self promotion. But it could give ideas to extend folium in this way (a graphic and calculs engine would be needed anyway). The thing also is that the gunicorn is started the time the analysis is done and that does not fit well with the notebooks approach (self describing document).

@ocefpaf
Copy link
Member

ocefpaf commented Sep 23, 2016

That looks really cool! Thanks for sharing. I will take a look as soon as the dust settle in my day job.

Pinging @BibMartin who might also be interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or idea about how to make folium better plugin This issue/PR is about an existing or new plugin
Projects
None yet
Development

No branches or pull requests

3 participants