|
3 | 3 | from folium import plugins
|
4 | 4 |
|
5 | 5 | 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) |
14 | 26 | 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) |
16 | 32 |
|
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', |
18 | 37 | opacity=0.8).add_to(m)
|
19 | 38 | 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) |
21 | 44 |
|
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]], |
23 | 48 | weight=1, color='black').add_to(m)
|
24 | 49 | 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) |
26 | 55 |
|
27 | 56 | line_to_new_delhi = folium.PolyLine([[46.67959447, 3.33984375],
|
28 | 57 | [46.5588603, 29.53125],
|
|
35 | 64 | [25.68113734, 97.3828125],
|
36 | 65 | [21.24842224, 105.77636719]]).add_to(m)
|
37 | 66 |
|
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) |
39 | 70 | plugins.PolyLineTextPath(line_to_hanoi, "To Hanoi", offset=-5).add_to(m)
|
40 | 71 |
|
41 | 72 | m.save(outfile='polyline_text.html')
|
0 commit comments