awacke1 commited on
Commit
01584bd
1 Parent(s): 81f0ebd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -19
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
- import os
3
- from streamlit_cesium import st_cesium
4
 
5
  # Set the page configuration
6
  st.set_page_config(page_title="Google Maps 3D", layout="wide")
@@ -8,22 +8,20 @@ st.set_page_config(page_title="Google Maps 3D", layout="wide")
8
  # Set your Google Maps API key
9
  api_key = os.get_env(["GM_TOKEN"])
10
 
11
- # Define the Cesium viewer options
12
- cesium_options = {
13
- "imageryProvider": False,
14
- "baseLayerPicker": False,
15
- "requestRenderMode": True,
16
- }
17
 
18
- # Create a Cesium viewer instance
19
- viewer = st_cesium(cesium_options, height=600)
 
 
 
 
 
 
 
20
 
21
- # Add the Photorealistic 3D Tiles tileset
22
- tileset_url = f"https://tile.googleapis.com/v1/3dtiles/root.json?key={api_key}"
23
- viewer.scene.primitives.add(viewer.Cesium.Cesium3DTileset(url=tileset_url, showCreditsOnScreen=True))
24
-
25
- # Hide the default globe
26
- viewer.scene.globe.show = False
27
-
28
- # Display the Cesium viewer
29
- st.components.v1.html(viewer.to_html(), height=600)
 
1
  import streamlit as st
2
+ import folium
3
+ from streamlit_folium import folium_static
4
 
5
  # Set the page configuration
6
  st.set_page_config(page_title="Google Maps 3D", layout="wide")
 
8
  # Set your Google Maps API key
9
  api_key = os.get_env(["GM_TOKEN"])
10
 
11
+ # Create a Folium map instance
12
+ map_center = [37.7749, -122.4194] # Example coordinates for San Francisco
13
+ map_zoom = 12
14
+ m = folium.Map(location=map_center, zoom_start=map_zoom)
 
 
15
 
16
+ # Add the Google Maps 3D tile layer
17
+ google_3d_layer = folium.TileLayer(
18
+ tiles=f"https://tile.googleapis.com/v1/3dtiles/root.json?key={api_key}",
19
+ attr="Google",
20
+ name="Google Maps 3D",
21
+ overlay=True,
22
+ control=True,
23
+ )
24
+ google_3d_layer.add_to(m)
25
 
26
+ # Display the Folium map using streamlit-folium
27
+ folium_static(m, width=800, height=600)