map-s / app.py
johann22's picture
Update app.py
b151612 verified
raw
history blame contribute delete
904 Bytes
import gradio as gr
import main
def get_tile(x=5,y=5,z=5):
url = f"""
<div style='display:flex'>
<img src='https://tile.openstreetmap.org/{x+1}/{y}/{z}.png'>
<img src='https://tile.openstreetmap.org/{x+1}/{y+1}/{z}.png'>
</div>
<div style='display:flex'>
<img src='https://tile.openstreetmap.org/{x}/{y}/{z}.png'>
<img src='https://tile.openstreetmap.org/{x}/{y+1}/{z}.png'>
</div>
"""
return url
iface = gr.Interface(fn=get_tile, # Not used here since the routing happens within Flask
inputs=["number","number","number"],
outputs=["html"],
title="OpenStreetMap Viewer",
description="A simple web app demonstrating rendering map tiles based on input coordinates.",
allow_flagging="never")
#iface.load("http://localhost:5000")
iface.queue().launch()