Skip to content

Commit

Permalink
Deployed 3cceaa9 with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kuethe committed Jan 23, 2024
1 parent 2cdeb50 commit 13018ed
Show file tree
Hide file tree
Showing 24 changed files with 395 additions and 187 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
2 changes: 1 addition & 1 deletion api/basemaps/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
2 changes: 1 addition & 1 deletion api/controls/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
2 changes: 1 addition & 1 deletion api/layer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
2 changes: 1 addition & 1 deletion api/map/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
2 changes: 1 addition & 1 deletion api/sources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
2 changes: 1 addition & 1 deletion examples/3d_indoor_mapping/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
167 changes: 167 additions & 0 deletions examples/airports/app.html

Large diffs are not rendered by default.

39 changes: 25 additions & 14 deletions examples/airports/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

import pandas as pd
from maplibre import (
Layer,
Expand Down Expand Up @@ -64,6 +66,23 @@ def get_color(airport_type: str) -> str:

popup_options = PopupOptions(close_button=False)


def create_map() -> Map:
m = Map(map_options)
m.add_layer(airport_circles)
for _, r in airports_data.iterrows():
marker = Marker(
lng_lat=r["coordinates"],
options=MarkerOptions(color=get_color(r["type"])),
popup=Popup(
text=r["name"],
options=popup_options,
),
)
m.add_marker(marker)
return m


app_ui = ui.page_fluid(
ui.panel_title("Airports"),
output_maplibregl("maplibre", height=600),
Expand All @@ -73,22 +92,14 @@ def get_color(airport_type: str) -> str:
def server(input, output, session):
@render_maplibregl
def maplibre():
m = Map(map_options)
for _, r in airports_data.iterrows():
marker = Marker(
lng_lat=r["coordinates"],
options=MarkerOptions(color=get_color(r["type"])),
popup=Popup(
text=r["name"],
options=popup_options,
),
)
m.add_marker(marker)
m.add_layer(airport_circles)
return m
return create_map()


app = App(app_ui, server)

if __name__ == "__main__":
app.run()
if len(sys.argv) == 2:
with open(sys.argv[1], "w") as f:
f.write(create_map().to_html())
else:
app.run()
195 changes: 104 additions & 91 deletions examples/airports/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/custom_basemap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
2 changes: 1 addition & 1 deletion examples/earthquake_clusters/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
2 changes: 1 addition & 1 deletion examples/every_person_in_manhattan/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down
7 changes: 5 additions & 2 deletions examples/geopandas/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@


<span class="md-ellipsis">
UK Road Safety
H3 Grid UK Road Safety
</span>


Expand Down Expand Up @@ -851,7 +851,10 @@

<h1>GeoPandas</h1>

<p><a href="app.html" target="_blank">See example in action</a></p>
<!-- <a href="app.html" target="_blank">See example in action</a> -->

<iframe src="app.html" height="620px", width="100%" style="border:none;"></iframe>

<div class="language-python highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kn">import</span> <span class="nn">sys</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="kn">import</span> <span class="nn">webbrowser</span>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a>
Expand Down
33 changes: 20 additions & 13 deletions examples/road_safety/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,28 @@ def create_h3_grid(res=RESOLUTION) -> dict:

source = GeoJSONSource(data=create_h3_grid())

map_options = MapOptions(
center=(-1.415727, 52.232395),
zoom=7,
pitch=40,
bearing=-27,
)

h3_layer = Layer(
id="road-safety",
type=LayerType.FILL_EXTRUSION,
source=source,
paint={
"fill-extrusion-color": ["get", "color"],
"fill-extrusion-opacity": 0.7,
"fill-extrusion-height": ["*", 100, ["get", "count"]],
},
)


def create_map() -> Map:
m = Map(MapOptions(center=(-1.415727, 52.232395), zoom=7, pitch=40, bearing=-27))
m.add_layer(
Layer(
id="road-safety",
type=LayerType.FILL_EXTRUSION,
source=source,
paint={
"fill-extrusion-color": ["get", "color"],
"fill-extrusion-opacity": 0.7,
"fill-extrusion-height": ["*", 100, ["get", "count"]],
},
)
)
m = Map(map_options)
m.add_layer(h3_layer)
m.add_tooltip("road-safety", "count")
return m

Expand Down
Loading

0 comments on commit 13018ed

Please sign in to comment.