Keplergl example
# Real KeplerGL Interactive Map Test
Testing the updated KeplerGL widget that displays an actual interactive map.
InĀ [1]:
Copied!
import anymap
# Create KeplerGL map with data
kepler = anymap.KeplerGLMap(center=[37.7749, -122.4194], zoom=10, height="600px")
# Add sample data
sample_data = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [-122.4194, 37.7749]},
"properties": {"name": "San Francisco", "population": 874961},
},
{
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [-122.0832, 37.4221]},
"properties": {"name": "Palo Alto", "population": 66666},
},
],
}
kepler.add_geojson(sample_data, "cities")
# Display the interactive map
kepler
import anymap
# Create KeplerGL map with data
kepler = anymap.KeplerGLMap(center=[37.7749, -122.4194], zoom=10, height="600px")
# Add sample data
sample_data = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [-122.4194, 37.7749]},
"properties": {"name": "San Francisco", "population": 874961},
},
{
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [-122.0832, 37.4221]},
"properties": {"name": "Palo Alto", "population": 66666},
},
],
}
kepler.add_geojson(sample_data, "cities")
# Display the interactive map
kepler
Out[1]: