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

ENH: add scale and remove unused layer from ipyleaflet map #22

Merged
merged 1 commit into from
Feb 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions mapa/map.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import List, Tuple

from ipyleaflet import DrawControl, LayersControl, Map, basemap_to_tiles, basemaps
from ipyleaflet import DrawControl, Map, ScaleControl, basemap_to_tiles, basemaps
from ipywidgets import Layout

CENTER = [40.5566, 23.4660]
Expand All @@ -9,10 +9,8 @@

def show_map(center: List[float] = CENTER, zoom: int = ZOOM) -> Tuple[Map, DrawControl]:
m = Map(center=center, zoom=zoom, scroll_wheel_zoom=True, layout=Layout(height="600px"))
m.add_layer(basemap_to_tiles(basemaps.Gaode.Satellite))
m.add_control(ScaleControl(position="bottomleft"))
m.add_layer(basemap_to_tiles(basemaps.OpenTopoMap))
control = LayersControl(position="topright")
m.add_control(control)

dc = DrawControl(rectangle={"shapeOptions": {"color": "#0000FF"}}, polyline={}, polygon={}, circlemarker={})

Expand Down