Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def show(self, tabs=True, layer_control=True, draw_control=False,
fullscreen=True):
""" Show the Map on the Notebook """
if not self.is_shown:
if layer_control:
# Layers Control
lc = ipyleaflet.LayersControl()
self.add_control(lc)
if draw_control:
# Draw Control
dc = ipyleaflet.DrawControl(edit=False)
dc.on_draw(self.handle_draw)
self.add_control(dc)
if fullscreen:
# Control
full_control = ipyleaflet.FullScreenControl()
self.add_control(full_control)
if tabs:
display(self, self.tab_widget)
else:
display(self)
else:
def show(self, tabs=True, layer_control=True, draw_control=False,
fullscreen=True):
""" Show the Map on the Notebook """
if not self.is_shown:
if layer_control:
# Layers Control
lc = ipyleaflet.LayersControl()
self.add_control(lc)
if draw_control:
# Draw Control
dc = ipyleaflet.DrawControl(edit=False)
dc.on_draw(self.handle_draw)
self.add_control(dc)
if fullscreen:
# Control
full_control = ipyleaflet.FullScreenControl()
self.add_control(full_control)
if tabs:
display(self, self.tab_widget)
else:
display(self)
else:
center = kw.pop('center', None)
zoom = kw.pop('zoom', None)
if center is None:
center = (bbox.bottom + bbox.top)*0.5, (bbox.right + bbox.left)*0.5
if zoom is None:
zoom = zoom_from_bbox(bbox)
height = kw.pop('height', '600px')
width = kw.pop('width', None)
m = Map(center=center, zoom=zoom, **kw)
m.layout.height = height
m.layout.width = width
m.add_control(FullScreenControl())
m.add_control(LayersControl())
else:
m = dst
gg = GeoJSON(data={'type': 'FeatureCollection',
'features': polygons},
style=style,
hover_style={'color': 'tomato'},
name=layer_name)
m.add_layer(gg)
if dst is None:
return m
else:
return gg