Uncategorized

Streamlit Rastgele Streetview ve Map

import streamlit as st
import random



haritalar={
    1:['<iframe src="https://www.google.com/maps/embed?pb=!4v1631445763327!6m8!1m7!1sCAoSLEFGMVFpcE9pRUVsWkEta1hPdVJJR24tWWtxYk5nZDBZWHNZYlZFMG40RHRa!2m2!1d41.0415843!2d29.005247!3f69.3219865888274!4f0!5f0.7820865974627469" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>','<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m12!1m3!1d12037.014156144778!2d29.005247!3d41.0415843!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!5e0!3m2!1str!2str!4v1631445822062!5m2!1str!2str" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>'],
    2:['<iframe src="https://www.google.com/maps/embed?pb=!4v1631445424970!6m8!1m7!1sjTpsWbtIpAHwWuKt3JqQvQ!2m2!1d9.399603080582146!2d-0.842322329012713!3f46.96698273404183!4f-26.272742546993122!5f0.7820865974627469" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>','<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m12!1m3!1d5566.633114823222!2d-0.8404249061435676!3d9.40348655486716!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!5e0!3m2!1str!2str!4v1631445524322!5m2!1str!2str" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>']

}

harita=random.choice(list(haritalar.keys()))

yenile=st.button("Yenile")
haritagoster=st.button("Haritada Göster")
if haritagoster:
    st.markdown(haritalar[harita][1], unsafe_allow_html=True)
else:
    st.markdown(haritalar[harita][0], unsafe_allow_html=True)

 

0 0 vote
Article Rating
Subscribe
Bildir
guest
0 Yorum
Inline Feedbacks
View all comments