Adds a fullscreen button to your map. Parameters ---------- position : str change the position of the button can be: 'topleft', 'topright', 'bottomright' or 'bottomleft' default: 'topleft' title : str change the title of the button, defau
| 6 | |
| 7 | |
| 8 | class Fullscreen(JSCSSMixin, MacroElement): |
| 9 | """ |
| 10 | Adds a fullscreen button to your map. |
| 11 | |
| 12 | Parameters |
| 13 | ---------- |
| 14 | position : str |
| 15 | change the position of the button can be: |
| 16 | 'topleft', 'topright', 'bottomright' or 'bottomleft' |
| 17 | default: 'topleft' |
| 18 | title : str |
| 19 | change the title of the button, |
| 20 | default: 'Full Screen' |
| 21 | title_cancel : str |
| 22 | change the title of the button when fullscreen is on, |
| 23 | default: 'Exit Full Screen' |
| 24 | force_separate_button : bool, default False |
| 25 | force separate button to detach from zoom buttons, |
| 26 | |
| 27 | See https://github.com/brunob/leaflet.fullscreen for more information. |
| 28 | """ |
| 29 | |
| 30 | _template = Template( |
| 31 | """ |
| 32 | {% macro script(this, kwargs) %} |
| 33 | L.control.fullscreen( |
| 34 | {{ this.options|tojavascript }} |
| 35 | ).addTo({{this._parent.get_name()}}); |
| 36 | {% endmacro %} |
| 37 | """ |
| 38 | ) # noqa |
| 39 | |
| 40 | default_js = [ |
| 41 | ( |
| 42 | "Control.Fullscreen.js", |
| 43 | "https://cdn.jsdelivr.net/npm/leaflet.fullscreen@3.0.0/Control.FullScreen.min.js", |
| 44 | ) |
| 45 | ] |
| 46 | default_css = [ |
| 47 | ( |
| 48 | "Control.FullScreen.css", |
| 49 | "https://cdn.jsdelivr.net/npm/leaflet.fullscreen@3.0.0/Control.FullScreen.css", |
| 50 | ) |
| 51 | ] |
| 52 | |
| 53 | def __init__( |
| 54 | self, |
| 55 | position="topleft", |
| 56 | title="Full Screen", |
| 57 | title_cancel="Exit Full Screen", |
| 58 | force_separate_button=False, |
| 59 | **kwargs |
| 60 | ): |
| 61 | super().__init__() |
| 62 | self._name = "Fullscreen" |
| 63 | self.options = remove_empty( |
| 64 | position=position, |
| 65 | title=title, |
nothing calls this directly
no test coverage detected
searching dependent graphs…