isard 0.0.0-stage → 0.2.1
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 +176 -0
- package/LICENSE +21 -0
- package/README.md +150 -2
- package/dist/basemap.worker.d.ts +76 -0
- package/dist/basemap.worker.js +4 -0
- package/dist/basemap.worker.js.map +13 -0
- package/dist/basemaps.d.ts +48 -0
- package/dist/basemaps.js +97 -0
- package/dist/basemaps.js.map +1 -0
- package/dist/color.d.ts +8 -0
- package/dist/color.js +98 -0
- package/dist/color.js.map +1 -0
- package/dist/controls.d.ts +43 -0
- package/dist/controls.js +115 -0
- package/dist/controls.js.map +1 -0
- package/dist/decoder.worker.js +6 -0
- package/dist/decoder.worker.js.map +12 -0
- package/dist/decoders.d.ts +27 -0
- package/dist/decoders.js +109 -0
- package/dist/decoders.js.map +1 -0
- package/dist/equirectangular.d.ts +35 -0
- package/dist/equirectangular.js +143 -0
- package/dist/equirectangular.js.map +1 -0
- package/dist/extrusions.d.ts +79 -0
- package/dist/extrusions.js +224 -0
- package/dist/extrusions.js.map +1 -0
- package/dist/features.d.ts +159 -0
- package/dist/features.js +387 -0
- package/dist/features.js.map +1 -0
- package/dist/geoplateforme.d.ts +35 -0
- package/dist/geoplateforme.js +56 -0
- package/dist/geoplateforme.js.map +1 -0
- package/dist/glyphs.d.ts +104 -0
- package/dist/glyphs.js +383 -0
- package/dist/glyphs.js.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction.d.ts +53 -0
- package/dist/interaction.js +259 -0
- package/dist/interaction.js.map +1 -0
- package/dist/isard_bg.wasm +0 -0
- package/dist/isard_core_bg.wasm +0 -0
- package/dist/layers.d.ts +103 -0
- package/dist/layers.js +290 -0
- package/dist/layers.js.map +1 -0
- package/dist/loader.d.ts +30 -0
- package/dist/loader.js +102 -0
- package/dist/loader.js.map +1 -0
- package/dist/map.d.ts +211 -0
- package/dist/map.js +1222 -0
- package/dist/map.js.map +1 -0
- package/dist/mvt.d.ts +19 -0
- package/dist/mvt.js +231 -0
- package/dist/mvt.js.map +1 -0
- package/dist/overlay.d.ts +118 -0
- package/dist/overlay.js +334 -0
- package/dist/overlay.js.map +1 -0
- package/dist/protocol.d.ts +30 -0
- package/dist/protocol.js +2 -0
- package/dist/protocol.js.map +1 -0
- package/dist/style.d.ts +7 -0
- package/dist/style.js +130 -0
- package/dist/style.js.map +1 -0
- package/dist/symbols.d.ts +61 -0
- package/dist/symbols.js +238 -0
- package/dist/symbols.js.map +1 -0
- package/dist/terrain.d.ts +14 -0
- package/dist/terrain.js +56 -0
- package/dist/terrain.js.map +1 -0
- package/dist/types.d.ts +312 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/vectorstyle.d.ts +83 -0
- package/dist/vectorstyle.js +518 -0
- package/dist/vectorstyle.js.map +1 -0
- package/dist/vectortiles.d.ts +124 -0
- package/dist/vectortiles.js +523 -0
- package/dist/vectortiles.js.map +1 -0
- package/dist/wasm/isard.d.ts +612 -0
- package/dist/wasm/isard.js +2623 -0
- package/dist/wasm/isard_core.d.ts +469 -0
- package/dist/wasm/isard_core.js +2385 -0
- package/package.json +49 -4
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature layers: lines, circles and fills from GeoJSON, styled per feature. A style value is a constant, zoom stops
|
|
3
|
+
* (`[[zoom, value], …]`, linear in between, as MapLibre's `interpolate linear zoom`), or a function of the feature
|
|
4
|
+
* returning either, evaluated once per feature when the data or the style change: the engine keeps the result in
|
|
5
|
+
* textures, and restyling, recoloring by values or filtering never touches the geometry.
|
|
6
|
+
*/
|
|
7
|
+
import { Layer } from './layers.ts';
|
|
8
|
+
export type Position = [lon: number, lat: number, ...rest: number[]];
|
|
9
|
+
export type Geometry = {
|
|
10
|
+
type: 'Point';
|
|
11
|
+
coordinates: Position;
|
|
12
|
+
} | {
|
|
13
|
+
type: 'MultiPoint';
|
|
14
|
+
coordinates: Position[];
|
|
15
|
+
} | {
|
|
16
|
+
type: 'LineString';
|
|
17
|
+
coordinates: Position[];
|
|
18
|
+
} | {
|
|
19
|
+
type: 'MultiLineString';
|
|
20
|
+
coordinates: Position[][];
|
|
21
|
+
} | {
|
|
22
|
+
type: 'Polygon';
|
|
23
|
+
coordinates: Position[][];
|
|
24
|
+
} | {
|
|
25
|
+
type: 'MultiPolygon';
|
|
26
|
+
coordinates: Position[][][];
|
|
27
|
+
} | {
|
|
28
|
+
type: 'GeometryCollection';
|
|
29
|
+
geometries: Geometry[];
|
|
30
|
+
};
|
|
31
|
+
export type Properties = Record<string, unknown>;
|
|
32
|
+
export interface Feature<P = Properties> {
|
|
33
|
+
type: 'Feature';
|
|
34
|
+
geometry: Geometry | null;
|
|
35
|
+
properties: P;
|
|
36
|
+
id?: string | number;
|
|
37
|
+
}
|
|
38
|
+
export interface FeatureCollection<P = Properties> {
|
|
39
|
+
type: 'FeatureCollection';
|
|
40
|
+
features: Feature<P>[];
|
|
41
|
+
}
|
|
42
|
+
/** What a feature layer takes: a collection, its features, or one feature */
|
|
43
|
+
export type FeatureData<P = Properties> = FeatureCollection<P> | Feature<P>[] | Feature<P>;
|
|
44
|
+
/** Zoom stops: `[[zoom, value], …]` in increasing zooms, up to four, linear in between, constant outside */
|
|
45
|
+
export type Stops = [zoom: number, value: number][];
|
|
46
|
+
/** A size: CSS pixels, or zoom stops */
|
|
47
|
+
export type Size = number | Stops;
|
|
48
|
+
/** A value for all features, or a function of each feature (its properties and its index in the data) */
|
|
49
|
+
export type Styled<T, P = Properties> = T | ((properties: P, index: number) => T);
|
|
50
|
+
/** Colors of values: `[[value, color], …]` in increasing values, linear in between */
|
|
51
|
+
export type Ramp = [value: number, color: string][];
|
|
52
|
+
export interface FeatureLayerStyle<P = Properties> {
|
|
53
|
+
/** Layer opacity, 0 to 1, or zoom stops (a layer fading in past a zoom) (default 1) */
|
|
54
|
+
opacity: Size;
|
|
55
|
+
/** Zooms the layer shows in: from `minZoom` (included) to `maxZoom` (excluded) */
|
|
56
|
+
minZoom: number;
|
|
57
|
+
maxZoom: number;
|
|
58
|
+
visible: boolean;
|
|
59
|
+
/** Features drawn; the others hidden (default all) */
|
|
60
|
+
filter: ((properties: P, index: number) => boolean) | undefined;
|
|
61
|
+
/** Colors of the values given by `setValues`: a feature with a value takes its color here, the others keep theirs */
|
|
62
|
+
ramp: Ramp | undefined;
|
|
63
|
+
}
|
|
64
|
+
export interface LineStyle<P = Properties> extends FeatureLayerStyle<P> {
|
|
65
|
+
/** CSS color: `#rgb`, `#rrggbb`, `#rrggbbaa`, `rgb()`, `rgba()` (default `#000`) */
|
|
66
|
+
color: Styled<string, P>;
|
|
67
|
+
/** CSS pixels (default 1) */
|
|
68
|
+
width: Styled<Size, P>;
|
|
69
|
+
/** Dash and gap, in line widths (MapLibre's `line-dasharray`); undefined: solid */
|
|
70
|
+
dash: [dash: number, gap: number] | undefined;
|
|
71
|
+
}
|
|
72
|
+
export interface CircleStyle<P = Properties> extends FeatureLayerStyle<P> {
|
|
73
|
+
color: Styled<string, P>;
|
|
74
|
+
/** CSS pixels (default 5) */
|
|
75
|
+
radius: Styled<Size, P>;
|
|
76
|
+
strokeColor: Styled<string, P>;
|
|
77
|
+
/** CSS pixels (default 0) */
|
|
78
|
+
strokeWidth: Styled<Size, P>;
|
|
79
|
+
/** `'viewport'` (default): discs facing the screen; `'map'`: lying on the ground (MapLibre's
|
|
80
|
+
* `circle-pitch-alignment`) */
|
|
81
|
+
alignment: 'viewport' | 'map';
|
|
82
|
+
}
|
|
83
|
+
export interface FillStyle<P = Properties> extends FeatureLayerStyle<P> {
|
|
84
|
+
color: Styled<string, P>;
|
|
85
|
+
}
|
|
86
|
+
/** Where a new layer goes: under `before`, or on top of the others */
|
|
87
|
+
export interface Placement {
|
|
88
|
+
before?: Layer;
|
|
89
|
+
}
|
|
90
|
+
export interface LineOptions<P = Properties> extends Partial<LineStyle<P>>, Placement {
|
|
91
|
+
/** LineString and MultiLineString features; the rings of Polygon and MultiPolygon features are drawn as lines */
|
|
92
|
+
data: FeatureData<P>;
|
|
93
|
+
}
|
|
94
|
+
export interface CircleOptions<P = Properties> extends Partial<CircleStyle<P>>, Placement {
|
|
95
|
+
/** Point and MultiPoint features */
|
|
96
|
+
data: FeatureData<P>;
|
|
97
|
+
}
|
|
98
|
+
export interface FillOptions<P = Properties> extends Partial<FillStyle<P>>, Placement {
|
|
99
|
+
/** Polygon and MultiPolygon features */
|
|
100
|
+
data: FeatureData<P>;
|
|
101
|
+
}
|
|
102
|
+
/** A CSS color to RGBA 0-1 (see `parseCssColor`); black if unknown or missing */
|
|
103
|
+
export declare function parseColor(color: string): [r: number, g: number, b: number, a: number];
|
|
104
|
+
/** 256 RGBA texels of a ramp over its value range, and that range */
|
|
105
|
+
export declare function rampTexels(ramp: Ramp): {
|
|
106
|
+
rgba: Uint8Array;
|
|
107
|
+
min: number;
|
|
108
|
+
max: number;
|
|
109
|
+
};
|
|
110
|
+
/** Up to four stops as zooms then values, constant if a number */
|
|
111
|
+
export declare function stops(size: Size): [number, number, number, number, number, number, number, number];
|
|
112
|
+
/** Value of zoom stops at a zoom */
|
|
113
|
+
export declare function interpolate(size: Size, zoom: number): number;
|
|
114
|
+
export declare function evaluate<T, P>(value: Styled<T, P>, properties: P, index: number): T;
|
|
115
|
+
export declare function featuresOf<P>(data: FeatureData<P>): Feature<P>[];
|
|
116
|
+
export declare function polygonGeometry(features: Feature<unknown>[]): {
|
|
117
|
+
points: Float64Array<ArrayBuffer>;
|
|
118
|
+
ringStart: Uint32Array<ArrayBuffer>;
|
|
119
|
+
polygonStart: Uint32Array<ArrayBuffer>;
|
|
120
|
+
feature: Uint32Array<ArrayBuffer>;
|
|
121
|
+
};
|
|
122
|
+
/** Floats per feature in the engine's style (see `setFeatureStyle`) */
|
|
123
|
+
export declare const FLOATS = 32;
|
|
124
|
+
/** What every feature layer shares: its data, its style in the engine, values, filter */
|
|
125
|
+
export declare abstract class FeatureLayer<P, S extends FeatureLayerStyle<P>> extends Layer {
|
|
126
|
+
protected style: S;
|
|
127
|
+
protected list: Feature<P>[];
|
|
128
|
+
protected values: Float32Array | undefined;
|
|
129
|
+
/** The features, in the order of the data (their index is what `pick` returns) */
|
|
130
|
+
get features(): readonly Feature<P>[];
|
|
131
|
+
/** The feature of a picked index */
|
|
132
|
+
featureAt(index: number): Feature<P> | undefined;
|
|
133
|
+
/** Replaces the features; the style is evaluated again for them */
|
|
134
|
+
setData(data: FeatureData<P>): void;
|
|
135
|
+
setStyle(style: Partial<S>): void;
|
|
136
|
+
/** One value per feature (in data order), colored through the style's `ramp`; NaN keeps a feature's color */
|
|
137
|
+
setValues(values: Float32Array | undefined): void;
|
|
138
|
+
/** Shows only the features the predicate keeps; undefined shows them all */
|
|
139
|
+
setFilter(filter: ((properties: P, index: number) => boolean) | undefined): void;
|
|
140
|
+
setVisible(visible: boolean): void;
|
|
141
|
+
private mask;
|
|
142
|
+
/** Recreated in the engine at the same place (a new feature count) */
|
|
143
|
+
private recreate;
|
|
144
|
+
/** Two colors and two sizes of a feature */
|
|
145
|
+
protected abstract featureStyle(properties: P, index: number): [color: string, second: string, size: Size, second: Size];
|
|
146
|
+
}
|
|
147
|
+
export declare class LineLayer<P = Properties> extends FeatureLayer<P, LineStyle<P>> {
|
|
148
|
+
protected featureStyle(properties: P, index: number): [string, string, Size, Size];
|
|
149
|
+
}
|
|
150
|
+
export declare class CircleLayer<P = Properties> extends FeatureLayer<P, CircleStyle<P>> {
|
|
151
|
+
protected featureStyle(properties: P, index: number): [string, string, Size, Size];
|
|
152
|
+
}
|
|
153
|
+
export declare class FillLayer<P = Properties> extends FeatureLayer<P, FillStyle<P>> {
|
|
154
|
+
protected featureStyle(properties: P, index: number): [string, string, Size, Size];
|
|
155
|
+
protected applyExtra(): void;
|
|
156
|
+
}
|
|
157
|
+
export declare function lineStyle<P>(options: LineOptions<P>): LineStyle<P>;
|
|
158
|
+
export declare function circleStyle<P>(options: CircleOptions<P>): CircleStyle<P>;
|
|
159
|
+
export declare function fillStyle<P>(options: FillOptions<P>): FillStyle<P>;
|
package/dist/features.js
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature layers: lines, circles and fills from GeoJSON, styled per feature. A style value is a constant, zoom stops
|
|
3
|
+
* (`[[zoom, value], …]`, linear in between, as MapLibre's `interpolate linear zoom`), or a function of the feature
|
|
4
|
+
* returning either, evaluated once per feature when the data or the style change: the engine keeps the result in
|
|
5
|
+
* textures, and restyling, recoloring by values or filtering never touches the geometry.
|
|
6
|
+
*/
|
|
7
|
+
import { parseCssColor } from "./color.js";
|
|
8
|
+
import { Layer } from "./layers.js";
|
|
9
|
+
const BASE = {
|
|
10
|
+
opacity: 1,
|
|
11
|
+
minZoom: 0,
|
|
12
|
+
maxZoom: 24,
|
|
13
|
+
visible: true,
|
|
14
|
+
filter: undefined,
|
|
15
|
+
ramp: undefined,
|
|
16
|
+
};
|
|
17
|
+
// ── Colors ──
|
|
18
|
+
/** A CSS color to RGBA 0-1 (see `parseCssColor`); black if unknown or missing */
|
|
19
|
+
export function parseColor(color) {
|
|
20
|
+
return parseCssColor(color) ?? [0, 0, 0, 1];
|
|
21
|
+
}
|
|
22
|
+
/** 256 RGBA texels of a ramp over its value range, and that range */
|
|
23
|
+
export function rampTexels(ramp) {
|
|
24
|
+
const stops = ramp.map(([v, c]) => [v, parseColor(c)]).sort((a, b) => a[0] - b[0]);
|
|
25
|
+
const min = stops[0]?.[0] ?? 0;
|
|
26
|
+
const max = stops.at(-1)?.[0] ?? 1;
|
|
27
|
+
const rgba = new Uint8Array(256 * 4);
|
|
28
|
+
for (let i = 0; i < 256; i += 1) {
|
|
29
|
+
const v = min + ((max - min) * i) / 255;
|
|
30
|
+
let k = 0;
|
|
31
|
+
while (k + 1 < stops.length && (stops[k + 1]?.[0] ?? 0) < v)
|
|
32
|
+
k += 1;
|
|
33
|
+
const [v0, c0] = stops[k] ?? [min, [0, 0, 0, 1]];
|
|
34
|
+
const [v1, c1] = stops[k + 1] ?? [v0, c0];
|
|
35
|
+
const t = v1 > v0 ? Math.max(0, Math.min(1, (v - v0) / (v1 - v0))) : 0;
|
|
36
|
+
for (let j = 0; j < 4; j += 1)
|
|
37
|
+
rgba[i * 4 + j] = Math.round(((c0[j] ?? 0) + ((c1[j] ?? 0) - (c0[j] ?? 0)) * t) * 255);
|
|
38
|
+
}
|
|
39
|
+
return { rgba, min, max };
|
|
40
|
+
}
|
|
41
|
+
/** Up to four stops as zooms then values, constant if a number */
|
|
42
|
+
export function stops(size) {
|
|
43
|
+
if (!Array.isArray(size)) {
|
|
44
|
+
// A style function may return nothing for a feature without the property: 0
|
|
45
|
+
const v = Number.isFinite(size) ? size : 0;
|
|
46
|
+
return [0, 0, 0, 0, v, v, v, v];
|
|
47
|
+
}
|
|
48
|
+
// More than four: resampled at four zooms over their range
|
|
49
|
+
let s = size;
|
|
50
|
+
if (s.length > 4) {
|
|
51
|
+
const z0 = s[0]?.[0] ?? 0;
|
|
52
|
+
const z1 = s.at(-1)?.[0] ?? 0;
|
|
53
|
+
s = [0, 1, 2, 3].map((k) => {
|
|
54
|
+
const z = z0 + ((z1 - z0) * k) / 3;
|
|
55
|
+
return [z, interpolate(size, z)];
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
const at = (k) => s[Math.min(k, s.length - 1)] ?? [0, 0];
|
|
59
|
+
return [at(0)[0], at(1)[0], at(2)[0], at(3)[0], at(0)[1], at(1)[1], at(2)[1], at(3)[1]];
|
|
60
|
+
}
|
|
61
|
+
/** Value of zoom stops at a zoom */
|
|
62
|
+
export function interpolate(size, zoom) {
|
|
63
|
+
if (typeof size === 'number')
|
|
64
|
+
return size;
|
|
65
|
+
const first = size[0];
|
|
66
|
+
if (!first)
|
|
67
|
+
return 0;
|
|
68
|
+
if (zoom <= first[0])
|
|
69
|
+
return first[1];
|
|
70
|
+
for (let k = 1; k < size.length; k += 1) {
|
|
71
|
+
const [z0, v0] = size[k - 1] ?? first;
|
|
72
|
+
const [z1, v1] = size[k] ?? first;
|
|
73
|
+
if (zoom <= z1)
|
|
74
|
+
return v0 + ((v1 - v0) * (zoom - z0)) / Math.max(z1 - z0, 1e-9);
|
|
75
|
+
}
|
|
76
|
+
return size.at(-1)?.[1] ?? 0;
|
|
77
|
+
}
|
|
78
|
+
export function evaluate(value, properties, index) {
|
|
79
|
+
return typeof value === 'function' ? value(properties, index) : value;
|
|
80
|
+
}
|
|
81
|
+
// ── Geometry ──
|
|
82
|
+
const MAX_LAT = 85.051128779806589;
|
|
83
|
+
const mercX = (lon) => (lon + 180) / 360;
|
|
84
|
+
const mercY = (lat) => {
|
|
85
|
+
const phi = (Math.max(-MAX_LAT, Math.min(MAX_LAT, lat)) * Math.PI) / 180;
|
|
86
|
+
return 0.5 - Math.log(Math.tan(Math.PI / 4 + phi / 2)) / (2 * Math.PI);
|
|
87
|
+
};
|
|
88
|
+
export function featuresOf(data) {
|
|
89
|
+
if (Array.isArray(data))
|
|
90
|
+
return data;
|
|
91
|
+
return data.type === 'FeatureCollection' ? data.features : [data];
|
|
92
|
+
}
|
|
93
|
+
/** Every geometry of a feature, collections flattened */
|
|
94
|
+
function* geometries(geometry) {
|
|
95
|
+
if (!geometry)
|
|
96
|
+
return;
|
|
97
|
+
if (geometry.type === 'GeometryCollection')
|
|
98
|
+
for (const g of geometry.geometries)
|
|
99
|
+
yield* geometries(g);
|
|
100
|
+
else
|
|
101
|
+
yield geometry;
|
|
102
|
+
}
|
|
103
|
+
/** A growable typed array */
|
|
104
|
+
class Grow {
|
|
105
|
+
data;
|
|
106
|
+
length = 0;
|
|
107
|
+
constructor(data) {
|
|
108
|
+
this.data = data;
|
|
109
|
+
}
|
|
110
|
+
push(...values) {
|
|
111
|
+
if (this.length + values.length > this.data.length) {
|
|
112
|
+
const next = new this.data.constructor(Math.max(16, this.data.length * 2, this.length + values.length));
|
|
113
|
+
next.set(this.data);
|
|
114
|
+
this.data = next;
|
|
115
|
+
}
|
|
116
|
+
for (const v of values)
|
|
117
|
+
this.data[this.length++] = v;
|
|
118
|
+
}
|
|
119
|
+
done() {
|
|
120
|
+
return this.data.subarray(0, this.length);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** Lines of the features: points (Mercator), first point of each line, feature of each line */
|
|
124
|
+
function lineGeometry(features) {
|
|
125
|
+
const points = new Grow(new Float64Array(1024));
|
|
126
|
+
const start = new Grow(new Uint32Array(64));
|
|
127
|
+
const feature = new Grow(new Uint32Array(64));
|
|
128
|
+
const line = (coords, f) => {
|
|
129
|
+
start.push(points.length / 2);
|
|
130
|
+
feature.push(f);
|
|
131
|
+
for (const [lon, lat] of coords)
|
|
132
|
+
points.push(mercX(lon), mercY(lat));
|
|
133
|
+
};
|
|
134
|
+
features.forEach((f, i) => {
|
|
135
|
+
for (const g of geometries(f.geometry)) {
|
|
136
|
+
if (g.type === 'LineString')
|
|
137
|
+
line(g.coordinates, i);
|
|
138
|
+
else if (g.type === 'MultiLineString')
|
|
139
|
+
for (const l of g.coordinates)
|
|
140
|
+
line(l, i);
|
|
141
|
+
else if (g.type === 'Polygon')
|
|
142
|
+
for (const r of g.coordinates)
|
|
143
|
+
line(r, i);
|
|
144
|
+
else if (g.type === 'MultiPolygon')
|
|
145
|
+
for (const p of g.coordinates)
|
|
146
|
+
for (const r of p)
|
|
147
|
+
line(r, i);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
start.push(points.length / 2);
|
|
151
|
+
return { points: points.done(), start: start.done(), feature: feature.done() };
|
|
152
|
+
}
|
|
153
|
+
function pointGeometry(features) {
|
|
154
|
+
const points = new Grow(new Float64Array(1024));
|
|
155
|
+
const feature = new Grow(new Uint32Array(64));
|
|
156
|
+
const point = ([lon, lat], f) => {
|
|
157
|
+
points.push(mercX(lon), mercY(lat));
|
|
158
|
+
feature.push(f);
|
|
159
|
+
};
|
|
160
|
+
features.forEach((f, i) => {
|
|
161
|
+
for (const g of geometries(f.geometry)) {
|
|
162
|
+
if (g.type === 'Point')
|
|
163
|
+
point(g.coordinates, i);
|
|
164
|
+
else if (g.type === 'MultiPoint')
|
|
165
|
+
for (const p of g.coordinates)
|
|
166
|
+
point(p, i);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
return { points: points.done(), feature: feature.done() };
|
|
170
|
+
}
|
|
171
|
+
export function polygonGeometry(features) {
|
|
172
|
+
const points = new Grow(new Float64Array(1024));
|
|
173
|
+
const ringStart = new Grow(new Uint32Array(64));
|
|
174
|
+
const polygonStart = new Grow(new Uint32Array(64));
|
|
175
|
+
const feature = new Grow(new Uint32Array(64));
|
|
176
|
+
const polygon = (rings, f) => {
|
|
177
|
+
polygonStart.push(ringStart.length);
|
|
178
|
+
feature.push(f);
|
|
179
|
+
for (const ring of rings) {
|
|
180
|
+
ringStart.push(points.length / 2);
|
|
181
|
+
for (const [lon, lat] of ring)
|
|
182
|
+
points.push(mercX(lon), mercY(lat));
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
features.forEach((f, i) => {
|
|
186
|
+
for (const g of geometries(f.geometry)) {
|
|
187
|
+
if (g.type === 'Polygon')
|
|
188
|
+
polygon(g.coordinates, i);
|
|
189
|
+
else if (g.type === 'MultiPolygon')
|
|
190
|
+
for (const p of g.coordinates)
|
|
191
|
+
polygon(p, i);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
ringStart.push(points.length / 2);
|
|
195
|
+
polygonStart.push(ringStart.length - 1);
|
|
196
|
+
return {
|
|
197
|
+
points: points.done(),
|
|
198
|
+
ringStart: ringStart.done(),
|
|
199
|
+
polygonStart: polygonStart.done(),
|
|
200
|
+
feature: feature.done(),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
// ── Layers ──
|
|
204
|
+
/** Floats per feature in the engine's style (see `setFeatureStyle`) */
|
|
205
|
+
export const FLOATS = 32;
|
|
206
|
+
/** What every feature layer shares: its data, its style in the engine, values, filter */
|
|
207
|
+
export class FeatureLayer extends Layer {
|
|
208
|
+
style;
|
|
209
|
+
list;
|
|
210
|
+
values;
|
|
211
|
+
/** @internal */
|
|
212
|
+
constructor(map, data, style) {
|
|
213
|
+
super(map);
|
|
214
|
+
this.style = style;
|
|
215
|
+
this.list = featuresOf(data);
|
|
216
|
+
}
|
|
217
|
+
/** The features, in the order of the data (their index is what `pick` returns) */
|
|
218
|
+
get features() {
|
|
219
|
+
return this.list;
|
|
220
|
+
}
|
|
221
|
+
/** The feature of a picked index */
|
|
222
|
+
featureAt(index) {
|
|
223
|
+
return this.list[index];
|
|
224
|
+
}
|
|
225
|
+
/** Replaces the features; the style is evaluated again for them */
|
|
226
|
+
setData(data) {
|
|
227
|
+
const before = this.list.length;
|
|
228
|
+
this.list = featuresOf(data);
|
|
229
|
+
if (this.list.length !== before)
|
|
230
|
+
this.values = undefined;
|
|
231
|
+
// A new feature count needs new textures: the layer is created again at its place
|
|
232
|
+
if (this.list.length !== before)
|
|
233
|
+
this.recreate();
|
|
234
|
+
else {
|
|
235
|
+
this.upload(this.map.engine, this.id);
|
|
236
|
+
this.applyStyle(this.map.engine, this.id);
|
|
237
|
+
}
|
|
238
|
+
this.map.requestRender();
|
|
239
|
+
}
|
|
240
|
+
setStyle(style) {
|
|
241
|
+
this.style = { ...this.style, ...style };
|
|
242
|
+
this.applyStyle(this.map.engine, this.id);
|
|
243
|
+
this.map.requestRender();
|
|
244
|
+
}
|
|
245
|
+
/** One value per feature (in data order), colored through the style's `ramp`; NaN keeps a feature's color */
|
|
246
|
+
setValues(values) {
|
|
247
|
+
this.values = values;
|
|
248
|
+
this.map.engine.setFeatureValues(this.id, values ?? new Float32Array(this.list.length).fill(Number.NaN));
|
|
249
|
+
this.map.requestRender();
|
|
250
|
+
}
|
|
251
|
+
/** Shows only the features the predicate keeps; undefined shows them all */
|
|
252
|
+
setFilter(filter) {
|
|
253
|
+
this.style = { ...this.style, filter };
|
|
254
|
+
this.map.engine.setFeatureMask(this.id, this.mask());
|
|
255
|
+
this.map.requestRender();
|
|
256
|
+
}
|
|
257
|
+
setVisible(visible) {
|
|
258
|
+
this.setStyle({ visible });
|
|
259
|
+
}
|
|
260
|
+
mask() {
|
|
261
|
+
const { filter } = this.style;
|
|
262
|
+
const mask = new Uint8Array(this.list.length).fill(255);
|
|
263
|
+
if (filter)
|
|
264
|
+
this.list.forEach((f, i) => {
|
|
265
|
+
if (!filter(f.properties, i))
|
|
266
|
+
mask[i] = 0;
|
|
267
|
+
});
|
|
268
|
+
return mask;
|
|
269
|
+
}
|
|
270
|
+
/** Recreated in the engine at the same place (a new feature count) */
|
|
271
|
+
recreate() {
|
|
272
|
+
const engine = this.map.engine;
|
|
273
|
+
const old = this.id;
|
|
274
|
+
this.attach(engine);
|
|
275
|
+
this.map.replaceLayer(this, old);
|
|
276
|
+
}
|
|
277
|
+
/** @internal */
|
|
278
|
+
create(engine) {
|
|
279
|
+
const id = this.add(engine);
|
|
280
|
+
this.applyStyle(engine, id);
|
|
281
|
+
if (this.values)
|
|
282
|
+
engine.setFeatureValues(id, this.values);
|
|
283
|
+
return id;
|
|
284
|
+
}
|
|
285
|
+
/** @internal */
|
|
286
|
+
applyStyle(engine, id) {
|
|
287
|
+
const out = new Float32Array(this.list.length * FLOATS);
|
|
288
|
+
this.list.forEach((f, i) => {
|
|
289
|
+
const [color, second, size, size2] = this.featureStyle(f.properties, i);
|
|
290
|
+
const o = i * FLOATS;
|
|
291
|
+
out.set(parseColor(color), o);
|
|
292
|
+
out.set(parseColor(second), o + 4);
|
|
293
|
+
out.set(stops(size), o + 8);
|
|
294
|
+
out.set(stops(size2), o + 16);
|
|
295
|
+
});
|
|
296
|
+
engine.setFeatureStyle(id, out);
|
|
297
|
+
engine.setFeatureMask(id, this.mask());
|
|
298
|
+
const { ramp, opacity, minZoom, maxZoom, visible } = this.style;
|
|
299
|
+
const r = ramp && rampTexels(ramp);
|
|
300
|
+
engine.setFeatureRamp(id, r?.rgba, r?.min ?? 0, r?.max ?? 1);
|
|
301
|
+
engine.setFeatureLayer(id, Float32Array.from(stops(opacity)), minZoom, maxZoom, visible);
|
|
302
|
+
this.applyExtra(engine, id);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
export class LineLayer extends FeatureLayer {
|
|
306
|
+
/** @internal */
|
|
307
|
+
add(engine) {
|
|
308
|
+
const g = lineGeometry(this.list);
|
|
309
|
+
return engine.addLines(g.points, g.start, g.feature, this.list.length);
|
|
310
|
+
}
|
|
311
|
+
/** @internal */
|
|
312
|
+
upload(engine, id) {
|
|
313
|
+
const g = lineGeometry(this.list);
|
|
314
|
+
engine.setLines(id, g.points, g.start, g.feature);
|
|
315
|
+
}
|
|
316
|
+
featureStyle(properties, index) {
|
|
317
|
+
const { color, width } = this.style;
|
|
318
|
+
return [evaluate(color, properties, index), '#000', evaluate(width, properties, index), 0];
|
|
319
|
+
}
|
|
320
|
+
/** @internal */
|
|
321
|
+
applyExtra(engine, id) {
|
|
322
|
+
const [dash, gap] = this.style.dash ?? [0, 0];
|
|
323
|
+
engine.setLineDash(id, dash, gap);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
export class CircleLayer extends FeatureLayer {
|
|
327
|
+
/** @internal */
|
|
328
|
+
add(engine) {
|
|
329
|
+
const g = pointGeometry(this.list);
|
|
330
|
+
return engine.addCircles(g.points, g.feature, this.list.length);
|
|
331
|
+
}
|
|
332
|
+
/** @internal */
|
|
333
|
+
upload(engine, id) {
|
|
334
|
+
const g = pointGeometry(this.list);
|
|
335
|
+
engine.setCircles(id, g.points, g.feature);
|
|
336
|
+
}
|
|
337
|
+
featureStyle(properties, index) {
|
|
338
|
+
const { color, strokeColor, radius, strokeWidth } = this.style;
|
|
339
|
+
return [
|
|
340
|
+
evaluate(color, properties, index),
|
|
341
|
+
evaluate(strokeColor, properties, index),
|
|
342
|
+
evaluate(radius, properties, index),
|
|
343
|
+
evaluate(strokeWidth, properties, index),
|
|
344
|
+
];
|
|
345
|
+
}
|
|
346
|
+
/** @internal */
|
|
347
|
+
applyExtra(engine, id) {
|
|
348
|
+
engine.setCircleAlignment(id, this.style.alignment === 'map');
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
export class FillLayer extends FeatureLayer {
|
|
352
|
+
/** @internal */
|
|
353
|
+
add(engine) {
|
|
354
|
+
const g = polygonGeometry(this.list);
|
|
355
|
+
return engine.addFills(g.points, g.ringStart, g.polygonStart, g.feature, this.list.length);
|
|
356
|
+
}
|
|
357
|
+
/** @internal */
|
|
358
|
+
upload(engine, id) {
|
|
359
|
+
const g = polygonGeometry(this.list);
|
|
360
|
+
engine.setFills(id, g.points, g.ringStart, g.polygonStart, g.feature);
|
|
361
|
+
}
|
|
362
|
+
featureStyle(properties, index) {
|
|
363
|
+
return [evaluate(this.style.color, properties, index), '#000', 0, 0];
|
|
364
|
+
}
|
|
365
|
+
applyExtra() { }
|
|
366
|
+
}
|
|
367
|
+
export function lineStyle(options) {
|
|
368
|
+
const { data: _, before: __, ...rest } = options;
|
|
369
|
+
return { ...BASE, color: '#000', width: 1, dash: undefined, ...rest };
|
|
370
|
+
}
|
|
371
|
+
export function circleStyle(options) {
|
|
372
|
+
const { data: _, before: __, ...rest } = options;
|
|
373
|
+
return {
|
|
374
|
+
...BASE,
|
|
375
|
+
color: '#000',
|
|
376
|
+
radius: 5,
|
|
377
|
+
strokeColor: '#fff',
|
|
378
|
+
strokeWidth: 0,
|
|
379
|
+
alignment: 'viewport',
|
|
380
|
+
...rest,
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
export function fillStyle(options) {
|
|
384
|
+
const { data: _, before: __, ...rest } = options;
|
|
385
|
+
return { ...BASE, color: '#000', ...rest };
|
|
386
|
+
}
|
|
387
|
+
//# sourceMappingURL=features.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,Y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,IAAI;KACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAI,OAAuB;IAClD,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;IACjD,OAAO,EAAE,GAAI,IAA6B,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;AACvE,CAAC","sourcesContent":["/**\n * Feature layers: lines, circles and fills from GeoJSON, styled per feature. A style value is a constant, zoom stops\n * (`[[zoom, value], …]`, linear in between, as MapLibre's `interpolate linear zoom`), or a function of the feature\n * returning either, evaluated once per feature when the data or the style change: the engine keeps the result in\n * textures, and restyling, recoloring by values or filtering never touches the geometry.\n */\n\nimport { parseCssColor } from './color.ts';\nimport { Layer } from './layers.ts';\nimport type { LayerHost } from './types.ts';\nimport type { Engine } from './wasm/isard.js';\n\n// ── GeoJSON (the parts used here) ──\n\nexport type Position = [lon: number, lat: number, ...rest: number[]];\nexport type Geometry =\n | { type: 'Point'; coordinates: Position }\n | { type: 'MultiPoint'; coordinates: Position[] }\n | { type: 'LineString'; coordinates: Position[] }\n | { type: 'MultiLineString'; coordinates: Position[][] }\n | { type: 'Polygon'; coordinates: Position[][] }\n | { type: 'MultiPolygon'; coordinates: Position[][][] }\n | { type: 'GeometryCollection'; geometries: Geometry[] };\nexport type Properties = Record<string, unknown>;\nexport interface Feature<P = Properties> {\n type: 'Feature';\n geometry: Geometry | null;\n properties: P;\n id?: string | number;\n}\nexport interface FeatureCollection<P = Properties> {\n type: 'FeatureCollection';\n features: Feature<P>[];\n}\n/** What a feature layer takes: a collection, its features, or one feature */\nexport type FeatureData<P = Properties> = FeatureCollection<P> | Feature<P>[] | Feature<P>;\n\n// ── Style values ──\n\n/** Zoom stops: `[[zoom, value], …]` in increasing zooms, up to four, linear in between, constant outside */\nexport type Stops = [zoom: number, value: number][];\n/** A size: CSS pixels, or zoom stops */\nexport type Size = number | Stops;\n/** A value for all features, or a function of each feature (its properties and its index in the data) */\nexport type Styled<T, P = Properties> = T | ((properties: P, index: number) => T);\n/** Colors of values: `[[value, color], …]` in increasing values, linear in between */\nexport type Ramp = [value: number, color: string][];\n\nexport interface FeatureLayerStyle<P = Properties> {\n /** Layer opacity, 0 to 1, or zoom stops (a layer fading in past a zoom) (default 1) */\n opacity: Size;\n /** Zooms the layer shows in: from `minZoom` (included) to `maxZoom` (excluded) */\n minZoom: number;\n maxZoom: number;\n visible: boolean;\n /** Features drawn; the others hidden (default all) */\n filter: ((properties: P, index: number) => boolean) | undefined;\n /** Colors of the values given by `setValues`: a feature with a value takes its color here, the others keep theirs */\n ramp: Ramp | undefined;\n}\n\nexport interface LineStyle<P = Properties> extends FeatureLayerStyle<P> {\n /** CSS color: `#rgb`, `#rrggbb`, `#rrggbbaa`, `rgb()`, `rgba()` (default `#000`) */\n color: Styled<string, P>;\n /** CSS pixels (default 1) */\n width: Styled<Size, P>;\n /** Dash and gap, in line widths (MapLibre's `line-dasharray`); undefined: solid */\n dash: [dash: number, gap: number] | undefined;\n}\n\nexport interface CircleStyle<P = Properties> extends FeatureLayerStyle<P> {\n color: Styled<string, P>;\n /** CSS pixels (default 5) */\n radius: Styled<Size, P>;\n strokeColor: Styled<string, P>;\n /** CSS pixels (default 0) */\n strokeWidth: Styled<Size, P>;\n /** `'viewport'` (default): discs facing the screen; `'map'`: lying on the ground (MapLibre's\n * `circle-pitch-alignment`) */\n alignment: 'viewport' | 'map';\n}\n\nexport interface FillStyle<P = Properties> extends FeatureLayerStyle<P> {\n color: Styled<string, P>;\n}\n\n/** Where a new layer goes: under `before`, or on top of the others */\nexport interface Placement {\n before?: Layer;\n}\n\nexport interface LineOptions<P = Properties> extends Partial<LineStyle<P>>, Placement {\n /** LineString and MultiLineString features; the rings of Polygon and MultiPolygon features are drawn as lines */\n data: FeatureData<P>;\n}\nexport interface CircleOptions<P = Properties> extends Partial<CircleStyle<P>>, Placement {\n /** Point and MultiPoint features */\n data: FeatureData<P>;\n}\nexport interface FillOptions<P = Properties> extends Partial<FillStyle<P>>, Placement {\n /** Polygon and MultiPolygon features */\n data: FeatureData<P>;\n}\n\nconst BASE: FeatureLayerStyle = {\n opacity: 1,\n minZoom: 0,\n maxZoom: 24,\n visible: true,\n filter: undefined,\n ramp: undefined,\n};\n\n// ── Colors ──\n\n/** A CSS color to RGBA 0-1 (see `parseCssColor`); black if unknown or missing */\nexport function parseColor(color: string): [r: number, g: number, b: number, a: number] {\n return parseCssColor(color) ?? [0, 0, 0, 1];\n}\n\n/** 256 RGBA texels of a ramp over its value range, and that range */\nexport function rampTexels(ramp: Ramp): { rgba: Uint8Array; min: number; max: number } {\n const stops = ramp.map(([v, c]) => [v, parseColor(c)] as const).sort((a, b) => a[0] - b[0]);\n const min = stops[0]?.[0] ?? 0;\n const max = stops.at(-1)?.[0] ?? 1;\n const rgba = new Uint8Array(256 * 4);\n for (let i = 0; i < 256; i += 1) {\n const v = min + ((max - min) * i) / 255;\n let k = 0;\n while (k + 1 < stops.length && (stops[k + 1]?.[0] ?? 0) < v) k += 1;\n const [v0, c0] = stops[k] ?? [min, [0, 0, 0, 1]];\n const [v1, c1] = stops[k + 1] ?? [v0, c0];\n const t = v1 > v0 ? Math.max(0, Math.min(1, (v - v0) / (v1 - v0))) : 0;\n for (let j = 0; j < 4; j += 1)\n rgba[i * 4 + j] = Math.round(((c0[j] ?? 0) + ((c1[j] ?? 0) - (c0[j] ?? 0)) * t) * 255);\n }\n return { rgba, min, max };\n}\n\n/** Up to four stops as zooms then values, constant if a number */\nexport function stops(size: Size): [number, number, number, number, number, number, number, number] {\n if (!Array.isArray(size)) {\n // A style function may return nothing for a feature without the property: 0\n const v = Number.isFinite(size) ? size : 0;\n return [0, 0, 0, 0, v, v, v, v];\n }\n // More than four: resampled at four zooms over their range\n let s = size;\n if (s.length > 4) {\n const z0 = s[0]?.[0] ?? 0;\n const z1 = s.at(-1)?.[0] ?? 0;\n s = [0, 1, 2, 3].map((k): [number, number] => {\n const z = z0 + ((z1 - z0) * k) / 3;\n return [z, interpolate(size, z)];\n });\n }\n const at = (k: number) => s[Math.min(k, s.length - 1)] ?? [0, 0];\n return [at(0)[0], at(1)[0], at(2)[0], at(3)[0], at(0)[1], at(1)[1], at(2)[1], at(3)[1]];\n}\n\n/** Value of zoom stops at a zoom */\nexport function interpolate(size: Size, zoom: number): number {\n if (typeof size === 'number') return size;\n const first = size[0];\n if (!first) return 0;\n if (zoom <= first[0]) return first[1];\n for (let k = 1; k < size.length; k += 1) {\n const [z0, v0] = size[k - 1] ?? first;\n const [z1, v1] = size[k] ?? first;\n if (zoom <= z1) return v0 + ((v1 - v0) * (zoom - z0)) / Math.max(z1 - z0, 1e-9);\n }\n return size.at(-1)?.[1] ?? 0;\n}\n\nexport function evaluate<T, P>(value: Styled<T, P>, properties: P, index: number): T {\n return typeof value === 'function' ? (value as (p: P, i: number) => T)(properties, index) : value;\n}\n\n// ── Geometry ──\n\nconst MAX_LAT = 85.051128779806589;\nconst mercX = (lon: number) => (lon + 180) / 360;\nconst mercY = (lat: number) => {\n const phi = (Math.max(-MAX_LAT, Math.min(MAX_LAT, lat)) * Math.PI) / 180;\n return 0.5 - Math.log(Math.tan(Math.PI / 4 + phi / 2)) / (2 * Math.PI);\n};\n\nexport function featuresOf<P>(data: FeatureData<P>): Feature<P>[] {\n if (Array.isArray(data)) return data;\n return data.type === 'FeatureCollection' ? data.features : [data];\n}\n\n/** Every geometry of a feature, collections flattened */\nfunction* geometries(geometry: Geometry | null): Generator<Geometry> {\n if (!geometry) return;\n if (geometry.type === 'GeometryCollection') for (const g of geometry.geometries) yield* geometries(g);\n else yield geometry;\n}\n\n/** A growable typed array */\nclass Grow<T extends Float64Array | Uint32Array> {\n length = 0;\n constructor(public data: T) {}\n push(...values: number[]): void {\n if (this.length + values.length > this.data.length) {\n const next = new (this.data.constructor as new (n: number) => T)(\n Math.max(16, this.data.length * 2, this.length + values.length),\n );\n next.set(this.data);\n this.data = next;\n }\n for (const v of values) this.data[this.length++] = v;\n }\n done(): T {\n return this.data.subarray(0, this.length) as T;\n }\n}\n\n/** Lines of the features: points (Mercator), first point of each line, feature of each line */\nfunction lineGeometry(features: Feature<unknown>[]) {\n const points = new Grow(new Float64Array(1024));\n const start = new Grow(new Uint32Array(64));\n const feature = new Grow(new Uint32Array(64));\n const line = (coords: Position[], f: number) => {\n start.push(points.length / 2);\n feature.push(f);\n for (const [lon, lat] of coords) points.push(mercX(lon), mercY(lat));\n };\n features.forEach((f, i) => {\n for (const g of geometries(f.geometry)) {\n if (g.type === 'LineString') line(g.coordinates, i);\n else if (g.type === 'MultiLineString') for (const l of g.coordinates) line(l, i);\n else if (g.type === 'Polygon') for (const r of g.coordinates) line(r, i);\n else if (g.type === 'MultiPolygon') for (const p of g.coordinates) for (const r of p) line(r, i);\n }\n });\n start.push(points.length / 2);\n return { points: points.done(), start: start.done(), feature: feature.done() };\n}\n\nfunction pointGeometry(features: Feature<unknown>[]) {\n const points = new Grow(new Float64Array(1024));\n const feature = new Grow(new Uint32Array(64));\n const point = ([lon, lat]: Position, f: number) => {\n points.push(mercX(lon), mercY(lat));\n feature.push(f);\n };\n features.forEach((f, i) => {\n for (const g of geometries(f.geometry)) {\n if (g.type === 'Point') point(g.coordinates, i);\n else if (g.type === 'MultiPoint') for (const p of g.coordinates) point(p, i);\n }\n });\n return { points: points.done(), feature: feature.done() };\n}\n\nexport function polygonGeometry(features: Feature<unknown>[]) {\n const points = new Grow(new Float64Array(1024));\n const ringStart = new Grow(new Uint32Array(64));\n const polygonStart = new Grow(new Uint32Array(64));\n const feature = new Grow(new Uint32Array(64));\n const polygon = (rings: Position[][], f: number) => {\n polygonStart.push(ringStart.length);\n feature.push(f);\n for (const ring of rings) {\n ringStart.push(points.length / 2);\n for (const [lon, lat] of ring) points.push(mercX(lon), mercY(lat));\n }\n };\n features.forEach((f, i) => {\n for (const g of geometries(f.geometry)) {\n if (g.type === 'Polygon') polygon(g.coordinates, i);\n else if (g.type === 'MultiPolygon') for (const p of g.coordinates) polygon(p, i);\n }\n });\n ringStart.push(points.length / 2);\n polygonStart.push(ringStart.length - 1);\n return {\n points: points.done(),\n ringStart: ringStart.done(),\n polygonStart: polygonStart.done(),\n feature: feature.done(),\n };\n}\n\n// ── Layers ──\n\n/** Floats per feature in the engine's style (see `setFeatureStyle`) */\nexport const FLOATS = 32;\n\n/** What every feature layer shares: its data, its style in the engine, values, filter */\nexport abstract class FeatureLayer<P, S extends FeatureLayerStyle<P>> extends Layer {\n protected list: Feature<P>[];\n protected values: Float32Array | undefined;\n\n /** @internal */\n constructor(\n map: LayerHost,\n data: FeatureData<P>,\n protected style: S,\n ) {\n super(map);\n this.list = featuresOf(data);\n }\n\n /** The features, in the order of the data (their index is what `pick` returns) */\n get features(): readonly Feature<P>[] {\n return this.list;\n }\n\n /** The feature of a picked index */\n featureAt(index: number): Feature<P> | undefined {\n return this.list[index];\n }\n\n /** Replaces the features; the style is evaluated again for them */\n setData(data: FeatureData<P>): void {\n const before = this.list.length;\n this.list = featuresOf(data);\n if (this.list.length !== before) this.values = undefined;\n // A new feature count needs new textures: the layer is created again at its place\n if (this.list.length !== before) this.recreate();\n else {\n this.upload(this.map.engine, this.id);\n this.applyStyle(this.map.engine, this.id);\n }\n this.map.requestRender();\n }\n\n setStyle(style: Partial<S>): void {\n this.style = { ...this.style, ...style };\n this.applyStyle(this.map.engine, this.id);\n this.map.requestRender();\n }\n\n /** One value per feature (in data order), colored through the style's `ramp`; NaN keeps a feature's color */\n setValues(values: Float32Array | undefined): void {\n this.values = values;\n this.map.engine.setFeatureValues(this.id, values ?? new Float32Array(this.list.length).fill(Number.NaN));\n this.map.requestRender();\n }\n\n /** Shows only the features the predicate keeps; undefined shows them all */\n setFilter(filter: ((properties: P, index: number) => boolean) | undefined): void {\n this.style = { ...this.style, filter };\n this.map.engine.setFeatureMask(this.id, this.mask());\n this.map.requestRender();\n }\n\n setVisible(visible: boolean): void {\n this.setStyle({ visible } as Partial<S>);\n }\n\n private mask(): Uint8Array {\n const { filter } = this.style;\n const mask = new Uint8Array(this.list.length).fill(255);\n if (filter)\n this.list.forEach((f, i) => {\n if (!filter(f.properties, i)) mask[i] = 0;\n });\n return mask;\n }\n\n /** Recreated in the engine at the same place (a new feature count) */\n private recreate(): void {\n const engine = this.map.engine;\n const old = this.id;\n this.attach(engine);\n this.map.replaceLayer(this, old);\n }\n\n /** @internal */\n protected create(engine: Engine): number {\n const id = this.add(engine);\n this.applyStyle(engine, id);\n if (this.values) engine.setFeatureValues(id, this.values);\n return id;\n }\n\n /** @internal Adds the geometry to the engine, returns the layer id */\n protected abstract add(engine: Engine): number;\n /** @internal Sends the geometry again (same feature count) */\n protected abstract upload(engine: Engine, id: number): void;\n /** Two colors and two sizes of a feature */\n protected abstract featureStyle(\n properties: P,\n index: number,\n ): [color: string, second: string, size: Size, second: Size];\n /** @internal Layer-specific settings (dashes, alignment) */\n protected abstract applyExtra(engine: Engine, id: number): void;\n\n /** @internal */\n protected applyStyle(engine: Engine, id: number): void {\n const out = new Float32Array(this.list.length * FLOATS);\n this.list.forEach((f, i) => {\n const [color, second, size, size2] = this.featureStyle(f.properties, i);\n const o = i * FLOATS;\n out.set(parseColor(color), o);\n out.set(parseColor(second), o + 4);\n out.set(stops(size), o + 8);\n out.set(stops(size2), o + 16);\n });\n engine.setFeatureStyle(id, out);\n engine.setFeatureMask(id, this.mask());\n const { ramp, opacity, minZoom, maxZoom, visible } = this.style;\n const r = ramp && rampTexels(ramp);\n engine.setFeatureRamp(id, r?.rgba, r?.min ?? 0, r?.max ?? 1);\n engine.setFeatureLayer(id, Float32Array.from(stops(opacity)), minZoom, maxZoom, visible);\n this.applyExtra(engine, id);\n }\n}\n\nexport class LineLayer<P = Properties> extends FeatureLayer<P, LineStyle<P>> {\n /** @internal */\n protected add(engine: Engine): number {\n const g = lineGeometry(this.list);\n return engine.addLines(g.points, g.start, g.feature, this.list.length);\n }\n\n /** @internal */\n protected upload(engine: Engine, id: number): void {\n const g = lineGeometry(this.list);\n engine.setLines(id, g.points, g.start, g.feature);\n }\n\n protected featureStyle(properties: P, index: number): [string, string, Size, Size] {\n const { color, width } = this.style;\n return [evaluate(color, properties, index), '#000', evaluate(width, properties, index), 0];\n }\n\n /** @internal */\n protected applyExtra(engine: Engine, id: number): void {\n const [dash, gap] = this.style.dash ?? [0, 0];\n engine.setLineDash(id, dash, gap);\n }\n}\n\nexport class CircleLayer<P = Properties> extends FeatureLayer<P, CircleStyle<P>> {\n /** @internal */\n protected add(engine: Engine): number {\n const g = pointGeometry(this.list);\n return engine.addCircles(g.points, g.feature, this.list.length);\n }\n\n /** @internal */\n protected upload(engine: Engine, id: number): void {\n const g = pointGeometry(this.list);\n engine.setCircles(id, g.points, g.feature);\n }\n\n protected featureStyle(properties: P, index: number): [string, string, Size, Size] {\n const { color, strokeColor, radius, strokeWidth } = this.style;\n return [\n evaluate(color, properties, index),\n evaluate(strokeColor, properties, index),\n evaluate(radius, properties, index),\n evaluate(strokeWidth, properties, index),\n ];\n }\n\n /** @internal */\n protected applyExtra(engine: Engine, id: number): void {\n engine.setCircleAlignment(id, this.style.alignment === 'map');\n }\n}\n\nexport class FillLayer<P = Properties> extends FeatureLayer<P, FillStyle<P>> {\n /** @internal */\n protected add(engine: Engine): number {\n const g = polygonGeometry(this.list);\n return engine.addFills(g.points, g.ringStart, g.polygonStart, g.feature, this.list.length);\n }\n\n /** @internal */\n protected upload(engine: Engine, id: number): void {\n const g = polygonGeometry(this.list);\n engine.setFills(id, g.points, g.ringStart, g.polygonStart, g.feature);\n }\n\n protected featureStyle(properties: P, index: number): [string, string, Size, Size] {\n return [evaluate(this.style.color, properties, index), '#000', 0, 0];\n }\n\n protected applyExtra(): void {}\n}\n\nexport function lineStyle<P>(options: LineOptions<P>): LineStyle<P> {\n const { data: _, before: __, ...rest } = options;\n return { ...(BASE as FeatureLayerStyle<P>), color: '#000', width: 1, dash: undefined, ...rest };\n}\n\nexport function circleStyle<P>(options: CircleOptions<P>): CircleStyle<P> {\n const { data: _, before: __, ...rest } = options;\n return {\n ...(BASE as FeatureLayerStyle<P>),\n color: '#000',\n radius: 5,\n strokeColor: '#fff',\n strokeWidth: 0,\n alignment: 'viewport',\n ...rest,\n };\n}\n\nexport function fillStyle<P>(options: FillOptions<P>): FillStyle<P> {\n const { data: _, before: __, ...rest } = options;\n return { ...(BASE as FeatureLayerStyle<P>), color: '#000', ...rest };\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Géoplateforme's data (IGN, France; open, no key): its WMTS and WMS rasters as raster layers, its WFS features as
|
|
3
|
+
* GeoJSON. Its basemaps, hillshade, terrain model and vector styles are named options of the map (`'ign-plan'`,
|
|
4
|
+
* `hillshade`, `terrain: 'ign'`, `PLAN_STYLES`); the rasters credit the IGN by themselves.
|
|
5
|
+
*/
|
|
6
|
+
import type { FeatureCollection, Properties } from './features.ts';
|
|
7
|
+
import type { RasterOptions } from './types.ts';
|
|
8
|
+
/** Credits of the Géoplateforme's data: its basemaps, hillshade, terrain model, rasters and features */
|
|
9
|
+
export declare const IGN_ATTRIBUTION = "<a href=\"https://www.ign.fr/\">\u00A9 IGN</a> \u2013 <a href=\"https://geoservices.ign.fr/\">G\u00E9oplateforme</a>";
|
|
10
|
+
/**
|
|
11
|
+
* A layer of the Géoplateforme's WMTS (its Web Mercator grid, PM) as raster options for `addRaster`, crediting the
|
|
12
|
+
* IGN: `geoplateformeWmts('ORTHOIMAGERY.ORTHOPHOTOS', { format: 'image/jpeg' })`. The layer names are those of its
|
|
13
|
+
* capabilities (https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetCapabilities)
|
|
14
|
+
*/
|
|
15
|
+
export declare function geoplateformeWmts(layer: string, options?: {
|
|
16
|
+
format?: string;
|
|
17
|
+
style?: string;
|
|
18
|
+
} & Omit<RasterOptions, 'url'>): RasterOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Layers of the Géoplateforme's WMS (raster, `wms-r`) as raster options for `addRaster`, crediting the IGN: 256 px
|
|
21
|
+
* images of each tile asked for in EPSG:3857, transparent where empty. `geoplateformeWms('CADASTRALPARCELS.PARCELLAIRE_EXPRESS')`
|
|
22
|
+
*/
|
|
23
|
+
export declare function geoplateformeWms(layers: string, options?: {
|
|
24
|
+
format?: string;
|
|
25
|
+
styles?: string;
|
|
26
|
+
} & Omit<RasterOptions, 'url'>): RasterOptions;
|
|
27
|
+
/**
|
|
28
|
+
* Features of the Géoplateforme's WFS in a box (west, south, east, north, degrees), as GeoJSON in longitudes and
|
|
29
|
+
* latitudes: `await geoplateformeWfs('BDTOPO_V3:batiment', [2.41, 48.84, 2.43, 48.85])`. At most `count` features
|
|
30
|
+
* (default 5000). The type names are those of its capabilities (BD TOPO, ADMIN EXPRESS…)
|
|
31
|
+
*/
|
|
32
|
+
export declare function geoplateformeWfs<P = Properties>(typeName: string, [west, south, east, north]: [number, number, number, number], options?: {
|
|
33
|
+
count?: number;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
}): Promise<FeatureCollection<P>>;
|