File size: 659 Bytes
5b50226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
29
30
31
import streamlit as st
from func import *


st.markdown('## 場所探し')

query = st.text_input('場所を入力してください。',value='東北大学 川内')

### サイドバー 

# 場所のタイプ

type_dicts = {'レストラン':'restaurant', '銀行':'bank', 'カフェ':'cafe', '病院':'doctor'}

# タイプ選択
t = st.sidebar.selectbox('場所のタイプ', type_dicts.keys())

# 英語に変換
ct = type_dicts[t]

# 半径
radius = st.sidebar.slider('半径(m)', 100, 2000, 500, 100)

# 検索

if st.button('検索'):
  lat, lon, place = get_place(query)
  df = find_nearby_places(lat, lon, ct, radius)

  st.map(df)
  st.dataframe(df)