Add a minimap (locator) to an existing map. Uses the Leaflet plugin by Norkart under BSD 2-Clause "Simplified" License. https://github.com/Norkart/Leaflet-MiniMap Parameters ---------- tile_layer : folium TileLayer object or str, default None Provide a folium TileLayer
| 7 | |
| 8 | |
| 9 | class MiniMap(JSCSSMixin, MacroElement): |
| 10 | """Add a minimap (locator) to an existing map. |
| 11 | |
| 12 | Uses the Leaflet plugin by Norkart under BSD 2-Clause "Simplified" License. |
| 13 | https://github.com/Norkart/Leaflet-MiniMap |
| 14 | |
| 15 | Parameters |
| 16 | ---------- |
| 17 | tile_layer : folium TileLayer object or str, default None |
| 18 | Provide a folium TileLayer object or the wanted tiles as string. |
| 19 | If not provided it will use the default of 'TileLayer', currently |
| 20 | OpenStreetMap. |
| 21 | position : str, default 'bottomright' |
| 22 | The standard Control position parameter for the widget. |
| 23 | width : int, default 150 |
| 24 | The width of the minimap in pixels. |
| 25 | height : int, default 150 |
| 26 | The height of the minimap in pixels. |
| 27 | collapsed_width : int, default 25 |
| 28 | The width of the toggle marker and the minimap when collapsed in pixels. |
| 29 | collapsed_height : int, default 25 |
| 30 | The height of the toggle marker and the minimap when collapsed |
| 31 | zoom_level_offset : int, default -5 |
| 32 | The offset applied to the zoom in the minimap compared to the zoom of |
| 33 | the main map. Can be positive or negative. |
| 34 | zoom_level_fixed : int, default None |
| 35 | Overrides the offset to apply a fixed zoom level to the minimap |
| 36 | regardless of the main map zoom. |
| 37 | Set it to any valid zoom level, if unset zoom_level_offset is used |
| 38 | instead. |
| 39 | center_fixed : bool, default False |
| 40 | Applies a fixed position to the minimap regardless of the main map's |
| 41 | view / position. Prevents panning the minimap, but does allow zooming |
| 42 | (both in the minimap and the main map). |
| 43 | If the minimap is zoomed, it will always zoom around the centerFixed |
| 44 | point. You can pass in a LatLng-equivalent object. |
| 45 | zoom_animation : bool, default False |
| 46 | Sets whether the minimap should have an animated zoom. |
| 47 | (Will cause it to lag a bit after the movement of the main map.) |
| 48 | toggle_display : bool, default False |
| 49 | Sets whether the minimap should have a button to minimise it. |
| 50 | auto_toggle_display : bool, default False |
| 51 | Sets whether the minimap should hide automatically |
| 52 | if the parent map bounds does not fit within the minimap bounds. |
| 53 | Especially useful when 'zoomLevelFixed' is set. |
| 54 | minimized : bool, default False |
| 55 | Sets whether the minimap should start in a minimized position. |
| 56 | |
| 57 | Examples |
| 58 | -------- |
| 59 | >>> MiniMap(position="bottomleft") |
| 60 | """ |
| 61 | |
| 62 | _template = Template( |
| 63 | """ |
| 64 | {% macro script(this, kwargs) %} |
| 65 | var {{ this.tile_layer.get_name() }} = L.tileLayer( |
| 66 | {{ this.tile_layer.tiles|tojson }}, |
nothing calls this directly
no test coverage detected
searching dependent graphs…