Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimap plugin #968

Merged
merged 14 commits into from
Oct 16, 2018
Prev Previous commit
Next Next commit
Addressing PR comments.
  • Loading branch information
ColinTalbert authored and Conengmo committed Oct 15, 2018
commit 4d644e397d15ecff704c9cc8a1a7308dbc842f72
84 changes: 61 additions & 23 deletions examples/Plugins.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion folium/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
'TimestampedGeoJson',
'TimestampedWmsTileLayers',
'Search',
'MiniMap'
'MiniMap',
]
17 changes: 9 additions & 8 deletions folium/plugins/minimap.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ class MiniMap(MacroElement):
Parameters
----------
tile_layer: folium tilelayer, str (Optional)
tile_layer: folium TileLayer object or str, optional
Provide a folium TileLayer object or the wanted tiles as string.
If not provided it will use the default of `TileLayer`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to have empty lines between the parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still seeing them on the 'files changed' page, am I missing something?

position : str, default 'bottomright'
The standard Control position parameter for the widget.
width: int, default 150
The width of the minimap in pixels.
Expand All @@ -36,32 +37,32 @@ class MiniMap(MacroElement):
collapsed_height: int, default 25
The height of the toggle marker and the minimap when collapsed
zoom_level_offset: int, defalut -5
zoom_level_offset: int, defalaut -5
The offset applied to the zoom in the minimap compared to the zoom of the main map. Can be positive or negative.
zoom_level_fixed: int, default None
Overrides the offset to apply a fixed zoom level to the minimap regardless of the main map zoom.
Set it to any valid zoom level, if unset zoomLevelOffset is used instead.
center_fixed: bool, default False
Applies a fixed position to the minimap regardless of the main map's view / position. P
revents panning the minimap, but does allow zooming (both in the minimap and the main map).
Applies a fixed position to the minimap regardless of the main map's view / position.
Prevents panning the minimap, but does allow zooming (both in the minimap and the main map).
If the minimap is zoomed, it will always zoom around the centerFixed point.
You can pass in a LatLng-equivalent object.
zoom_animation: bool, default False
Sets whether the minimap should have an animated zoom.
(Will cause it to lag a bit after the movement of the main map.)
toggle_display: bool, default
toggle_display: bool, default False
Sets whether the minimap should have a button to minimise it.
auto_toggle_display: bool, default
auto_toggle_display: bool, default False
Sets whether the minimap should hide automatically
if the parent map bounds does not fit within the minimap bounds.
Especially useful when 'zoomLevelFixed' is set.
minimized: bool, default
minimized: bool, default False
Sets whether the minimap should start in a minimized position.
Examples
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/test_minimap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

"""
Test FloatImage
Test MiniMap
---------------
"""

Expand Down