Skip to content

Commit 591b83a

Browse files
committed
Fix flake8
Closes #451
1 parent 62af439 commit 591b83a

File tree

2 files changed

+66
-21
lines changed

2 files changed

+66
-21
lines changed

examples/polyline_text_path_example.py

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,55 @@
33
from folium import plugins
44

55
m = folium.Map([30., 0.], zoom_start=3)
6-
wind_locations = [[59.3556, -31.99219], [55.17887, -42.89062], [47.7541, -43.94531],
7-
[38.27269, -37.96875], [27.05913, -41.13281], [16.29905, -36.5625],
8-
[8.40717, -30.23437], [1.05463, -22.5], [-8.75479, -18.28125],
9-
[-21.61658, -20.03906], [-31.35364, -24.25781], [-39.90974, -30.9375],
10-
[-43.83453, -41.13281], [-47.7541, -49.92187], [-50.95843, -54.14062],
11-
[-55.9738, -56.60156]]
12-
13-
wind_line = folium.PolyLine(wind_locations, weight=15, color='#8EE9FF').add_to(m)
6+
wind_locations = [[59.35560, -31.992190],
7+
[55.178870, -42.89062],
8+
[47.754100, -43.94531],
9+
[38.272690, -37.96875],
10+
[27.059130, -41.13281],
11+
[16.299050, -36.56250],
12+
[8.4071700, -30.23437],
13+
[1.0546300, -22.50000],
14+
[-8.754790, -18.28125],
15+
[-21.61658, -20.03906],
16+
[-31.35364, -24.25781],
17+
[-39.90974, -30.93750],
18+
[-43.83453, -41.13281],
19+
[-47.75410, -49.92187],
20+
[-50.95843, -54.14062],
21+
[-55.97380, -56.60156]]
22+
23+
wind_line = folium.PolyLine(wind_locations,
24+
weight=15,
25+
color='#8EE9FF').add_to(m)
1426
attr = {'fill': '#007DEF', 'font-weight': 'bold', 'font-size': '24'}
15-
plugins.PolyLineTextPath(wind_line, ") ", repeat=True, offset=7, attributes=attr).add_to(m)
27+
plugins.PolyLineTextPath(wind_line,
28+
") ",
29+
repeat=True,
30+
offset=7,
31+
attributes=attr).add_to(m)
1632

17-
danger_line = folium.PolyLine([[-40.311, -31.952], [-12.086, -18.727]], weight=10, color='orange',
33+
danger_line = folium.PolyLine([[-40.311, -31.952],
34+
[-12.086, -18.727]],
35+
weight=10,
36+
color='orange',
1837
opacity=0.8).add_to(m)
1938
attr = {'fill': 'red'}
20-
plugins.PolyLineTextPath(danger_line, "\u25BA", repeat=True, offset=6, attributes=attr).add_to(m)
39+
plugins.PolyLineTextPath(danger_line,
40+
"\u25BA",
41+
repeat=True,
42+
offset=6,
43+
attributes=attr).add_to(m)
2144

22-
plane_line = folium.PolyLine([[-49.38237, -37.26562], [-1.75754, -14.41406], [51.61802, -23.20312]],
45+
plane_line = folium.PolyLine([[-49.38237, -37.26562],
46+
[-1.75754, -14.41406],
47+
[51.61802, -23.20312]],
2348
weight=1, color='black').add_to(m)
2449
attr = {'font-weight': 'bold', 'font-size': '24'}
25-
plugins.PolyLineTextPath(plane_line, "\u2708 ", repeat=True, offset=8, attributes=attr).add_to(m)
50+
plugins.PolyLineTextPath(plane_line,
51+
"\u2708 ",
52+
repeat=True,
53+
offset=8,
54+
attributes=attr).add_to(m)
2655

2756
line_to_new_delhi = folium.PolyLine([[46.67959447, 3.33984375],
2857
[46.5588603, 29.53125],
@@ -35,7 +64,9 @@
3564
[25.68113734, 97.3828125],
3665
[21.24842224, 105.77636719]]).add_to(m)
3766

38-
plugins.PolyLineTextPath(line_to_new_delhi, "To New Delhi", offset=-5).add_to(m)
67+
plugins.PolyLineTextPath(line_to_new_delhi,
68+
"To New Delhi",
69+
offset=-5).add_to(m)
3970
plugins.PolyLineTextPath(line_to_hanoi, "To Hanoi", offset=-5).add_to(m)
4071

4172
m.save(outfile='polyline_text.html')

tests/plugins/test_polyline_text_path.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,30 @@
1313
def test_polyline_text_path():
1414
m = folium.Map([20., 0.], zoom_start=3)
1515

16-
wind_locations = [[59.3556, -31.99219], [55.17887, -42.89062], [47.7541, -43.94531],
17-
[38.27269, -37.96875], [27.05913, -41.13281], [16.29905, -36.5625],
18-
[8.40717, -30.23437], [1.05463, -22.5], [-8.75479, -18.28125],
19-
[-21.61658, -20.03906], [-31.35364, -24.25781], [-39.90974, -30.9375],
20-
[-43.83453, -41.13281], [-47.7541, -49.92187], [-50.95843, -54.14062],
21-
[-55.9738, -56.60156]]
16+
wind_locations = [[59.355600, -31.99219],
17+
[55.178870, -42.89062],
18+
[47.754100, -43.94531],
19+
[38.272690, -37.96875],
20+
[27.059130, -41.13281],
21+
[16.299050, -36.56250],
22+
[8.4071700, -30.23437],
23+
[1.0546300, -22.50000],
24+
[-8.754790, -18.28125],
25+
[-21.61658, -20.03906],
26+
[-31.35364, -24.25781],
27+
[-39.90974, -30.93750],
28+
[-43.83453, -41.13281],
29+
[-47.75410, -49.92187],
30+
[-50.95843, -54.14062],
31+
[-55.97380, -56.60156]]
2232

2333
wind_line = folium.PolyLine(wind_locations, weight=15, color='#8EE9FF')
2434
attr = {'fill': '#007DEF', 'font-weight': 'bold', 'font-size': '24'}
25-
wind_textpath = plugins.PolyLineTextPath(wind_line, ") ", repeat=True, offset=7, attributes=attr)
35+
wind_textpath = plugins.PolyLineTextPath(wind_line,
36+
") ",
37+
repeat=True,
38+
offset=7,
39+
attributes=attr)
2640

2741
m.add_child(wind_line)
2842
m.add_child(wind_textpath)

0 commit comments

Comments
 (0)