Add a marker in the shape of a semicircle, similar to the Circle class. Use (direction and arc) or (start_angle and stop_angle), not both. Parameters ---------- location: tuple[float, float] Latitude and Longitude pair (Northing, Easting) radius: float Radius of
| 6 | |
| 7 | |
| 8 | class SemiCircle(JSCSSMixin, Marker): |
| 9 | """Add a marker in the shape of a semicircle, similar to the Circle class. |
| 10 | |
| 11 | Use (direction and arc) or (start_angle and stop_angle), not both. |
| 12 | |
| 13 | Parameters |
| 14 | ---------- |
| 15 | location: tuple[float, float] |
| 16 | Latitude and Longitude pair (Northing, Easting) |
| 17 | radius: float |
| 18 | Radius of the circle, in meters. |
| 19 | direction: int, default None |
| 20 | Direction angle in degrees |
| 21 | arc: int, default None |
| 22 | Arc angle in degrees. |
| 23 | start_angle: int, default None |
| 24 | Start angle in degrees |
| 25 | stop_angle: int, default None |
| 26 | Stop angle in degrees. |
| 27 | popup: str or folium.Popup, optional |
| 28 | Input text or visualization for object displayed when clicking. |
| 29 | tooltip: str or folium.Tooltip, optional |
| 30 | Display a text when hovering over the object. |
| 31 | **kwargs |
| 32 | For additional arguments see :func:`folium.vector_layers.path_options` |
| 33 | |
| 34 | Uses Leaflet plugin https://github.com/jieter/Leaflet-semicircle |
| 35 | |
| 36 | """ |
| 37 | |
| 38 | _template = Template( |
| 39 | """ |
| 40 | {% macro script(this, kwargs) %} |
| 41 | var {{ this.get_name() }} = L.semiCircle( |
| 42 | {{ this.location|tojson }}, |
| 43 | {{ this.options|tojavascript }} |
| 44 | ) |
| 45 | {%- if this.direction %} |
| 46 | .setDirection({{ this.direction[0] }}, {{ this.direction[1] }}) |
| 47 | {%- endif %} |
| 48 | .addTo({{ this._parent.get_name() }}); |
| 49 | {% endmacro %} |
| 50 | """ |
| 51 | ) |
| 52 | |
| 53 | default_js = [ |
| 54 | ( |
| 55 | "semicirclejs", |
| 56 | "https://cdn.jsdelivr.net/npm/leaflet-semicircle@2.0.4/Semicircle.min.js", |
| 57 | ) |
| 58 | ] |
| 59 | |
| 60 | def __init__( |
| 61 | self, |
| 62 | location, |
| 63 | radius, |
| 64 | direction=None, |
| 65 | arc=None, |
nothing calls this directly
no test coverage detected
searching dependent graphs…