7
7
"# leafmap streamlit demo"
8
8
st .markdown ('Source code: <https://github.com/giswqs/leafmap-streamlit/blob/master/app.py>' )
9
9
10
- "## Create a heat map"
10
+ "## Create a 3D map using Kepler.gl "
11
11
with st .echo ():
12
12
import streamlit as st
13
+ import leafmap .kepler as leafmap
14
+
15
+ m = leafmap .Map (center = [37.7621 , - 122.4143 ], zoom = 12 )
16
+ in_csv = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/hex_data.csv'
17
+ config = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/hex_config.json'
18
+ m .add_csv (in_csv , layer_name = "hex_data" , config = config )
19
+ m .to_streamlit ()
20
+
21
+
22
+ "## Create a heat map"
23
+ with st .echo ():
13
24
import leafmap .foliumap as leafmap
14
25
15
26
filepath = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv"
16
-
17
27
m = leafmap .Map (tiles = 'stamentoner' )
18
28
m .add_heatmap (filepath , latitude = "latitude" , longitude = 'longitude' , value = "pop_max" , name = "Heat map" , radius = 20 )
19
29
m .to_streamlit (width = 700 , height = 500 , add_layer_control = True )
20
30
21
31
22
-
23
32
"## Load a GeoJSON file"
24
33
with st .echo ():
25
34
26
-
27
35
m = leafmap .Map (center = [0 , 0 ], zoom = 2 )
28
36
in_geojson = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/cable-geo.geojson'
29
37
m .add_geojson (in_geojson , layer_name = "Cable lines" )
49
57
m .to_streamlit ()
50
58
51
59
52
- "## Create a 3D map using Kepler.gl"
53
- with st .echo ():
54
- import leafmap .kepler as leafmap
55
-
56
- m = leafmap .Map (center = [37.7621 , - 122.4143 ], zoom = 12 )
57
- in_csv = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/hex_data.csv'
58
- config = 'https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/hex_config.json'
59
- m .add_csv (in_csv , layer_name = "hex_data" , config = config )
60
- m .to_streamlit ()
0 commit comments