Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
giswqs
GitHub Repository: giswqs/geemap
Path: blob/master/docs/notebooks/106_kepler_gl.ipynb
2313 views
Kernel: Python 3

image

Uncomment the following line to install geemap if needed.

# !pip install -U geemap
import geemap.kepler as geemap

Create an interactive map. You can specify various parameters to initialize the map, such as center, zoom, height, and widescreen.

m = geemap.Map(center=[40, -100], zoom=2, height=600, widescreen=False) m

Save the map to an interactive html. To hide the side panel and disable map customization. Set read_only=False

m.to_html(filename="kepler.html", read_only=False)

Display the interactive map in a notebook cell.

# m.static_map(width=950, height=600, read_only=True)

Add a GeoJSON to the map.

m = geemap.Map(center=[20, 0], zoom=1) lines = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/cable_geo.geojson" m.add_geojson(lines, layer_name="Cable lines") m
m.to_html("kepler_lines.html")

Add a GeoJSON with US state boundaries to the map.

m = geemap.Map(center=[50, -110], zoom=2) polygons = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_states.json" m.add_geojson(polygons, layer_name="Countries") m

Add a shapefile to the map.

m = geemap.Map(center=[20, 0], zoom=1) in_shp = ( "https://github.com/gee-community/geemap/raw/master/examples/data/countries.zip" ) m.add_shp(in_shp, "Countries") m

Add a GeoPandas GeoDataFrame to the map.

import geopandas as gpd
gdf = gpd.read_file( "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/world_cities.geojson" )
gdf
m = geemap.Map(center=[20, 0], zoom=1) m.add_gdf(gdf, "World cities") m