@basemaps/landing 6.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1097 -0
- package/LICENSE +21 -0
- package/README.md +3 -0
- package/build/__test__/config.debug.test.d.ts +2 -0
- package/build/__test__/config.debug.test.d.ts.map +1 -0
- package/build/__test__/config.debug.test.js +28 -0
- package/build/__test__/config.test.d.ts +2 -0
- package/build/__test__/config.test.d.ts.map +1 -0
- package/build/__test__/config.test.js +8 -0
- package/build/__test__/geojson.test.d.ts +2 -0
- package/build/__test__/geojson.test.d.ts.map +1 -0
- package/build/__test__/geojson.test.js +42 -0
- package/build/__test__/map.config.test.d.ts +2 -0
- package/build/__test__/map.config.test.d.ts.map +1 -0
- package/build/__test__/map.config.test.js +103 -0
- package/build/__test__/tile.matrix.test.d.ts +2 -0
- package/build/__test__/tile.matrix.test.d.ts.map +1 -0
- package/build/__test__/tile.matrix.test.js +29 -0
- package/build/attribution.d.ts +48 -0
- package/build/attribution.d.ts.map +1 -0
- package/build/attribution.js +137 -0
- package/build/components/copyable.d.ts +14 -0
- package/build/components/copyable.d.ts.map +1 -0
- package/build/components/copyable.js +26 -0
- package/build/components/debug.d.ts +34 -0
- package/build/components/debug.d.ts.map +1 -0
- package/build/components/debug.js +309 -0
- package/build/components/layer.switcher.dropdown.d.ts +21 -0
- package/build/components/layer.switcher.dropdown.d.ts.map +1 -0
- package/build/components/layer.switcher.dropdown.js +68 -0
- package/build/components/layout.footer.d.ts +8 -0
- package/build/components/layout.footer.d.ts.map +1 -0
- package/build/components/layout.footer.js +23 -0
- package/build/components/layout.header.d.ts +23 -0
- package/build/components/layout.header.d.ts.map +1 -0
- package/build/components/layout.header.js +98 -0
- package/build/components/link.d.ts +17 -0
- package/build/components/link.d.ts.map +1 -0
- package/build/components/link.js +12 -0
- package/build/components/map.d.ts +31 -0
- package/build/components/map.d.ts.map +1 -0
- package/build/components/map.js +136 -0
- package/build/components/map.switcher.d.ts +21 -0
- package/build/components/map.switcher.d.ts.map +1 -0
- package/build/components/map.switcher.js +78 -0
- package/build/config.d.ts +15 -0
- package/build/config.d.ts.map +1 -0
- package/build/config.debug.d.ts +22 -0
- package/build/config.debug.d.ts.map +1 -0
- package/build/config.debug.js +62 -0
- package/build/config.js +43 -0
- package/build/config.map.d.ts +51 -0
- package/build/config.map.d.ts.map +1 -0
- package/build/config.map.js +179 -0
- package/build/global.d.ts +9 -0
- package/build/global.d.ts.map +1 -0
- package/build/global.js +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +21 -0
- package/build/split.d.ts +11 -0
- package/build/split.d.ts.map +1 -0
- package/build/split.js +45 -0
- package/build/tile.matrix.d.ts +23 -0
- package/build/tile.matrix.d.ts.map +1 -0
- package/build/tile.matrix.js +77 -0
- package/build/url.d.ts +37 -0
- package/build/url.d.ts.map +1 -0
- package/build/url.js +78 -0
- package/build/webp.d.ts +3 -0
- package/build/webp.d.ts.map +1 -0
- package/build/webp.js +32 -0
- package/package.json +107 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { GoogleTms } from '@basemaps/geo';
|
|
3
|
+
import { Component, Fragment } from 'preact';
|
|
4
|
+
import { Config } from '../config.js';
|
|
5
|
+
import { MapConfig } from '../config.map.js';
|
|
6
|
+
import { projectGeoJson } from '../tile.matrix.js';
|
|
7
|
+
import { WindowUrl } from '../url.js';
|
|
8
|
+
function debugSlider(label, onInput) {
|
|
9
|
+
return (_jsx("input", { className: "debug__slider", type: "range", min: "0", max: "1", step: "0.05", value: String(Config.map.debug[`debug.layer.${label}`]), onInput: onInput }));
|
|
10
|
+
}
|
|
11
|
+
export class Debug extends Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.waitForMap = () => {
|
|
15
|
+
const map = this.props.map;
|
|
16
|
+
if (map == null) {
|
|
17
|
+
setTimeout(this.waitForMap, 20);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
window.MaplibreMap = map;
|
|
21
|
+
map.resize();
|
|
22
|
+
map.once('load', () => {
|
|
23
|
+
Config.map.on('change', () => {
|
|
24
|
+
if (this.props.map == null)
|
|
25
|
+
return;
|
|
26
|
+
const locationHash = WindowUrl.toHash(Config.map.getLocation(this.props.map));
|
|
27
|
+
const locationSearch = '?' + MapConfig.toUrl(Config.map);
|
|
28
|
+
window.history.replaceState(null, '', locationSearch + locationHash);
|
|
29
|
+
this.updateFromConfig();
|
|
30
|
+
});
|
|
31
|
+
this.updateFromConfig();
|
|
32
|
+
// Jam a div into the page once the map has loaded so tools like playwright can see the map has finished loading
|
|
33
|
+
if (Config.map.debug['debug.screenshot']) {
|
|
34
|
+
const loadedDiv = document.createElement('div');
|
|
35
|
+
loadedDiv.id = 'map-loaded';
|
|
36
|
+
document.body.appendChild(loadedDiv);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
/** Show the source bounding box ont he map */
|
|
41
|
+
this.toggleSource = (e) => {
|
|
42
|
+
const target = e.target;
|
|
43
|
+
Config.map.setDebug('debug.source', target.checked);
|
|
44
|
+
this.setSourceShown(target.checked);
|
|
45
|
+
};
|
|
46
|
+
this._layerLoading = new Map();
|
|
47
|
+
this._styleJson = null;
|
|
48
|
+
this.adjustTopographic = (e) => {
|
|
49
|
+
const slider = e.target;
|
|
50
|
+
Config.map.setDebug('debug.layer.linz-topographic', Number(slider.value));
|
|
51
|
+
};
|
|
52
|
+
this.adjustOsm = (e) => {
|
|
53
|
+
Config.map.setDebug('debug.layer.osm', Number(e.target.value));
|
|
54
|
+
};
|
|
55
|
+
this.adjustLinzAerial = (e) => {
|
|
56
|
+
Config.map.setDebug('debug.layer.linz-aerial', Number(e.target.value));
|
|
57
|
+
};
|
|
58
|
+
this.togglePurple = (e) => {
|
|
59
|
+
const target = e.target;
|
|
60
|
+
this.setPurple(target.checked);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
componentDidMount() {
|
|
64
|
+
this.waitForMap();
|
|
65
|
+
}
|
|
66
|
+
updateFromConfig() {
|
|
67
|
+
this.setPurple(Config.map.debug['debug.background'] === 'magenta');
|
|
68
|
+
this.adjustRaster('osm', Config.map.debug['debug.layer.osm']);
|
|
69
|
+
this.adjustRaster('linz-aerial', Config.map.debug['debug.layer.linz-aerial']);
|
|
70
|
+
this.adjustVector(Config.map.debug['debug.layer.linz-topographic']);
|
|
71
|
+
this.setSourceShown(Config.map.debug['debug.source']);
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
if (Config.map.debug['debug.screenshot'])
|
|
75
|
+
return null;
|
|
76
|
+
return (_jsxs("div", { className: "debug", children: [_jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "ImageId" }), _jsx("div", { className: "debug__value", children: Config.map.layerId })] }), _jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "Projection " }), _jsx("div", { className: "debug__value", children: Config.map.tileMatrix.projection.toEpsgString() })] }), _jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "TileMatrix " }), _jsx("div", { className: "debug__value", children: Config.map.tileMatrix.identifier })] }), this.renderSliders(), this.renderPurple(), this.renderSourceToggle()] }));
|
|
77
|
+
}
|
|
78
|
+
renderPurple() {
|
|
79
|
+
if (Config.map.debug['debug.screenshot'])
|
|
80
|
+
return;
|
|
81
|
+
return (_jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "Purple" }), _jsx("input", { type: "checkbox", onClick: this.togglePurple, checked: Config.map.debug['debug.background'] === 'magenta' })] }));
|
|
82
|
+
}
|
|
83
|
+
renderSourceToggle() {
|
|
84
|
+
// TODO this is a nasty hack to detect if a direct imageryId is being viewed
|
|
85
|
+
if (!Config.map.layerId.startsWith('01'))
|
|
86
|
+
return null;
|
|
87
|
+
return (_jsxs(Fragment, { children: [_jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "Source" }), _jsx("input", { type: "checkbox", onClick: this.toggleSource, checked: Config.map.debug['debug.source'] })] }), this.state.lastFeatureId == null ? null : (_jsxs("div", { className: "debug__info", title: String(this.state.lastFeatureName), children: [_jsx("label", { className: "debug__label", children: "SourceId" }), String(this.state.lastFeatureName).split('/').pop()] }))] }));
|
|
88
|
+
}
|
|
89
|
+
trackMouseMove(layerId) {
|
|
90
|
+
const sourceId = `${layerId}_source`;
|
|
91
|
+
const layerFillId = `${sourceId}_fill`;
|
|
92
|
+
const map = this.props.map;
|
|
93
|
+
let lastFeatureId;
|
|
94
|
+
map.on('mousemove', layerFillId, (e) => {
|
|
95
|
+
var _a;
|
|
96
|
+
const features = e.features;
|
|
97
|
+
if (features == null || features.length === 0)
|
|
98
|
+
return;
|
|
99
|
+
const firstFeature = features[0];
|
|
100
|
+
if (firstFeature.id === lastFeatureId)
|
|
101
|
+
return;
|
|
102
|
+
if (lastFeatureId != null)
|
|
103
|
+
map.setFeatureState({ source: sourceId, id: lastFeatureId }, { hover: false });
|
|
104
|
+
lastFeatureId = firstFeature.id;
|
|
105
|
+
this.setState({ ...this.state, lastFeatureId, lastFeatureName: (_a = firstFeature.properties) === null || _a === void 0 ? void 0 : _a['name'] });
|
|
106
|
+
map.setFeatureState({ source: sourceId, id: lastFeatureId }, { hover: true });
|
|
107
|
+
});
|
|
108
|
+
map.on('mouseleave', layerFillId, () => {
|
|
109
|
+
if (lastFeatureId == null)
|
|
110
|
+
return;
|
|
111
|
+
map.setFeatureState({ source: sourceId, id: lastFeatureId }, { hover: false });
|
|
112
|
+
lastFeatureId = undefined;
|
|
113
|
+
this.setState({ ...this.state, lastFeatureId, lastFeatureName: undefined });
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
setSourceShown(isShown) {
|
|
117
|
+
const map = this.props.map;
|
|
118
|
+
const layerId = Config.map.layerId;
|
|
119
|
+
const sourceId = `${layerId}_source`;
|
|
120
|
+
const layerFillId = `${sourceId}_fill`;
|
|
121
|
+
const layerLineId = `${sourceId}_line`;
|
|
122
|
+
if (isShown === false) {
|
|
123
|
+
if (map.getLayer(layerFillId) == null)
|
|
124
|
+
return;
|
|
125
|
+
map.removeLayer(layerFillId);
|
|
126
|
+
map.removeLayer(layerLineId);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
if (map.getLayer(layerFillId) != null)
|
|
130
|
+
return;
|
|
131
|
+
this.loadSourceLayer(layerId).then(() => {
|
|
132
|
+
if (map.getLayer(layerFillId) != null)
|
|
133
|
+
return;
|
|
134
|
+
// Fill is needed to make the mouse move work even though it has opacity 0
|
|
135
|
+
map.addLayer({
|
|
136
|
+
id: layerFillId,
|
|
137
|
+
type: 'fill',
|
|
138
|
+
source: sourceId,
|
|
139
|
+
paint: {
|
|
140
|
+
'fill-opacity': ['case', ['boolean', ['feature-state', 'hover'], false], 0.25, 0],
|
|
141
|
+
'fill-color': '#ff00ff',
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
map.addLayer({
|
|
145
|
+
id: layerLineId,
|
|
146
|
+
type: 'line',
|
|
147
|
+
source: sourceId,
|
|
148
|
+
paint: {
|
|
149
|
+
'line-color': '#ff00ff',
|
|
150
|
+
'line-opacity': ['case', ['boolean', ['feature-state', 'hover'], false], 1, 0.5],
|
|
151
|
+
'line-width': ['case', ['boolean', ['feature-state', 'hover'], false], 2, 1],
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
this.trackMouseMove(layerId);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
loadSourceLayer(layerId) {
|
|
158
|
+
let existing = this._layerLoading.get(layerId);
|
|
159
|
+
if (existing == null) {
|
|
160
|
+
existing = this._loadSourceLayer(layerId);
|
|
161
|
+
this._layerLoading.set(layerId, existing);
|
|
162
|
+
}
|
|
163
|
+
return existing;
|
|
164
|
+
}
|
|
165
|
+
async _loadSourceLayer(layerId) {
|
|
166
|
+
const map = this.props.map;
|
|
167
|
+
const sourceId = `${layerId}_source`;
|
|
168
|
+
const layerFillId = `${sourceId}_fill`;
|
|
169
|
+
if (map.getLayer(layerFillId) != null)
|
|
170
|
+
return;
|
|
171
|
+
const sourceUri = WindowUrl.toImageryUrl(`im_${layerId}`, 'source.geojson');
|
|
172
|
+
const res = await fetch(sourceUri);
|
|
173
|
+
if (!res.ok)
|
|
174
|
+
return;
|
|
175
|
+
const data = await res.json();
|
|
176
|
+
if (Config.map.tileMatrix.projection !== GoogleTms.projection)
|
|
177
|
+
projectGeoJson(data, Config.map.tileMatrix);
|
|
178
|
+
let id = 0;
|
|
179
|
+
// Ensure there is a id on each feature
|
|
180
|
+
for (const f of data.features)
|
|
181
|
+
f.id = id++;
|
|
182
|
+
map.addSource(sourceId, { type: 'geojson', data });
|
|
183
|
+
}
|
|
184
|
+
renderSliders() {
|
|
185
|
+
// Disable the sliders for screenshots
|
|
186
|
+
if (Config.map.debug['debug.screenshot'])
|
|
187
|
+
return;
|
|
188
|
+
// Only 3857 currently works with OSM/Topographic map
|
|
189
|
+
if (Config.map.tileMatrix.identifier !== GoogleTms.identifier) {
|
|
190
|
+
return (_jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "LINZ Aerial" }), debugSlider('linz-aerial', this.adjustLinzAerial)] }));
|
|
191
|
+
}
|
|
192
|
+
return (_jsxs(Fragment, { children: [_jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "OSM" }), debugSlider('osm', this.adjustOsm)] }), _jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "Topographic" }), debugSlider('linz-topographic', this.adjustTopographic)] }), _jsxs("div", { className: "debug__info", children: [_jsx("label", { className: "debug__label", children: "LINZ Aerial" }), debugSlider('linz-aerial', this.adjustLinzAerial)] })] }));
|
|
193
|
+
}
|
|
194
|
+
get styleJson() {
|
|
195
|
+
if (this._styleJson == null) {
|
|
196
|
+
this._styleJson = fetch(WindowUrl.toTileUrl("style" /* TileVectorStyle */, Config.map.tileMatrix, 'topographic', 'topographic')).then((f) => f.json());
|
|
197
|
+
}
|
|
198
|
+
return this._styleJson;
|
|
199
|
+
}
|
|
200
|
+
async adjustVector(value) {
|
|
201
|
+
var _a, _b, _c, _d;
|
|
202
|
+
const styleJson = await this.styleJson;
|
|
203
|
+
const map = this.props.map;
|
|
204
|
+
const hasTopographic = map.getSource('LINZ Basemaps');
|
|
205
|
+
if (hasTopographic == null) {
|
|
206
|
+
if (value === 0)
|
|
207
|
+
return; // Going to remove it anyway so just abort early
|
|
208
|
+
const source = (_a = styleJson.sources) === null || _a === void 0 ? void 0 : _a['LINZ Basemaps'];
|
|
209
|
+
if (source == null)
|
|
210
|
+
return;
|
|
211
|
+
map.addSource('LINZ Basemaps', source);
|
|
212
|
+
map.setStyle({ ...map.getStyle(), glyphs: styleJson.glyphs, sprite: styleJson.sprite });
|
|
213
|
+
// Setting glyphs/sprites forces a full map refresh, wait for the refresh before adjusting the style
|
|
214
|
+
map.once('style.load', () => this.adjustVector(value));
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const layers = (_c = (_b = styleJson.layers) === null || _b === void 0 ? void 0 : _b.filter((f) => f.type !== 'custom' && f.source === 'LINZ Basemaps')) !== null && _c !== void 0 ? _c : [];
|
|
218
|
+
// Do not hide topographic layers when trying to inspect the topographic layer
|
|
219
|
+
if (Config.map.layerId === 'topographic')
|
|
220
|
+
return;
|
|
221
|
+
// Force all the layers to be invisible to start, otherwise the map will "flash" on then off
|
|
222
|
+
for (const layer of layers) {
|
|
223
|
+
if (layer.type === 'custom')
|
|
224
|
+
continue;
|
|
225
|
+
const paint = ((_d = layer.paint) !== null && _d !== void 0 ? _d : {});
|
|
226
|
+
if (layer.type === 'symbol') {
|
|
227
|
+
paint['icon-opacity'] = 0;
|
|
228
|
+
paint['text-opacity'] = 0;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
paint[`${layer.type}-opacity`] = 0;
|
|
232
|
+
}
|
|
233
|
+
layer.paint = paint;
|
|
234
|
+
}
|
|
235
|
+
if (value === 0) {
|
|
236
|
+
for (const layer of layers) {
|
|
237
|
+
if (map.getLayer(layer.id) == null)
|
|
238
|
+
continue;
|
|
239
|
+
map.removeLayer(layer.id);
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
// Ensure all the layers are loaded before styling
|
|
244
|
+
if (map.getLayer(layers[0].id) == null) {
|
|
245
|
+
if (value === 0)
|
|
246
|
+
return;
|
|
247
|
+
for (const layer of layers)
|
|
248
|
+
map.addLayer(layer);
|
|
249
|
+
}
|
|
250
|
+
for (const layer of layers) {
|
|
251
|
+
if (map.getLayer(layer.id) == null)
|
|
252
|
+
continue;
|
|
253
|
+
if (layer.type === 'symbol') {
|
|
254
|
+
map.setPaintProperty(layer.id, `icon-opacity`, value);
|
|
255
|
+
map.setPaintProperty(layer.id, `text-opacity`, value);
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
map.setPaintProperty(layer.id, `${layer.type}-opacity`, value);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
adjustRaster(rasterId, range) {
|
|
263
|
+
if (this.props.map.getSource(rasterId) == null) {
|
|
264
|
+
this.props.map.addSource(rasterId, {
|
|
265
|
+
type: 'raster',
|
|
266
|
+
tiles: [getTileServerUrl(rasterId)],
|
|
267
|
+
tileSize: 256,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
const isLayerMissing = this.props.map.getLayer(rasterId) == null;
|
|
271
|
+
if (range === 0) {
|
|
272
|
+
if (!isLayerMissing)
|
|
273
|
+
this.props.map.removeLayer(rasterId);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (isLayerMissing) {
|
|
277
|
+
this.props.map.addLayer({
|
|
278
|
+
id: rasterId,
|
|
279
|
+
type: 'raster',
|
|
280
|
+
source: rasterId,
|
|
281
|
+
minzoom: 0,
|
|
282
|
+
maxzoom: 24,
|
|
283
|
+
paint: { 'raster-opacity': 0 },
|
|
284
|
+
});
|
|
285
|
+
// Ensure this raster layers are below the vector layer
|
|
286
|
+
const sourceLayerId = `${Config.map.layerId}_source_fill`;
|
|
287
|
+
const isSourceLayerEnabled = this.props.map.getLayer(sourceLayerId) != null;
|
|
288
|
+
if (isSourceLayerEnabled) {
|
|
289
|
+
this.props.map.moveLayer(rasterId, sourceLayerId);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
this.props.map.setPaintProperty(rasterId, 'raster-opacity', range);
|
|
293
|
+
}
|
|
294
|
+
setPurple(isPurple) {
|
|
295
|
+
Config.map.setDebug('debug.background', isPurple ? 'magenta' : false);
|
|
296
|
+
if (isPurple)
|
|
297
|
+
document.body.style.backgroundColor = 'magenta';
|
|
298
|
+
else
|
|
299
|
+
document.body.style.backgroundColor = '';
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
export function getTileServerUrl(tileServer) {
|
|
303
|
+
if (tileServer === 'osm')
|
|
304
|
+
return 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';
|
|
305
|
+
if (tileServer === 'linz-aerial') {
|
|
306
|
+
return WindowUrl.toTileUrl("raster" /* TileRaster */, Config.map.tileMatrix, 'aerial');
|
|
307
|
+
}
|
|
308
|
+
throw new Error('Unknown tile server');
|
|
309
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Component, ComponentChild } from 'preact';
|
|
2
|
+
import { LayerInfo } from '../config.map.js';
|
|
3
|
+
export interface LayerSwitcherDropdownState {
|
|
4
|
+
layers?: Map<string, LayerInfo>;
|
|
5
|
+
/** Is the layer switcher turned on */
|
|
6
|
+
isEnabled?: boolean;
|
|
7
|
+
/** Can users select individual aerial imagery layers */
|
|
8
|
+
isIndividualEnabled?: boolean;
|
|
9
|
+
/** Can users select the basic style */
|
|
10
|
+
isBasicStyleEnabled?: boolean;
|
|
11
|
+
currentLayer: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class LayerSwitcherDropdown extends Component<unknown, LayerSwitcherDropdownState> {
|
|
14
|
+
_events: (() => boolean)[];
|
|
15
|
+
componentWillMount(): void;
|
|
16
|
+
componentWillUnmount(): void;
|
|
17
|
+
onChange: (e: Event) => void;
|
|
18
|
+
render(): ComponentChild;
|
|
19
|
+
renderAerialLayers(): ComponentChild;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=layer.switcher.dropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layer.switcher.dropdown.d.ts","sourceRoot":"","sources":["../../src/components/layer.switcher.dropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAY,MAAM,QAAQ,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAa,MAAM,kBAAkB,CAAC;AAGxD,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAChC,sCAAsC;IACtC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wDAAwD;IACxD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,uCAAuC;IACvC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AACD,qBAAa,qBAAsB,SAAQ,SAAS,CAAC,OAAO,EAAE,0BAA0B,CAAC;IACvF,OAAO,EAAE,CAAC,MAAM,OAAO,CAAC,EAAE,CAAM;IAChC,kBAAkB,IAAI,IAAI;IAkB1B,oBAAoB,IAAI,IAAI;IAK5B,QAAQ,MAAO,KAAK,KAAG,IAAI,CAczB;IAEF,MAAM,IAAI,cAAc;IAiBxB,kBAAkB,IAAI,cAAc;CAuBrC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { Component, Fragment } from 'preact';
|
|
3
|
+
import { Config, gaEvent } from '../config.js';
|
|
4
|
+
import { MapConfig } from '../config.map.js';
|
|
5
|
+
import { SplitIo } from '../split.js';
|
|
6
|
+
export class LayerSwitcherDropdown extends Component {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this._events = [];
|
|
10
|
+
this.onChange = (e) => {
|
|
11
|
+
const target = e.target;
|
|
12
|
+
const [layerId, style] = target.value.split('::');
|
|
13
|
+
Config.map.setLayerId(layerId, style);
|
|
14
|
+
gaEvent("Ui" /* Ui */, 'layer:' + target.value);
|
|
15
|
+
// Configure the bounds of the map to match the new layer
|
|
16
|
+
Config.map.layers.then((f) => {
|
|
17
|
+
const layer = f.get(layerId);
|
|
18
|
+
if (layer == null)
|
|
19
|
+
return;
|
|
20
|
+
Config.map.emit('bounds', [layer.upperLeft, layer.lowerRight]);
|
|
21
|
+
});
|
|
22
|
+
window.history.pushState(null, '', `?${MapConfig.toUrl(Config.map)}`);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
componentWillMount() {
|
|
26
|
+
SplitIo.getClient().then((f) => {
|
|
27
|
+
const isEnabled = (f === null || f === void 0 ? void 0 : f.getTreatment('layer-switcher-dropdown')) === 'on';
|
|
28
|
+
const isIndividualEnabled = (f === null || f === void 0 ? void 0 : f.getTreatment('layer-switcher-individual-layers')) === 'on';
|
|
29
|
+
const isBasicStyleEnabled = (f === null || f === void 0 ? void 0 : f.getTreatment('layer-switcher-basic')) === 'on';
|
|
30
|
+
this.setState({ ...this.state, isEnabled, isIndividualEnabled, isBasicStyleEnabled });
|
|
31
|
+
/** Load all the map config layers */
|
|
32
|
+
if (isEnabled)
|
|
33
|
+
Config.map.layers.then((layers) => this.setState({ ...this.state, layers }));
|
|
34
|
+
});
|
|
35
|
+
this.setState({ ...this.state, currentLayer: Config.map.layerKey });
|
|
36
|
+
this._events.push(Config.map.on('layer', () => this.setState({ ...this.state, currentLayer: Config.map.layerKey })), Config.map.on('tileMatrix', () => this.setState(this.state)));
|
|
37
|
+
}
|
|
38
|
+
componentWillUnmount() {
|
|
39
|
+
for (const e of this._events)
|
|
40
|
+
e();
|
|
41
|
+
this._events = [];
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
if (this.state.isEnabled !== true)
|
|
45
|
+
return;
|
|
46
|
+
return (_jsxs("div", { class: "LuiDeprecatedForms", children: [_jsx("h6", { children: "Layers" }), _jsxs("select", { onChange: this.onChange, value: this.state.currentLayer, children: [_jsxs("optgroup", { label: "Basemaps", children: [_jsx("option", { value: "aerial", children: " Aerial Imagery" }), _jsx("option", { value: "topographic::topographic", children: "Topographic" }), this.state.isBasicStyleEnabled ? _jsx("option", { value: "topographic::basic", children: "Basic" }) : undefined] }), this.renderAerialLayers()] })] }));
|
|
47
|
+
}
|
|
48
|
+
renderAerialLayers() {
|
|
49
|
+
if (this.state.isIndividualEnabled !== true)
|
|
50
|
+
return;
|
|
51
|
+
if (this.state.layers == null || this.state.layers.size === 0)
|
|
52
|
+
return;
|
|
53
|
+
const rural = [];
|
|
54
|
+
const urban = [];
|
|
55
|
+
for (const layer of this.state.layers.values()) {
|
|
56
|
+
if (!layer.projections.has(Config.map.tileMatrix.projection.code))
|
|
57
|
+
continue;
|
|
58
|
+
const node = _jsx("option", { value: layer.id, children: layer.name });
|
|
59
|
+
if (layer.name.toLowerCase().includes(' rural '))
|
|
60
|
+
rural.push(node);
|
|
61
|
+
else
|
|
62
|
+
urban.push(node);
|
|
63
|
+
}
|
|
64
|
+
if (rural.length === 0 || urban.length === 0)
|
|
65
|
+
return;
|
|
66
|
+
return (_jsxs(Fragment, { children: [_jsxs("optgroup", { label: "Aerial Imagery - Urban", children: [...urban] }), ";", _jsxs("optgroup", { label: "Aerial Imagery - Rural", children: [...rural] }), ";"] }));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Component, ComponentChild } from 'preact';
|
|
2
|
+
export declare class Footer extends Component {
|
|
3
|
+
_events: (() => boolean)[];
|
|
4
|
+
componentWillMount(): void;
|
|
5
|
+
componentWillUnmount(): void;
|
|
6
|
+
render(): ComponentChild;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=layout.footer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.footer.d.ts","sourceRoot":"","sources":["../../src/components/layout.footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAInD,qBAAa,MAAO,SAAQ,SAAS;IACnC,OAAO,EAAE,CAAC,MAAM,OAAO,CAAC,EAAE,CAAM;IAChC,kBAAkB,IAAI,IAAI;IAG1B,oBAAoB,IAAI,IAAI;IAK5B,MAAM,IAAI,cAAc;CA8BzB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { Component } from 'preact';
|
|
3
|
+
import { Config } from '../config.js';
|
|
4
|
+
import { Link } from './link.js';
|
|
5
|
+
export class Footer extends Component {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this._events = [];
|
|
9
|
+
}
|
|
10
|
+
componentWillMount() {
|
|
11
|
+
this._events.push(Config.map.on('change', () => this.setState(this.state)));
|
|
12
|
+
}
|
|
13
|
+
componentWillUnmount() {
|
|
14
|
+
for (const e of this._events)
|
|
15
|
+
e();
|
|
16
|
+
this._events = [];
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
if (Config.map.isDebug)
|
|
20
|
+
return;
|
|
21
|
+
return (_jsx("footer", { class: "lui-footer lui-footer-small lui-hide-sm lui-hide-xs", role: "contentinfo", children: _jsxs("div", { class: "lui-footer-columns", children: [_jsx("div", { style: "display:flex; align-items:center", children: _jsx(Link, { href: "http://www.govt.nz/", ariaLabel: "New Zealand Government", children: _jsx("img", { src: "/assets/logo-nz-govt.svg" }) }) }), _jsx("div", { class: "justify-end", children: _jsxs("ul", { class: "lui-footer-list", children: [_jsx("li", { class: "lui-footer-inline-list-item", children: "\u00A9 2021 Land Information New Zealand" }), _jsx("li", { class: "lui-footer-inline-list-item", children: _jsx(Link, { href: "https://www.linz.govt.nz/contact-us", children: "Contact" }) }), _jsx("li", { class: "lui-footer-inline-list-item", children: _jsx(Link, { href: "https://www.linz.govt.nz/privacy", children: "Privacy" }) }), _jsx("li", { class: "lui-footer-inline-list-item", children: _jsx(Link, { href: "https://www.linz.govt.nz/data/linz-data/linz-basemaps/data-attribution", children: "Data Attribution" }) })] }) })] }) }));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { EpsgCode } from '@basemaps/geo';
|
|
2
|
+
import { Component, ComponentChild } from 'preact';
|
|
3
|
+
import { LayerInfo } from '../config.map.js';
|
|
4
|
+
export declare class Header extends Component<unknown, {
|
|
5
|
+
isMenuOpen: boolean;
|
|
6
|
+
layers?: Map<string, LayerInfo>;
|
|
7
|
+
}> {
|
|
8
|
+
_events: (() => boolean)[];
|
|
9
|
+
componentWillMount(): void;
|
|
10
|
+
componentWillUnmount(): void;
|
|
11
|
+
menuToggle: () => void;
|
|
12
|
+
render(): ComponentChild;
|
|
13
|
+
contactUs: () => void;
|
|
14
|
+
renderAboutLi(text: string, href: string, icon?: ComponentChild): ComponentChild;
|
|
15
|
+
renderAbout(): ComponentChild;
|
|
16
|
+
renderGithubLogo(): ComponentChild;
|
|
17
|
+
renderLinks(): ComponentChild;
|
|
18
|
+
/** Projections to show WMTS links for */
|
|
19
|
+
_validProjections: Set<EpsgCode>;
|
|
20
|
+
validProjections(): Set<EpsgCode>;
|
|
21
|
+
renderLinksTiles(): ComponentChild;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=layout.header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.header.d.ts","sourceRoot":"","sources":["../../src/components/layout.header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAA8B,MAAM,eAAe,CAAC;AAErE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGnD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAO7C,qBAAa,MAAO,SAAQ,SAAS,CAAC,OAAO,EAAE;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;CAAE,CAAC;IACtG,OAAO,EAAE,CAAC,MAAM,OAAO,CAAC,EAAE,CAAM;IAEhC,kBAAkB,IAAI,IAAI;IAU1B,oBAAoB,IAAI,IAAI;IAK5B,UAAU,QAAO,IAAI,CAInB;IAEF,MAAM,IAAI,cAAc;IA8CxB,SAAS,QAAO,IAAI,CAclB;IAEF,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,cAAc;IAWhF,WAAW,IAAI,cAAc;IA4B7B,gBAAgB,IAAI,cAAc;IAWlC,WAAW,IAAI,cAAc;IAW7B,yCAAyC;IACzC,iBAAiB,gBAA2D;IAC5E,gBAAgB,IAAI,GAAG,CAAC,QAAQ,CAAC;IAKjC,gBAAgB,IAAI,cAAc;CA2BnC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { EpsgCode, GoogleTms, Nztm2000QuadTms } from '@basemaps/geo';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { Component } from 'preact';
|
|
5
|
+
import { Fragment } from 'preact/jsx-runtime';
|
|
6
|
+
import { Config, gaEvent } from '../config.js';
|
|
7
|
+
import { SplitIo } from '../split.js';
|
|
8
|
+
import { Copyable } from './copyable.js';
|
|
9
|
+
import { LayerSwitcherDropdown } from './layer.switcher.dropdown.js';
|
|
10
|
+
import { Icon, Link } from './link.js';
|
|
11
|
+
export class Header extends Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this._events = [];
|
|
15
|
+
this.menuToggle = () => {
|
|
16
|
+
const isMenuOpen = !this.state.isMenuOpen;
|
|
17
|
+
gaEvent("Ui" /* Ui */, isMenuOpen ? 'menu:open' : 'menu:close');
|
|
18
|
+
this.setState({ ...this.state, isMenuOpen });
|
|
19
|
+
};
|
|
20
|
+
this.contactUs = () => {
|
|
21
|
+
const subject = 'Request Basemaps Developer Access';
|
|
22
|
+
const body = `
|
|
23
|
+
Give us a few key details to sign up for Developer Access to LINZ Basemaps. We will respond with your Apps' unique API key.
|
|
24
|
+
|
|
25
|
+
Your Name:
|
|
26
|
+
|
|
27
|
+
Your Email:
|
|
28
|
+
|
|
29
|
+
Your Service/App URL:
|
|
30
|
+
|
|
31
|
+
`;
|
|
32
|
+
gaEvent("Ui" /* Ui */, 'contact-us:click');
|
|
33
|
+
window.location.href = `mailto:basemaps@linz.govt.nz?subject=${encodeURI(subject)}&body=${encodeURI(body)}`;
|
|
34
|
+
};
|
|
35
|
+
/** Projections to show WMTS links for */
|
|
36
|
+
this._validProjections = new Set([EpsgCode.Google, EpsgCode.Nztm2000]);
|
|
37
|
+
}
|
|
38
|
+
componentWillMount() {
|
|
39
|
+
this.setState({ isMenuOpen: false });
|
|
40
|
+
this._events.push(Config.map.on('change', () => this.setState(this.state)));
|
|
41
|
+
// If individual layers are on, we need the layer info to determine if they can use NZTM2000Quad WMTS
|
|
42
|
+
SplitIo.getClient().then((f) => {
|
|
43
|
+
const isIndividualEnabled = (f === null || f === void 0 ? void 0 : f.getTreatment('layer-switcher-individual-layers')) === 'on';
|
|
44
|
+
if (isIndividualEnabled)
|
|
45
|
+
Config.map.layers.then((layers) => this.setState({ ...this.state, layers }));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
componentWillUnmount() {
|
|
49
|
+
for (const e of this._events)
|
|
50
|
+
e();
|
|
51
|
+
this._events = [];
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
if (Config.map.isDebug)
|
|
55
|
+
return;
|
|
56
|
+
return (_jsxs("header", { class: "lui-header", children: [_jsxs("div", { class: "lui-header-row", children: [_jsxs("div", { class: "lui-header-col", children: [_jsx("div", { class: "lui-header-logo", children: _jsx("img", { class: "linz-logo", src: "/assets/logo-linz.svg" }) }), _jsx("div", { class: "lui-header-title", children: _jsx("h1", { children: "Basemaps" }) })] }), _jsx("div", { class: "lui-header-col", children: _jsx("div", { class: "lui-header-menu-item", children: _jsx("div", { class: "lui-header-menu-icon", children: _jsx("i", { class: "material-icons-round md-36", onClick: this.menuToggle, style: { cursor: 'pointer' }, children: this.state.isMenuOpen ? 'close' : 'menu' }) }) }) })] }), _jsxs("div", { class: clsx({
|
|
57
|
+
'lui-menu-drawer': true,
|
|
58
|
+
'lui-menu-drawer-closed': !this.state.isMenuOpen,
|
|
59
|
+
'lui-menu-drawer-wide': true,
|
|
60
|
+
}), "aria-hidden": this.state.isMenuOpen, children: [_jsx(LayerSwitcherDropdown, {}), this.renderLinks(), _jsx("h6", { children: "Developer API Keys" }), _jsx("p", { children: "Contact us for free API keys with better support for public web and mobile apps." }), _jsx("button", { class: "lui-button lui-button-tertiary contact-us", onClick: this.contactUs, children: "Contact us" }), this.renderAbout()] })] }));
|
|
61
|
+
}
|
|
62
|
+
renderAboutLi(text, href, icon) {
|
|
63
|
+
return (_jsx("li", { children: _jsxs(Link, { href: href, children: [text, icon == null ? _jsx(Icon, { name: "launch" }) : icon] }) }));
|
|
64
|
+
}
|
|
65
|
+
renderAbout() {
|
|
66
|
+
return (_jsxs(Fragment, { children: [_jsx("h6", { children: "About Basemaps" }), _jsxs("ul", { class: "about-links", children: [this.renderAboutLi('Get started', 'https://www.linz.govt.nz/data/linz-data/linz-basemaps/get-started-linz-basemaps'), this.renderAboutLi('Technical information', 'https://www.linz.govt.nz/data/linz-data/linz-basemaps/linz-basemaps-documentation'), this.renderAboutLi('How to use our APIs', 'https://www.linz.govt.nz/data/linz-data/linz-basemaps/how-use-linz-basemaps-apis'), this.renderAboutLi('Github', 'https://github.com/linz/basemaps', this.renderGithubLogo()), _jsx("li", { children: _jsxs(Link, { href: "https://github.com/linz/basemaps/blob/master/CHANGELOG.md", children: ["Version ", _jsx("span", { class: "basemaps-version", children: Config.Version })] }) })] })] }));
|
|
67
|
+
}
|
|
68
|
+
renderGithubLogo() {
|
|
69
|
+
return (_jsx("svg", { style: "width: 24px; height: 24px", viewBox: "0 0 24 24", children: _jsx("path", { fill: "currentColor", d: "M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z" }) }));
|
|
70
|
+
}
|
|
71
|
+
renderLinks() {
|
|
72
|
+
return (_jsxs(Fragment, { children: [_jsx("h6", { children: "90 day API keys" }), _jsx("p", { children: "API keys expire after 90 days, if a longer duration is needed please request a developer API key" }), _jsx(Copyable, { header: "Api Key", value: Config.ApiKey }), this.renderLinksTiles()] }));
|
|
73
|
+
}
|
|
74
|
+
validProjections() {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
if (this.state.layers == null)
|
|
77
|
+
return this._validProjections;
|
|
78
|
+
return (_b = (_a = this.state.layers.get(Config.map.layerId)) === null || _a === void 0 ? void 0 : _a.projections) !== null && _b !== void 0 ? _b : this._validProjections;
|
|
79
|
+
}
|
|
80
|
+
renderLinksTiles() {
|
|
81
|
+
if (Config.map.isVector) {
|
|
82
|
+
return (_jsxs(Fragment, { children: [_jsx(Copyable, { header: "StyleJSON", value: Config.map.toTileUrl("style" /* TileVectorStyle */) }), _jsx(Copyable, { header: "XYZ", value: Config.map.toTileUrl("vector-xyz" /* TileVectorXyz */) })] }));
|
|
83
|
+
}
|
|
84
|
+
const projections = this.validProjections();
|
|
85
|
+
const children = [];
|
|
86
|
+
if (projections.has(EpsgCode.Nztm2000)) {
|
|
87
|
+
const nztmTileUrl = Config.map.toTileUrl("wmts" /* Wmts */, Nztm2000QuadTms);
|
|
88
|
+
children.push(_jsx(Copyable, { header: "WMTS: NZTM2000Quad", value: nztmTileUrl }));
|
|
89
|
+
}
|
|
90
|
+
if (projections.has(EpsgCode.Google)) {
|
|
91
|
+
const googleTileUrl = Config.map.toTileUrl("wmts" /* Wmts */, GoogleTms);
|
|
92
|
+
const googleXyzTileUrl = Config.map.toTileUrl("raster" /* TileRaster */, GoogleTms);
|
|
93
|
+
children.push(_jsx(Copyable, { header: "WMTS: WebMercatorQuad", value: googleTileUrl }));
|
|
94
|
+
children.push(_jsx(Copyable, { header: "XYZ", value: googleXyzTileUrl }));
|
|
95
|
+
}
|
|
96
|
+
return _jsx(Fragment, { children: children });
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, RenderableProps, ComponentChild } from 'preact';
|
|
2
|
+
interface IconProps {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class Icon extends Component<IconProps> {
|
|
6
|
+
render(props: RenderableProps<IconProps>): ComponentChild;
|
|
7
|
+
}
|
|
8
|
+
interface LinkProps {
|
|
9
|
+
href: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare class Link extends Component<LinkProps> {
|
|
14
|
+
render(props: RenderableProps<LinkProps>): ComponentChild;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEpE,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AACD,qBAAa,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IAC5C,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,GAAG,cAAc;CAG1D;AAED,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,qBAAa,IAAK,SAAQ,SAAS,CAAC,SAAS,CAAC;IAC5C,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,SAAS,CAAC,GAAG,cAAc;CAQ1D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
|
|
2
|
+
import { Component } from 'preact';
|
|
3
|
+
export class Icon extends Component {
|
|
4
|
+
render(props) {
|
|
5
|
+
return _jsx("i", { class: "material-icons-round md-36", children: props.name });
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export class Link extends Component {
|
|
9
|
+
render(props) {
|
|
10
|
+
return (_jsxs("a", { rel: "noopener", target: "_blank", href: props.href, style: "display:flex;", "aria-label": props.ariaLabel, children: [props.children, props.icon ? _jsx(Icon, { name: props.icon }) : undefined] }));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import maplibre from 'maplibre-gl';
|
|
2
|
+
import { Component, ComponentChild } from 'preact';
|
|
3
|
+
import { MapAttribution } from '../attribution.js';
|
|
4
|
+
export declare class Basemaps extends Component<unknown, {
|
|
5
|
+
isLayerSwitcherEnabled: boolean;
|
|
6
|
+
}> {
|
|
7
|
+
map: maplibre.Map;
|
|
8
|
+
el: HTMLElement;
|
|
9
|
+
mapAttr: MapAttribution;
|
|
10
|
+
/** Ignore the location updates */
|
|
11
|
+
ignoreNextLocationUpdate: boolean;
|
|
12
|
+
controlGeo: maplibre.GeolocateControl | null;
|
|
13
|
+
updateLocation: () => void;
|
|
14
|
+
updateBounds: (bounds: maplibre.LngLatBoundsLike) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Only show the geocontrol on GoogleTMS
|
|
17
|
+
* As it does not work with the projection logic we are currently using
|
|
18
|
+
*/
|
|
19
|
+
ensureGeoControl(): void;
|
|
20
|
+
updateStyle: () => void;
|
|
21
|
+
componentWillMount(): void;
|
|
22
|
+
componentDidMount(): void;
|
|
23
|
+
_events: (() => boolean)[];
|
|
24
|
+
componentWillUnmount(): void;
|
|
25
|
+
render(): ComponentChild;
|
|
26
|
+
updateUrlTimer: unknown | null;
|
|
27
|
+
onRender: () => void;
|
|
28
|
+
/** Update the window.location with the current location information */
|
|
29
|
+
setLocationUrl(): void;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/components/map.tsx"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAQnD,qBAAa,QAAS,SAAQ,SAAS,CAAC,OAAO,EAAE;IAAE,sBAAsB,EAAE,OAAO,CAAA;CAAE,CAAC;IACnF,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC;IAClB,EAAE,EAAE,WAAW,CAAC;IAChB,OAAO,EAAE,cAAc,CAAC;IACxB,kCAAkC;IAClC,wBAAwB,UAAS;IAEjC,UAAU,EAAE,QAAQ,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAE7C,cAAc,QAAO,IAAI,CAQvB;IAEF,YAAY,WAAY,SAAS,gBAAgB,KAAG,IAAI,CAuBtD;IAEF;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAYxB,WAAW,QAAO,IAAI,CASpB;IAEF,kBAAkB,IAAI,IAAI;IAI1B,iBAAiB,IAAI,IAAI;IA6CzB,OAAO,EAAE,CAAC,MAAM,OAAO,CAAC,EAAE,CAAM;IAEhC,oBAAoB,IAAI,IAAI;IAM5B,MAAM,IAAI,cAAc;IAYxB,cAAc,EAAE,OAAO,GAAG,IAAI,CAAQ;IACtC,QAAQ,QAAO,IAAI,CAGjB;IAEF,uEAAuE;IACvE,cAAc,IAAI,IAAI;CAUvB"}
|