Skip to content

Commit 6fde3e5

Browse files
Merge branch 'beta'
2 parents c867b70 + 115f36c commit 6fde3e5

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

src/components/MapPin.svelte

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@
77
88
const { map } = getOlContext()
99
10-
map.on('click', async (e) => {
10+
const LONG_PRESS_THRESHOLD = 500;
11+
12+
let mouseDownAt: number;
13+
map.getTargetElement().addEventListener('mousedown', e => {
14+
mouseDownAt = Date.now();
15+
});
16+
17+
map.on('singleclick', async (e) => {
18+
const pressDuration = Date.now() - mouseDownAt
19+
if (pressDuration < LONG_PRESS_THRESHOLD) {
20+
return
21+
}
22+
1123
const [lng, lat] = toLonLat(e.coordinate)
1224
const closestPoint = await findPlace(lat, lng)
1325
$fragment.label = {

src/layers/layerDefinitions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export const linzTopo: TileLayerDefinition =
3333
},
3434
};
3535

36+
const LINZ_BASEMAPS = 'd01fbtg0ar3v159zx4e0ajt0n09'
3637
export const layerDefinitions: TileLayerDefinition[] = [
3738
linzTopo,
3839
{
@@ -52,16 +53,15 @@ export const layerDefinitions: TileLayerDefinition[] = [
5253
description: "High resolution imagery of New Zealand, provided by LINZ",
5354
type: 'base',
5455
url: ([z,x,y]: TileCoord) => {
55-
return `https://basemaps.linz.govt.nz/v1/tiles/aerial/EPSG:3857/${z}/${x}/${y}.webp?api=d01fbtg0ar3v159zx4e0ajt0n09`;
56+
return `https://basemaps.linz.govt.nz/v1/tiles/aerial/EPSG:3857/${z}/${x}/${y}.webp?api=${LINZ_BASEMAPS}`;
5657
}
5758
},
5859
{
59-
name: "Hillshade",
60+
name: "Hill shade",
6061
description: "Terrain relief overlay",
6162
type: 'overlay',
6263
defaultVisible: true,
63-
prerender: e => e.context!.canvas.getContext('2d')!.globalCompositeOperation = 'multiply',
6464
minZoom: 10,
65-
url: 'https://tiles-cdn.koordinates.com/services;key=d0772bed2204423f87157f7fb1223389/tiles/v4/layer=50765/EPSG:3857/{z}/{x}/{y}.png'
66-
}
65+
url: `https://basemaps.linz.govt.nz/v1/tiles/geographx-nz-dem-2012-8m/WebMercatorQuad/{z}/{x}/{y}.webp?api=${LINZ_BASEMAPS}`,
66+
},
6767
]

0 commit comments

Comments
 (0)