MCPcopy Create free account
hub / github.com/python-visualization/folium / BeautifyIcon

Class BeautifyIcon

folium/plugins/beautify_icon.py:8–115  ·  view source on GitHub ↗

Create a BeautifyIcon that can be added to a Marker Parameters ---------- icon: string, default None the Font-Awesome icon name to use to render the marker. icon_shape: string, default None the icon shape border_width: integer, default 3 the border w

Source from the content-addressed store, hash-verified

6
7
8class BeautifyIcon(JSCSSMixin, MacroElement):
9 """
10 Create a BeautifyIcon that can be added to a Marker
11
12 Parameters
13 ----------
14 icon: string, default None
15 the Font-Awesome icon name to use to render the marker.
16 icon_shape: string, default None
17 the icon shape
18 border_width: integer, default 3
19 the border width of the icon
20 border_color: string with hexadecimal RGB, default '#000'
21 the border color of the icon
22 text_color: string with hexadecimal RGB, default '#000'
23 the text color of the icon
24 background_color: string with hexadecimal RGB, default '#FFF'
25 the background color of the icon
26 inner_icon_style: string with css styles for the icon, default ''
27 the css styles of the icon
28 spin: boolean, default False
29 allow the icon to be spinning.
30 number: integer, default None
31 the number of the icon.
32
33 Examples
34 --------
35 Plugin Website: https://github.com/masajid390/BeautifyMarker
36 >>> BeautifyIcon(
37 ... text_color="#000", border_color="transparent", background_color="#FFF"
38 ... ).add_to(marker)
39 >>> number_icon = BeautifyIcon(
40 ... text_color="#000",
41 ... border_color="transparent",
42 ... background_color="#FFF",
43 ... number=10,
44 ... inner_icon_style="font-size:12px;padding-top:-5px;",
45 ... )
46 >>> Marker(
47 ... location=[45.5, -122.3],
48 ... popup=folium.Popup("Portland, OR"),
49 ... icon=number_icon,
50 ... )
51 >>> BeautifyIcon(icon="arrow-down", icon_shape="marker").add_to(marker)
52
53 """
54
55 _template = Template(
56 """
57 {% macro script(this, kwargs) %}
58 var {{ this.get_name() }} = new L.BeautifyIcon.icon(
59 {{ this.options|tojavascript }}
60 )
61 {{ this._parent.get_name() }}.setIcon({{ this.get_name() }});
62 {% endmacro %}
63 """
64 )
65 ICON_SHAPE_TYPES = [

Callers

nothing calls this directly

Calls 1

TemplateClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…