Skip to content

Commit 2d97d3c

Browse files
committed
qr
1 parent ef82948 commit 2d97d3c

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/viz/maplibregljs.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ <h1>Tile endpoint to serve vector tiles</h1>
530530

531531
query = f"""
532532
select
533-
geometry
533+
st_aswkb(geometry) as geometry
534534
from
535535
`workspace`.`default`.`building_geom`
536536
where st_intersects(geometry, st_geomfromtext('{tileenv[0]}'))
@@ -543,9 +543,11 @@ <h1>Tile endpoint to serve vector tiles</h1>
543543
# Use con.cursor() to avoid threading issues with Flask
544544
with duckdb_con.cursor() as local_con:
545545
tile_blob = None
546-
tile_count = local_con.execute("""
546+
tile_count = local_con.execute(
547+
"""
547548
select count(*) cnt from da
548-
""").fetchone()[0]
549+
"""
550+
).fetchone()[0]
549551
if tile_count == MAX_FEATURES_PER_TILE:
550552
# If we hit the limit, return an empty tile to avoid incomplete data
551553
tile_blob = local_con.execute(
@@ -564,7 +566,7 @@ <h1>Tile endpoint to serve vector tiles</h1>
564566
"""
565567
select ST_AsMVT({
566568
"geometry": ST_AsMVTGeom(
567-
st_transform(st_geomfromtext(geometry), 'OGC:CRS84', 'EPSG:3857'),
569+
st_transform(st_geomfromwkb(geometry), 'OGC:CRS84', 'EPSG:3857'),
568570
ST_Extent(ST_TileEnvelope($1, $2, $3))
569571
)
570572
}) from da
@@ -654,7 +656,10 @@ <h1>HTML content for the index page</h1>
654656
},
655657
// Zoom in on amf
656658
center: [5.38327, 52.15660],
657-
zoom: 12
659+
zoom: 12,
660+
prefetchZoomDelta: 0, // disables zoom-level prefetch
661+
refreshExpiredTiles: false, // don’t re-request tiles that have expired
662+
658663
});
659664

660665
map.addControl(new maplibregl.NavigationControl());

0 commit comments

Comments
 (0)