File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+
3
+ """
4
+ Test DualMap
5
+ ------------
6
+ """
7
+
8
+ from __future__ import (absolute_import , division , print_function )
9
+
10
+ from jinja2 import Template
11
+
12
+ import folium
13
+ import folium .plugins
14
+
15
+
16
+ def test_dual_map ():
17
+ m = folium .plugins .DualMap ((0 , 0 ))
18
+
19
+ folium .FeatureGroup (name = 'both' ).add_to (m )
20
+ folium .FeatureGroup (name = 'left' ).add_to (m .m1 )
21
+ folium .FeatureGroup (name = 'right' ).add_to (m .m2 )
22
+
23
+ figure = m .get_root ()
24
+ assert isinstance (figure , folium .Figure )
25
+ out = figure .render ()
26
+
27
+ script = '<script src="https://rawcdn.githack.com/jieter/Leaflet.Sync/master/L.Map.Sync.js"></script>' # noqa
28
+ assert script in out
29
+
30
+ tmpl = Template ("""
31
+ {{ this.m1.get_name() }}.sync({{ this.m2.get_name() }});
32
+ {{ this.m2.get_name() }}.sync({{ this.m1.get_name() }});
33
+ """ )
34
+
35
+ assert tmpl .render (this = m ) in out
You can’t perform that action at this time.
0 commit comments