File size: 807 Bytes
c007f3b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10d0bac
 
 
 
c007f3b
10d0bac
 
 
c007f3b
10d0bac
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import altair as alt
import numpy as np
import pandas as pd
import streamlit as st

"""
# Welcome to Streamlit!

Edit `/streamlit_app.py` to customize this app to your heart's desire :heart:.
If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
forums](https://discuss.streamlit.io).

In the meantime, below is an example of what you can do with just a few lines of code:
"""

import streamlit as st
from streamlit_folium import st_folium
from folium.plugins import Draw
import folium

m = folium.Map(location=[40.7128, -74.0060], zoom_start=12)
Draw(export=True).add_to(m)
output = st_folium(m, width=700, height=500)

if output and 'last_active_drawing' in output:
    geojson_data = output['last_active_drawing']
    st.write("Geofence drawn:", geojson_data)