Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import numpy as np
|
|
4 |
from PIL import Image
|
5 |
import io
|
6 |
import urllib.request
|
|
|
7 |
st.set_page_config(layout="wide")
|
8 |
|
9 |
|
@@ -83,7 +84,8 @@ with col2:
|
|
83 |
if state.coords_submitted:
|
84 |
state.coords_submitted = False
|
85 |
try:
|
86 |
-
|
|
|
87 |
buffer = io.BytesIO(urllib.request.urlopen(url).read())
|
88 |
state.img = Image.open(buffer).convert("RGB")
|
89 |
except Exception as e:
|
|
|
4 |
from PIL import Image
|
5 |
import io
|
6 |
import urllib.request
|
7 |
+
import os
|
8 |
st.set_page_config(layout="wide")
|
9 |
|
10 |
|
|
|
84 |
if state.coords_submitted:
|
85 |
state.coords_submitted = False
|
86 |
try:
|
87 |
+
api_key = os.getenv("goog_api")
|
88 |
+
url = "https://maps.googleapis.com/maps/api/staticmap?center="+str(state.lat)+","+str(state.lng)+"&zoom=16&size=640x640&maptype=satellite&key="+api_key
|
89 |
buffer = io.BytesIO(urllib.request.urlopen(url).read())
|
90 |
state.img = Image.open(buffer).convert("RGB")
|
91 |
except Exception as e:
|