File: rectangle.md

package info (click to toggle)
folium 0.20.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,168 kB
  • sloc: python: 4,489; makefile: 134; sh: 26
file content (46 lines) | stat: -rw-r--r-- 829 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
```{code-cell} ipython3
---
nbsphinx: hidden
---
import folium
```

## Rectangle

```{code-cell} ipython3
m = folium.Map(location=[35.685, 139.76], zoom_start=15)

kw = {
    "color": "blue",
    "line_cap": "round",
    "fill": True,
    "fill_color": "red",
    "weight": 5,
    "popup": "Tokyo, Japan",
    "tooltip": "<strong>Click me!</strong>",
}

folium.Rectangle(
    bounds=[[35.681, 139.766], [35.691, 139.776]],
    line_join="round",
    dash_array="5, 5",
    **kw,
).add_to(m)

dx = 0.012
folium.Rectangle(
    bounds=[[35.681, 139.766 - dx], [35.691, 139.776 - dx]],
    line_join="mitter",
    dash_array="5, 10",
    **kw,
).add_to(m)

folium.Rectangle(
    bounds=[[35.681, 139.766 - 2 * dx], [35.691, 139.7762 - 2 * dx]],
    line_join="bevel",
    dash_array="15, 10, 5, 10, 15",
    **kw,
).add_to(m)

m
```