Closed PBrockmann closed 8 years ago
:+1:
@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.
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 :wink:
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 :stuck_out_tongue_winking_eye:)
Guilty :flushed:
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.)
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).
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.
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.