Skip to content

Commit 3692f0d

Browse files
committed
Update pmtiles example
1 parent 3919244 commit 3692f0d

File tree

3 files changed

+264
-232
lines changed

3 files changed

+264
-232
lines changed

maplibre/srcjs/maplibre.anywidget.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

maplibre/srcjs/maplibre.anywidget.js

Lines changed: 229 additions & 229 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

marimo/pmtiles.py

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _(mlb):
4646

4747
@app.cell
4848
def _(m, source):
49-
# m.add_call("setCenterFromPMTiles", "https://pmtiles.io/protomaps(vector)ODbL_firenze.pmtiles")
49+
# m.add_call("setCenterFromPMTiles", "https://pmtiles.io/protomaps(vector)ODbL_firenze.pmtiles", 6)
5050
m.add_source("pmtiles", source)
5151
return
5252

@@ -60,7 +60,8 @@ def _(l, m):
6060
@app.cell
6161
def _(m):
6262
# m.add_call("setCenterFromPMTiles", "https://pmtiles.io/protomaps(vector)ODbL_firenze.pmtiles")
63-
m.fit_bounds((11.154026, 43.7270125, 11.3289395, 43.8325455))
63+
# m.fit_bounds((11.154026, 43.7270125, 11.3289395, 43.8325455))
64+
m.add_call("fitBoundsFromPMTiles", "https://pmtiles.io/protomaps(vector)ODbL_firenze.pmtiles")
6465
return
6566

6667

@@ -95,6 +96,37 @@ def _(m):
9596
return
9697

9798

99+
@app.cell
100+
def _(m):
101+
m.add_call("fitBoundsFromPMTiles", "https://pmtiles.io/protomaps(vector)ODbL_firenze.pmtiles")
102+
return
103+
104+
105+
@app.cell
106+
def _():
107+
s = {
108+
"id": "gl-draw-line",
109+
"type": "line",
110+
"filter": ["all", ["==", "$type", "LineString"]],
111+
"layout": {
112+
"line-cap": "round",
113+
"line-join": "round"
114+
},
115+
"paint": {
116+
"line-color": "#D20C0C",
117+
# "line-dasharray": [0.2, 2],
118+
"line-width": 2
119+
}
120+
}
121+
return (s,)
122+
123+
124+
@app.cell
125+
def _(m, s):
126+
m.add_call("addControl", "MapboxDraw", dict(displayControlsDefault=True, styles=[s]), "top-left")
127+
return
128+
129+
98130
@app.cell
99131
def _():
100132
return

0 commit comments

Comments
 (0)