Skip to content

Commit d2432de

Browse files
author
Vincent van der Wal
committed
add dem
1 parent f643158 commit d2432de

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

src/main.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ if (mapContainer) {
180180
map.addControl(
181181
new maplibregl.GeolocateControl({
182182
fitBoundsOptions: {
183-
maxZoom: 9.5
183+
maxZoom: 13.5
184184
},
185185
positionOptions: {
186186
enableHighAccuracy: true
@@ -196,6 +196,28 @@ if (mapContainer) {
196196
map.scrollZoom.setWheelZoomRate(1 / 90);
197197

198198
map.on('load', async () => {
199+
map.addSource('rasterDem', {
200+
type: 'raster-dem',
201+
tiles: [
202+
'https://mbtiles.servert.nl/services/copernicus-terrain/tiles/{z}/{x}/{y}.png'
203+
],
204+
tileSize: 256
205+
});
206+
207+
map.addLayer(
208+
{
209+
source: 'rasterDem',
210+
id: 'rasterDemLayer',
211+
type: 'hillshade',
212+
paint: {
213+
'hillshade-method': 'igor',
214+
'hillshade-shadow-color': 'rgba(0,0,0,0.25)',
215+
'hillshade-highlight-color': 'rgba(255,255,255,0.25)'
216+
}
217+
},
218+
'road_area_pier'
219+
);
220+
199221
omUrl = getOMUrl();
200222
source = map.addSource('omFileSource', {
201223
type: 'raster',

src/worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const drawArrow = (
8686
rgba[4 * indTile + 2] = 0;
8787
rgba[4 * indTile + 3] =
8888
northArrow[4 * ind + 3] *
89-
Math.min(((px - 2) / 50) * 50, 100) *
89+
Math.min(((px - 2) / 200) * 50, 100) *
9090
(OPACITY / 50);
9191
}
9292
}

0 commit comments

Comments
 (0)