Ipyleaflet
In [2]:
Copied!
from ipyleaflet import Map, Marker
center = (52.204793, 360.121558)
m = Map(center=center, zoom=15)
marker = Marker(location=center, draggable=True)
m.add(marker)
display(m)
# Now that the marker is on the Map, you can drag it with your mouse,
# it will automatically update the `marker.location` attribute in Python
# You can also update the marker location from Python, that will update the
# marker location on the Map:
# marker.location = (50, 356)
from ipyleaflet import Map, Marker
center = (52.204793, 360.121558)
m = Map(center=center, zoom=15)
marker = Marker(location=center, draggable=True)
m.add(marker)
display(m)
# Now that the marker is on the Map, you can drag it with your mouse,
# it will automatically update the `marker.location` attribute in Python
# You can also update the marker location from Python, that will update the
# marker location on the Map:
# marker.location = (50, 356)
Map(center=[52.204793, 360.121558], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title'…
In [3]:
Copied!
import ipyleaflet
import ipyleaflet
In [4]:
Copied!
m = ipyleaflet.Map(center=(40, -100), zoom=4)
m
m = ipyleaflet.Map(center=(40, -100), zoom=4)
m
Out[4]:
Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…
In [5]:
Copied!
m = ipyleaflet.Map(center=(40, -100), zoom=4)
m.scroll_wheel_zoom = True
m.add_control(ipyleaflet.FullScreenControl())
m
m = ipyleaflet.Map(center=(40, -100), zoom=4)
m.scroll_wheel_zoom = True
m.add_control(ipyleaflet.FullScreenControl())
m
Out[5]:
Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…
In [6]:
Copied!
import geohub
import geohub
In [7]:
Copied!
from geohub.geohub import Map
from geohub.geohub import Map
In [8]:
Copied!
m=geohub.Map()
m
m=geohub.Map()
m
Out[8]:
Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…
In [9]:
Copied!
from ipyleaflet import Map, basemaps
center = (52.204793, 360.121558)
zoom = 5
Map(basemap=basemaps.NASAGIBS.ViirsEarthAtNight2012, center=center, zoom=zoom)
from ipyleaflet import Map, basemaps
center = (52.204793, 360.121558)
zoom = 5
Map(basemap=basemaps.NASAGIBS.ViirsEarthAtNight2012, center=center, zoom=zoom)
Out[9]:
Map(center=[52.204793, 360.121558], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title'…
In [10]:
Copied!
m.layers
m.layers
Out[10]:
(TileLayer(attribution='© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors', base=True, max_zoom=19, min_zoom=1, name='OpenStreetMap.Mapnik', options=['attribution', 'bounds', 'detect_retina', 'max_native_zoom', 'max_zoom', 'min_native_zoom', 'min_zoom', 'no_wrap', 'tile_size', 'tms', 'zoom_offset'], url='https://tile.openstreetmap.org/{z}/{x}/{y}.png'),)
In [11]:
Copied!
m.controls
m.controls
Out[11]:
(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_text', 'zoom_out_title']), AttributionControl(options=['position', 'prefix'], position='bottomright'), LayersControl(options=['collapsed', 'position'], position='topright'), WidgetControl(options=['position', 'transparent_bg'], position='topright', widget=VBox(children=(ToggleButton(value=False, icon='wrench', layout=Layout(height='28px', padding='0px 0px 0px 5px', width='28px'), tooltip='Toolbar'),))), WidgetControl(options=['position', 'transparent_bg'], position='bottomright', widget=Output()))
In [12]:
Copied!
eval("basemaps.OpenTopoMap")
eval("basemaps.OpenTopoMap")
Out[12]:
xyzservices.TileProvider
OpenTopoMap
- url
- https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png
- max_zoom
- 17
- html_attribution
- Map data: © OpenStreetMap contributors, SRTM | Map style: © OpenTopoMap (CC-BY-SA)
- attribution
- Map data: (C) OpenStreetMap contributors, SRTM | Map style: (C) OpenTopoMap (CC-BY-SA)
In [13]:
Copied!
m = geohub.Map()
m.add_basemap("OpenTopoMap")
m.add_geojson("europe_110.geo.json")
m.add_layers_control()
m
m = geohub.Map()
m.add_basemap("OpenTopoMap")
m.add_geojson("europe_110.geo.json")
m.add_layers_control()
m
Out[13]:
Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…
In [14]:
Copied!
import geopandas as gpd
from shapely.geometry import Point
# Create an instance of the Map class
m = geohub.Map()
# Create a GeoDataFrame
gdf = gpd.GeoDataFrame([{'geometry': Point(0, 0), 'attr': 'value'}])
# Test the add_vector method with a GeoDataFrame
m.add_vector(gdf)
#m.add_legend()
m
import geopandas as gpd
from shapely.geometry import Point
# Create an instance of the Map class
m = geohub.Map()
# Create a GeoDataFrame
gdf = gpd.GeoDataFrame([{'geometry': Point(0, 0), 'attr': 'value'}])
# Test the add_vector method with a GeoDataFrame
m.add_vector(gdf)
#m.add_legend()
m
Out[14]:
Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…
In [15]:
Copied!
m.add_vector('europe_110.geo.json')
m
m.add_vector('europe_110.geo.json')
m
Out[15]:
Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…
In [16]:
Copied!
import ipyleaflet
import ipyleaflet
In [17]:
Copied!
m = ipyleaflet.Map(center=(40, -100), zoom=4)
m.scroll_wheel_zoom = True
m
m = ipyleaflet.Map(center=(40, -100), zoom=4)
m.scroll_wheel_zoom = True
m
Out[17]:
Map(center=[40, -100], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…