Skip to content

Commit

Permalink
First commit of map with Pastas models
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulcollenteur committed Sep 5, 2023
1 parent 827463d commit 0c3fbab
Show file tree
Hide file tree
Showing 19 changed files with 1,397 additions and 0 deletions.
46 changes: 46 additions & 0 deletions app/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import panel as pn
import hvplot.pandas
import folium
import os
import base64
from folium import IFrame
import numpy as np


pn.extension(sizing_mode="stretch_width")

m = folium.Map(zoom_start=12, max_bounds=True)

folium_pane = pn.pane.plot.Folium(m, height=500)

dir = "./img/"
for fl in os.listdir(dir):
if fl.endswith(".png"):
idx = str(fl.split(".")[0])
encoded = base64.b64encode(open("./img/{}.png".format(idx), "rb").read())
html = '<img src="data:image/png;base64,{}">'.format
iframe = IFrame(html(encoded.decode("UTF-8")), width=630, height=380)
popup = folium.Popup(iframe, max_width=1000)

folium.Marker(
location=[50 + np.random.rand(1) * 10, 10 + np.random.rand(1) * 100],
popup=popup,
icon=folium.Icon(),
).add_to(m)
else:
continue
m.add_child(folium.LatLngPopup())


template = pn.template.BootstrapTemplate(
title="Pastas around the world",
sidebar=[],
)
# Append a layout to the main area, to demonstrate the list-like API
template.main.append(pn.Row(folium_pane))

# template.servable()

from bokeh.resources import INLINE

template.save("index.html", resources=INLINE)
Binary file added img/head_310177_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310193_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310201_101.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310219_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310227_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310243_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310268_111.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310276_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310292_111.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310326_111.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310334_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310342_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310433_110.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310441_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310458_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310474_100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/head_310482_111.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,351 changes: 1,351 additions & 0 deletions index.html

Large diffs are not rendered by default.

0 comments on commit 0c3fbab

Please sign in to comment.