|
2 | 2 | import folium
|
3 | 3 | from folium import plugins
|
4 | 4 |
|
5 |
| -m = folium.Map([30.,0.], zoom_start=3) |
6 |
| -wind_locations = [[59.3556, -31.99219], [55.17887, -42.89062], [47.7541, -43.94531], [38.27269, -37.96875], |
7 |
| - [27.05913, -41.13281], [16.29905, -36.5625], [8.40717, -30.23437], [1.05463, -22.5], |
8 |
| - [-8.75479, -18.28125], [-21.61658, -20.03906], [-31.35364, -24.25781], [-39.90974, -30.9375], |
9 |
| - [-43.83453, -41.13281], [-47.7541, -49.92187], [-50.95843, -54.14062], [-55.9738, -56.60156]] |
| 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]] |
10 | 12 |
|
11 | 13 | wind_line = folium.PolyLine(wind_locations, weight=15, color='#8EE9FF').add_to(m)
|
12 | 14 | attr = {'fill': '#007DEF', 'font-weight': 'bold', 'font-size': '24'}
|
13 | 15 | plugins.PolyLineTextPath(wind_line, ") ", repeat=True, offset=7, attributes=attr).add_to(m)
|
14 | 16 |
|
15 |
| -danger_line = folium.PolyLine([[-40.311, -31.952], [-12.086, -18.727]], weight=10, color='orange', opacity=0.8).add_to(m) |
| 17 | +danger_line = folium.PolyLine([[-40.311, -31.952], [-12.086, -18.727]], weight=10, color='orange', |
| 18 | + opacity=0.8).add_to(m) |
16 | 19 | attr = {'fill': 'red'}
|
17 | 20 | plugins.PolyLineTextPath(danger_line, "\u25BA", repeat=True, offset=6, attributes=attr).add_to(m)
|
18 | 21 |
|
19 |
| -plane_line = folium.PolyLine([[-49.38237, -37.26562], [-1.75754, -14.41406], [51.61802, -23.20312]], weight=1, color='black').add_to(m) |
20 |
| -attr = {'font-weight':'bold', 'font-size':'24'} |
| 22 | +plane_line = folium.PolyLine([[-49.38237, -37.26562], [-1.75754, -14.41406], [51.61802, -23.20312]], |
| 23 | + weight=1, color='black').add_to(m) |
| 24 | +attr = {'font-weight': 'bold', 'font-size': '24'} |
21 | 25 | plugins.PolyLineTextPath(plane_line, "\u2708 ", repeat=True, offset=8, attributes=attr).add_to(m)
|
22 | 26 |
|
23 |
| -line_to_new_dehli = folium.PolyLine([[46.67959447, 3.33984375], |
| 27 | +line_to_new_delhi = folium.PolyLine([[46.67959447, 3.33984375], |
24 | 28 | [46.5588603, 29.53125],
|
25 | 29 | [42.29356419, 51.328125],
|
26 | 30 | [35.74651226, 68.5546875],
|
|
31 | 35 | [25.68113734, 97.3828125],
|
32 | 36 | [21.24842224, 105.77636719]]).add_to(m)
|
33 | 37 |
|
34 |
| -plugins.PolyLineTextPath(line_to_new_dehli, "To New Delhi", offset=-5).add_to(m) |
| 38 | +plugins.PolyLineTextPath(line_to_new_delhi, "To New Delhi", offset=-5).add_to(m) |
35 | 39 | plugins.PolyLineTextPath(line_to_hanoi, "To Hanoi", offset=-5).add_to(m)
|
36 | 40 |
|
37 | 41 | m.save(outfile='polyline_text.html')
|
0 commit comments