@deck.gl-community/layers 9.0.0-alpha.1 → 9.0.2

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.
Files changed (39) hide show
  1. package/dist/index.cjs +605 -0
  2. package/dist/index.cjs.map +7 -0
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.js +6 -5
  5. package/dist/path-marker-layer/arrow-2d-geometry.d.ts +4 -0
  6. package/dist/path-marker-layer/arrow-2d-geometry.js +58 -0
  7. package/dist/path-marker-layer/create-path-markers.d.ts +18 -0
  8. package/dist/path-marker-layer/create-path-markers.js +78 -0
  9. package/dist/path-marker-layer/path-marker-layer.d.ts +40 -0
  10. package/dist/path-marker-layer/path-marker-layer.js +124 -0
  11. package/dist/path-marker-layer/polyline.d.ts +18 -0
  12. package/dist/path-marker-layer/polyline.js +40 -0
  13. package/dist/path-outline-layer/outline.d.ts +8 -0
  14. package/dist/path-outline-layer/outline.js +100 -0
  15. package/dist/path-outline-layer/path-outline-layer.d.ts +34 -0
  16. package/dist/path-outline-layer/path-outline-layer.js +116 -0
  17. package/dist/tile-source-layer/tile-source-layer.d.ts +43 -0
  18. package/dist/tile-source-layer/tile-source-layer.js +109 -0
  19. package/package.json +27 -13
  20. package/src/index.ts +7 -4
  21. package/src/path-marker-layer/arrow-2d-geometry.ts +65 -0
  22. package/src/path-marker-layer/create-path-markers.ts +122 -0
  23. package/src/path-marker-layer/path-marker-layer.ts +183 -0
  24. package/src/path-marker-layer/polyline.ts +44 -0
  25. package/src/path-outline-layer/outline.ts +107 -0
  26. package/src/path-outline-layer/path-outline-layer.ts +159 -0
  27. package/src/{tile-source-layer.ts → tile-source-layer/tile-source-layer.ts} +30 -22
  28. package/dist/data-driven-tile-3d-layer/data-driven-tile-3d-layer.js +0 -193
  29. package/dist/data-driven-tile-3d-layer/data-driven-tile-3d-layer.js.map +0 -1
  30. package/dist/data-driven-tile-3d-layer/utils/colorize-tile.js +0 -31
  31. package/dist/data-driven-tile-3d-layer/utils/colorize-tile.js.map +0 -1
  32. package/dist/data-driven-tile-3d-layer/utils/filter-tile.js +0 -146
  33. package/dist/data-driven-tile-3d-layer/utils/filter-tile.js.map +0 -1
  34. package/dist/index.js.map +0 -1
  35. package/dist/tile-source-layer.js +0 -112
  36. package/dist/tile-source-layer.js.map +0 -1
  37. package/src/data-driven-tile-3d-layer/data-driven-tile-3d-layer.ts +0 -261
  38. package/src/data-driven-tile-3d-layer/utils/colorize-tile.ts +0 -53
  39. package/src/data-driven-tile-3d-layer/utils/filter-tile.ts +0 -179
package/dist/index.cjs ADDED
@@ -0,0 +1,605 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __publicField = (obj, key, value) => {
20
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ return value;
22
+ };
23
+
24
+ // dist/index.js
25
+ var dist_exports = {};
26
+ __export(dist_exports, {
27
+ PathMarkerLayer: () => PathMarkerLayer,
28
+ PathOutlineLayer: () => PathOutlineLayer,
29
+ TileSourceLayer: () => TileSourceLayer
30
+ });
31
+ module.exports = __toCommonJS(dist_exports);
32
+
33
+ // dist/tile-source-layer/tile-source-layer.js
34
+ var import_core = require("@deck.gl/core");
35
+ var import_geo_layers = require("@deck.gl/geo-layers");
36
+ var import_layers = require("@deck.gl/layers");
37
+ var devicePixelRatio = typeof window !== "undefined" && window.devicePixelRatio || 1;
38
+ var TileSourceLayer = class extends import_core.CompositeLayer {
39
+ state = void 0;
40
+ initializeState() {
41
+ this.setState({
42
+ tileSource: null
43
+ });
44
+ }
45
+ updateState({ props, changeFlags }) {
46
+ this.setState({
47
+ tileSource: props.tileSource
48
+ });
49
+ }
50
+ renderLayers() {
51
+ const { tileSource, showTileBorders, metadata, onTilesLoad } = this.props;
52
+ const minZoom = (metadata == null ? void 0 : metadata.minZoom) || 0;
53
+ const maxZoom = (metadata == null ? void 0 : metadata.maxZoom) || 30;
54
+ return [
55
+ new import_geo_layers.TileLayer({
56
+ // HACK: Trigger new layer via id prop to force clear tile cache
57
+ id: String(tileSource.url),
58
+ getTileData: tileSource.getTileData,
59
+ // Assume the pmtiles file support HTTP/2, so we aren't limited by the browser to a certain number per domain.
60
+ maxRequests: 20,
61
+ pickable: true,
62
+ onViewportLoad: onTilesLoad,
63
+ autoHighlight: showTileBorders,
64
+ highlightColor: [60, 60, 60, 40],
65
+ minZoom,
66
+ maxZoom,
67
+ tileSize: 256,
68
+ // TOOD - why is this needed?
69
+ zoomOffset: devicePixelRatio === 1 ? -1 : 0,
70
+ renderSubLayers,
71
+ // Custom prop
72
+ tileSource,
73
+ showTileBorders
74
+ })
75
+ ];
76
+ }
77
+ };
78
+ __publicField(TileSourceLayer, "layerName", "TileSourceLayer");
79
+ __publicField(TileSourceLayer, "defaultProps", {
80
+ ...import_geo_layers.TileLayer.defaultProps,
81
+ showTileBorders: true
82
+ });
83
+ function renderSubLayers(props) {
84
+ const { tileSource, showTileBorders, minZoom, maxZoom, tile: { index: { z: zoom }, bbox: { west, south, east, north } } } = props;
85
+ const layers = [];
86
+ const borderColor = zoom <= minZoom || zoom >= maxZoom ? [255, 0, 0, 255] : [0, 0, 255, 255];
87
+ switch (tileSource.mimeType) {
88
+ case "application/vnd.mapbox-vector-tile":
89
+ layers.push(new import_layers.GeoJsonLayer({
90
+ id: `${props.id}-geojson`,
91
+ data: props.data,
92
+ pickable: true,
93
+ getFillColor: [0, 190, 80, 255],
94
+ lineWidthScale: 500,
95
+ lineWidthMinPixels: 0.5
96
+ }));
97
+ break;
98
+ case "image/png":
99
+ case "image/jpeg":
100
+ case "image/webp":
101
+ case "image/avif":
102
+ layers.push(new import_layers.BitmapLayer(props, {
103
+ data: null,
104
+ image: props.data,
105
+ bounds: [west, south, east, north],
106
+ pickable: true
107
+ }));
108
+ break;
109
+ default:
110
+ console.error("Unknown tile mimeType", tileSource == null ? void 0 : tileSource.mimeType);
111
+ }
112
+ if (showTileBorders) {
113
+ layers.push(new import_layers.PathLayer({
114
+ id: `${props.id}-border`,
115
+ data: [
116
+ [
117
+ [west, north],
118
+ [west, south],
119
+ [east, south],
120
+ [east, north],
121
+ [west, north]
122
+ ]
123
+ ],
124
+ getPath: (d) => d,
125
+ getColor: borderColor,
126
+ widthMinPixels: 4
127
+ }));
128
+ }
129
+ return layers;
130
+ }
131
+
132
+ // dist/path-outline-layer/path-outline-layer.js
133
+ var import_layers2 = require("@deck.gl/layers");
134
+ var import_constants = require("@luma.gl/constants");
135
+
136
+ // dist/path-outline-layer/outline.js
137
+ var INITIAL_STATE = {
138
+ outlineEnabled: false,
139
+ outlineRenderShadowmap: false,
140
+ outlineShadowmap: null
141
+ };
142
+ function getUniforms({ outlineEnabled, outlineRenderShadowmap, outlineShadowmap } = INITIAL_STATE) {
143
+ const uniforms = {};
144
+ if (outlineEnabled !== void 0) {
145
+ uniforms.outline_uEnabled = outlineEnabled;
146
+ }
147
+ if (outlineRenderShadowmap !== void 0) {
148
+ uniforms.outline_uRenderOutlines = outlineRenderShadowmap;
149
+ }
150
+ if (outlineShadowmap !== void 0) {
151
+ uniforms.outline_uShadowmap = outlineShadowmap;
152
+ }
153
+ return uniforms;
154
+ }
155
+ var vs = `#version 300 es
156
+ in float instanceZLevel;
157
+ out float outline_vzLevel;
158
+ out vec4 outline_vPosition;
159
+
160
+ // Set the z level for the outline shadowmap rendering
161
+ void outline_setZLevel(float zLevel) {
162
+ outline_vzLevel = zLevel;
163
+ }
164
+
165
+ // Store an adjusted position for texture2DProj
166
+ void outline_setUV(vec4 position) {
167
+ // mat4(
168
+ // 0.5, 0.0, 0.0, 0.0,
169
+ // 0.0, 0.5, 0.0, 0.0,
170
+ // 0.0, 0.0, 0.5, 0.0,
171
+ // 0.5, 0.5, 0.5, 1.0
172
+ // ) * position;
173
+ outline_vPosition = vec4(position.xyz * 0.5 + position.w * 0.5, position.w);
174
+ }
175
+ `;
176
+ var fs = `uniform bool outline_uEnabled;
177
+ uniform bool outline_uRenderOutlines;
178
+ uniform sampler2D outline_uShadowmap;
179
+
180
+ in float outline_vzLevel;
181
+ // in vec2 outline_vUV;
182
+ in vec4 outline_vPosition;
183
+
184
+ out vec4 fragColor;
185
+
186
+ const float OUTLINE_Z_LEVEL_ERROR = 0.01;
187
+
188
+ // Return a darker color in shadowmap
189
+ vec4 outline_filterShadowColor(vec4 color) {
190
+ return vec4(outline_vzLevel / 255., outline_vzLevel / 255., outline_vzLevel / 255., 1.);
191
+ }
192
+
193
+ // Return a darker color if in shadowmap
194
+ vec4 outline_filterDarkenColor(vec4 color) {
195
+ if (outline_uEnabled) {
196
+ float maxZLevel;
197
+ if (outline_vPosition.q > 0.0) {
198
+ maxZLevel = texture2DProj(outline_uShadowmap, outline_vPosition).r * 255.;
199
+ } else {
200
+ discard;
201
+ }
202
+ if (maxZLevel < outline_vzLevel + OUTLINE_Z_LEVEL_ERROR) {
203
+ vec4(color.rgb * 0.5, color.a);
204
+ } else {
205
+ discard;
206
+ }
207
+ }
208
+ return color;
209
+ }
210
+
211
+ // if enabled and rendering outlines - Render depth to shadowmap
212
+ // if enabled and rendering colors - Return a darker color if in shadowmap
213
+ // if disabled, just return color
214
+ vec4 outline_filterColor(vec4 color) {
215
+ if (outline_uEnabled) {
216
+ return outline_uRenderOutlines ?
217
+ outline_filterShadowColor(color) :
218
+ outline_filterDarkenColor(color);
219
+ }
220
+ return color;
221
+ }
222
+ `;
223
+ var outline = {
224
+ name: "outline",
225
+ vs,
226
+ fs,
227
+ getUniforms
228
+ };
229
+
230
+ // dist/path-outline-layer/path-outline-layer.js
231
+ var UNIT = {
232
+ common: 0,
233
+ meters: 1,
234
+ pixels: 2
235
+ };
236
+ function injectShaderCode({ source, code = "" }) {
237
+ const INJECT_CODE = /}[^{}]*$/;
238
+ return source.replace(INJECT_CODE, code.concat("\n}\n"));
239
+ }
240
+ var VS_CODE = ` outline_setUV(gl_Position);
241
+ outline_setZLevel(instanceZLevel);
242
+ `;
243
+ var FS_CODE = ` fragColor = outline_filterColor(fragColor);
244
+ `;
245
+ var defaultProps = {
246
+ getZLevel: () => 0
247
+ };
248
+ var PathOutlineLayer = class extends import_layers2.PathLayer {
249
+ state = void 0;
250
+ // Override getShaders to inject the outline module
251
+ getShaders() {
252
+ const shaders = super.getShaders();
253
+ return Object.assign({}, shaders, {
254
+ modules: shaders.modules.concat([outline]),
255
+ vs: injectShaderCode({ source: shaders.vs, code: VS_CODE }),
256
+ fs: injectShaderCode({ source: shaders.fs, code: FS_CODE })
257
+ });
258
+ }
259
+ // @ts-expect-error PathLayer is missing LayerContext arg
260
+ initializeState(context) {
261
+ super.initializeState();
262
+ this.setState({
263
+ outlineFramebuffer: context.device.createFramebuffer({}),
264
+ dummyTexture: context.device.createTexture({})
265
+ });
266
+ this.state.attributeManager.addInstanced({
267
+ instanceZLevel: {
268
+ size: 1,
269
+ type: import_constants.GL.UNSIGNED_BYTE,
270
+ accessor: "getZLevel"
271
+ }
272
+ });
273
+ }
274
+ // Override draw to add render module
275
+ draw({ moduleParameters = {}, parameters, uniforms, context }) {
276
+ const { jointRounded, capRounded, billboard, miterLimit, widthUnits, widthScale, widthMinPixels, widthMaxPixels } = this.props;
277
+ uniforms = Object.assign({}, uniforms, {
278
+ jointType: Number(jointRounded),
279
+ capType: Number(capRounded),
280
+ billboard,
281
+ widthUnits: UNIT[widthUnits],
282
+ widthScale,
283
+ miterLimit,
284
+ widthMinPixels,
285
+ widthMaxPixels
286
+ });
287
+ const { outlineFramebuffer, dummyTexture } = this.state;
288
+ this.state.model.updateModuleSettings({
289
+ outlineEnabled: true,
290
+ outlineRenderShadowmap: true,
291
+ outlineShadowmap: dummyTexture
292
+ });
293
+ this.state.model.draw({
294
+ uniforms: Object.assign({}, uniforms, {
295
+ jointType: 0,
296
+ widthScale: this.props.widthScale * 1.3
297
+ }),
298
+ parameters: {
299
+ depthTest: false,
300
+ // Biggest value needs to go into buffer
301
+ blendEquation: import_constants.GL.MAX
302
+ },
303
+ framebuffer: outlineFramebuffer
304
+ });
305
+ this.state.model.updateModuleSettings({
306
+ outlineEnabled: true,
307
+ outlineRenderShadowmap: false,
308
+ outlineShadowmap: outlineFramebuffer
309
+ });
310
+ this.state.model.draw({
311
+ uniforms: Object.assign({}, uniforms, {
312
+ jointType: Number(jointRounded),
313
+ capType: Number(capRounded),
314
+ widthScale: this.props.widthScale
315
+ }),
316
+ parameters: {
317
+ depthTest: false
318
+ }
319
+ });
320
+ }
321
+ };
322
+ __publicField(PathOutlineLayer, "layerName", "PathOutlineLayer");
323
+ __publicField(PathOutlineLayer, "defaultProps", defaultProps);
324
+
325
+ // dist/path-marker-layer/path-marker-layer.js
326
+ var import_core4 = require("@deck.gl/core");
327
+ var import_layers3 = require("@deck.gl/layers");
328
+ var import_mesh_layers = require("@deck.gl/mesh-layers");
329
+
330
+ // dist/path-marker-layer/arrow-2d-geometry.js
331
+ var import_engine = require("@luma.gl/engine");
332
+ var Arrow2DGeometry = class extends import_engine.Geometry {
333
+ constructor(opts = {}) {
334
+ super(Object.assign({}, opts, {
335
+ attributes: getArrowAttributes(opts),
336
+ topology: "triangle-list"
337
+ }));
338
+ }
339
+ };
340
+ function getArrowAttributes({ length = 1, headSize = 0.2, tailWidth = 0.05, tailStart = 0.05 }) {
341
+ const texCoords = [
342
+ // HEAD
343
+ 0.5,
344
+ 1,
345
+ 0,
346
+ 0.5 - headSize / 2,
347
+ 1 - headSize,
348
+ 0,
349
+ 0.5 + headSize / 2,
350
+ 1 - headSize,
351
+ 0,
352
+ 0.5 - tailWidth / 2,
353
+ tailStart,
354
+ 0,
355
+ 0.5 + tailWidth / 2,
356
+ 1 - headSize,
357
+ 0,
358
+ 0.5 + tailWidth / 2,
359
+ tailStart,
360
+ 0,
361
+ 0.5 - tailWidth / 2,
362
+ tailStart,
363
+ 0,
364
+ 0.5 - tailWidth / 2,
365
+ 1 - headSize,
366
+ 0,
367
+ 0.5 + tailWidth / 2,
368
+ 1 - headSize,
369
+ 0
370
+ ];
371
+ const normals = [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1];
372
+ const positions = new Array(texCoords.length);
373
+ for (let i = 0; i < texCoords.length / 3; i++) {
374
+ const i3 = i * 3;
375
+ positions[i3 + 0] = (texCoords[i3 + 0] - 0.5) * length;
376
+ positions[i3 + 1] = (texCoords[i3 + 1] - 0.5) * length;
377
+ positions[i3 + 2] = 0;
378
+ }
379
+ return {
380
+ positions: { size: 3, value: new Float32Array(positions) },
381
+ normals: { size: 3, value: new Float32Array(normals) },
382
+ texCoords: { size: 2, value: new Float32Array(texCoords) }
383
+ };
384
+ }
385
+
386
+ // dist/path-marker-layer/create-path-markers.js
387
+ var import_core2 = require("@math.gl/core");
388
+ function getLineLength(vPoints) {
389
+ let lineLength = 0;
390
+ for (let i = 0; i < vPoints.length - 1; i++) {
391
+ lineLength += vPoints[i].distance(vPoints[i + 1]);
392
+ }
393
+ return lineLength;
394
+ }
395
+ var DEFAULT_COLOR = [0, 0, 0, 255];
396
+ var DEFAULT_DIRECTION = { forward: true, backward: false };
397
+ function createPathMarkers({ data, getPath = (x, context) => x.path, getDirection = (x) => x.direction, getColor = (x) => DEFAULT_COLOR, getMarkerPercentages = (x, info) => [0.5], projectFlat }) {
398
+ const markers = [];
399
+ for (const object of data) {
400
+ const path = getPath(object, null);
401
+ const direction = getDirection(object) || DEFAULT_DIRECTION;
402
+ const color = getColor(object);
403
+ const vPoints = path.map((p) => new import_core2.Vector2(p));
404
+ const vPointsReverse = vPoints.slice(0).reverse();
405
+ const lineLength = getLineLength(vPoints);
406
+ const percentages = getMarkerPercentages(object, { lineLength });
407
+ for (const percentage of percentages) {
408
+ if (direction.forward) {
409
+ const marker = createMarkerAlongPath({
410
+ path: vPoints,
411
+ percentage,
412
+ lineLength,
413
+ color,
414
+ object,
415
+ projectFlat
416
+ });
417
+ markers.push(marker);
418
+ }
419
+ if (direction.backward) {
420
+ const marker = createMarkerAlongPath({
421
+ path: vPointsReverse,
422
+ percentage,
423
+ lineLength,
424
+ color,
425
+ object,
426
+ projectFlat
427
+ });
428
+ markers.push(marker);
429
+ }
430
+ }
431
+ }
432
+ return markers;
433
+ }
434
+ function createMarkerAlongPath({ path, percentage, lineLength, color, object, projectFlat }) {
435
+ const distanceAlong = lineLength * percentage;
436
+ let currentDistance = 0;
437
+ let previousDistance = 0;
438
+ let i = 0;
439
+ for (i = 0; i < path.length - 1; i++) {
440
+ currentDistance += path[i].distance(path[i + 1]);
441
+ if (currentDistance > distanceAlong) {
442
+ break;
443
+ }
444
+ previousDistance = currentDistance;
445
+ }
446
+ if (i === path.length - 1) {
447
+ i -= 1;
448
+ }
449
+ const vDirection = path[i + 1].clone().subtract(path[i]).normalize();
450
+ const along = distanceAlong - previousDistance;
451
+ const vCenter = vDirection.clone().multiply(new import_core2.Vector2(along, along)).add(path[i]);
452
+ const vDirection2 = new import_core2.Vector2(projectFlat(path[i + 1])).subtract(projectFlat(path[i]));
453
+ const angle = vDirection2.verticalAngle() * 180 / Math.PI;
454
+ return { position: [vCenter.x, vCenter.y, 0], angle, color, object };
455
+ }
456
+
457
+ // dist/path-marker-layer/polyline.js
458
+ var import_core3 = require("@math.gl/core");
459
+ function getClosestPointOnLine({ p, p1, p2, clampToLine = true }) {
460
+ const lineVector = new import_core3.Vector3(p2).subtract(p1);
461
+ const pointVector = new import_core3.Vector3(p).subtract(p1);
462
+ let dotProduct = lineVector.dot(pointVector);
463
+ if (clampToLine) {
464
+ dotProduct = (0, import_core3.clamp)(dotProduct, 0, 1);
465
+ }
466
+ return lineVector.lerp(p1, p2, dotProduct);
467
+ }
468
+ function getClosestPointOnPolyline({ p, points }) {
469
+ p = new import_core3.Vector3(p);
470
+ let pClosest = null;
471
+ let distanceSquared = Infinity;
472
+ let index = -1;
473
+ for (let i = 0; i < points.length - 1; ++i) {
474
+ const p1 = points[i];
475
+ const p2 = points[i + 1];
476
+ const pClosestOnLine = getClosestPointOnLine({ p, p1, p2 });
477
+ const distanceToLineSquared = p.distanceSquared(pClosestOnLine);
478
+ if (distanceToLineSquared < distanceSquared) {
479
+ distanceSquared = distanceToLineSquared;
480
+ pClosest = pClosestOnLine;
481
+ index = i;
482
+ }
483
+ }
484
+ return {
485
+ point: pClosest,
486
+ index,
487
+ p1: points[index],
488
+ p2: points[index + 1],
489
+ distanceSquared,
490
+ distance: Math.sqrt(distanceSquared)
491
+ };
492
+ }
493
+
494
+ // dist/path-marker-layer/path-marker-layer.js
495
+ var DISTANCE_FOR_MULTI_ARROWS = 0.1;
496
+ var ARROW_HEAD_SIZE = 0.2;
497
+ var ARROW_TAIL_WIDTH = 0.05;
498
+ var DEFAULT_MARKER_LAYER = import_mesh_layers.SimpleMeshLayer;
499
+ var DEFAULT_MARKER_LAYER_PROPS = {
500
+ mesh: new Arrow2DGeometry({ headSize: ARROW_HEAD_SIZE, tailWidth: ARROW_TAIL_WIDTH })
501
+ };
502
+ var defaultProps2 = Object.assign({}, PathOutlineLayer.defaultProps, {
503
+ MarkerLayer: DEFAULT_MARKER_LAYER,
504
+ markerLayerProps: DEFAULT_MARKER_LAYER_PROPS,
505
+ sizeScale: 100,
506
+ fp64: false,
507
+ highlightIndex: -1,
508
+ highlightPoint: null,
509
+ getPath: (x) => x.path,
510
+ getColor: (x) => x.color,
511
+ getMarkerColor: (x) => [0, 0, 0, 255],
512
+ getDirection: (x) => x.direction,
513
+ getMarkerPercentages: (object, { lineLength }) => lineLength > DISTANCE_FOR_MULTI_ARROWS ? [0.25, 0.5, 0.75] : [0.5]
514
+ });
515
+ var PathMarkerLayer = class extends import_core4.CompositeLayer {
516
+ state = void 0;
517
+ initializeState() {
518
+ this.state = {
519
+ markers: [],
520
+ mesh: new Arrow2DGeometry({ headSize: ARROW_HEAD_SIZE, tailWidth: ARROW_TAIL_WIDTH }),
521
+ closestPoint: null,
522
+ closestPoints: []
523
+ };
524
+ }
525
+ projectFlat(xyz, viewport, coordinateSystem, coordinateOrigin) {
526
+ if (coordinateSystem === import_core4.COORDINATE_SYSTEM.METER_OFFSETS) {
527
+ const [dx, dy] = viewport.metersToLngLatDelta(xyz);
528
+ const [x, y] = coordinateOrigin;
529
+ return viewport.projectFlat([x + dx, dy + y]);
530
+ } else if (coordinateSystem === import_core4.COORDINATE_SYSTEM.LNGLAT_OFFSETS) {
531
+ const [dx, dy] = xyz;
532
+ const [x, y] = coordinateOrigin;
533
+ return viewport.projectFlat([x + dx, dy + y]);
534
+ }
535
+ return viewport.projectFlat(xyz);
536
+ }
537
+ updateState({ props, oldProps, changeFlags }) {
538
+ if (changeFlags.dataChanged || changeFlags.updateTriggersChanged) {
539
+ const { data, getPath, getDirection, getMarkerColor, getMarkerPercentages, coordinateSystem, coordinateOrigin } = this.props;
540
+ const { viewport } = this.context;
541
+ const projectFlat = (o) => this.projectFlat(o, viewport, coordinateSystem, coordinateOrigin);
542
+ this.state.markers = createPathMarkers({
543
+ data,
544
+ getPath,
545
+ getDirection,
546
+ getColor: getMarkerColor,
547
+ getMarkerPercentages,
548
+ projectFlat
549
+ });
550
+ this._recalculateClosestPoint();
551
+ }
552
+ if (changeFlags.propsChanged) {
553
+ if (props.point !== oldProps.point) {
554
+ this._recalculateClosestPoint();
555
+ }
556
+ }
557
+ }
558
+ _recalculateClosestPoint() {
559
+ const { highlightPoint, highlightIndex } = this.props;
560
+ if (highlightPoint && highlightIndex >= 0) {
561
+ const object = this.props.data[highlightIndex];
562
+ const points = this.props.getPath(object, null);
563
+ const { point } = getClosestPointOnPolyline({ points, p: highlightPoint });
564
+ this.state.closestPoints = [{ position: point }];
565
+ } else {
566
+ this.state.closestPoints = [];
567
+ }
568
+ }
569
+ getPickingInfo({ info }) {
570
+ return Object.assign(info, {
571
+ // override object with picked feature
572
+ object: info.object && info.object.path || info.object
573
+ });
574
+ }
575
+ renderLayers() {
576
+ return [
577
+ new PathOutlineLayer(this.props, this.getSubLayerProps({
578
+ id: "paths",
579
+ // Note: data has to be passed explicitly like this to avoid being empty
580
+ data: this.props.data
581
+ })),
582
+ new this.props.MarkerLayer(this.getSubLayerProps(Object.assign({}, this.props.markerLayerProps, {
583
+ id: "markers",
584
+ data: this.state.markers,
585
+ getOrientation: (x) => [0, -x.angle, 0],
586
+ getColor: (x) => x.color,
587
+ sizeScale: this.props.sizeScale,
588
+ fp64: this.props.fp64,
589
+ pickable: false,
590
+ parameters: {
591
+ blend: false,
592
+ depthTest: false
593
+ }
594
+ }))),
595
+ this.state.closestPoints && new import_layers3.ScatterplotLayer({
596
+ id: `${this.props.id}-highlight`,
597
+ data: this.state.closestPoints,
598
+ fp64: this.props.fp64
599
+ })
600
+ ];
601
+ }
602
+ };
603
+ __publicField(PathMarkerLayer, "layerName", "PathMarkerLayer");
604
+ __publicField(PathMarkerLayer, "defaultProps", defaultProps2);
605
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.js", "tile-source-layer/tile-source-layer.js", "path-outline-layer/path-outline-layer.js", "path-outline-layer/outline.js", "path-marker-layer/path-marker-layer.js", "path-marker-layer/arrow-2d-geometry.js", "path-marker-layer/create-path-markers.js", "path-marker-layer/polyline.js"],
4
+ "sourcesContent": ["// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport { TileSourceLayer } from './tile-source-layer/tile-source-layer';\nexport { PathOutlineLayer } from './path-outline-layer/path-outline-layer';\nexport { PathMarkerLayer } from './path-marker-layer/path-marker-layer';\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { CompositeLayer } from '@deck.gl/core';\nimport { TileLayer } from '@deck.gl/geo-layers';\nimport { BitmapLayer, GeoJsonLayer, PathLayer } from '@deck.gl/layers';\n/* global window */\nconst devicePixelRatio = (typeof window !== 'undefined' && window.devicePixelRatio) || 1;\n/**\n * A Deck.gl layer that renders a tile source\n * Autodiscovers type of content (vector tile, bitmap, ...)\n * Can render debug borders around tiles\n * TODO - Change debug border color based on zoom level\n */\nexport class TileSourceLayer extends CompositeLayer {\n static layerName = 'TileSourceLayer';\n static defaultProps = {\n ...TileLayer.defaultProps,\n showTileBorders: true\n };\n state = undefined;\n initializeState() {\n this.setState({\n tileSource: null\n });\n }\n updateState({ props, changeFlags }) {\n this.setState({\n tileSource: props.tileSource\n });\n }\n renderLayers() {\n const { tileSource, showTileBorders, metadata, onTilesLoad } = this.props;\n const minZoom = metadata?.minZoom || 0;\n const maxZoom = metadata?.maxZoom || 30;\n return [\n new TileLayer({\n // HACK: Trigger new layer via id prop to force clear tile cache\n id: String(tileSource.url),\n getTileData: tileSource.getTileData,\n // Assume the pmtiles file support HTTP/2, so we aren't limited by the browser to a certain number per domain.\n maxRequests: 20,\n pickable: true,\n onViewportLoad: onTilesLoad,\n autoHighlight: showTileBorders,\n highlightColor: [60, 60, 60, 40],\n minZoom,\n maxZoom,\n tileSize: 256,\n // TOOD - why is this needed?\n zoomOffset: devicePixelRatio === 1 ? -1 : 0,\n renderSubLayers: renderSubLayers,\n // Custom prop\n tileSource,\n showTileBorders\n })\n ];\n }\n}\nfunction renderSubLayers(props) {\n const { tileSource, showTileBorders, minZoom, maxZoom, tile: { index: { z: zoom }, bbox: { west, south, east, north } } } = props;\n const layers = [];\n const borderColor = zoom <= minZoom || zoom >= maxZoom ? [255, 0, 0, 255] : [0, 0, 255, 255];\n switch (tileSource.mimeType) {\n case 'application/vnd.mapbox-vector-tile':\n layers.push(new GeoJsonLayer({\n id: `${props.id}-geojson`,\n data: props.data,\n pickable: true,\n getFillColor: [0, 190, 80, 255],\n lineWidthScale: 500,\n lineWidthMinPixels: 0.5\n }));\n break;\n case 'image/png':\n case 'image/jpeg':\n case 'image/webp':\n case 'image/avif':\n layers.push(new BitmapLayer(props, {\n data: null,\n image: props.data,\n bounds: [west, south, east, north],\n pickable: true\n }));\n break;\n default:\n // eslint-disable-next-line no-console\n console.error('Unknown tile mimeType', tileSource?.mimeType);\n }\n // Debug tile borders\n if (showTileBorders) {\n layers.push(new PathLayer({\n id: `${props.id}-border`,\n data: [\n [\n [west, north],\n [west, south],\n [east, south],\n [east, north],\n [west, north]\n ]\n ],\n getPath: (d) => d,\n getColor: borderColor,\n widthMinPixels: 4\n }));\n }\n return layers;\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { PathLayer } from '@deck.gl/layers';\nimport { GL } from '@luma.gl/constants';\nimport { outline } from './outline';\n/**\n * Unit literal to shader unit number conversion.\n */\nexport const UNIT = {\n common: 0,\n meters: 1,\n pixels: 2\n};\n// TODO - this should be built into assembleShaders\nfunction injectShaderCode({ source, code = '' }) {\n const INJECT_CODE = /}[^{}]*$/;\n return source.replace(INJECT_CODE, code.concat('\\n}\\n'));\n}\nconst VS_CODE = `\\\n outline_setUV(gl_Position);\n outline_setZLevel(instanceZLevel);\n`;\nconst FS_CODE = `\\\n fragColor = outline_filterColor(fragColor);\n`;\nconst defaultProps = {\n getZLevel: () => 0\n};\nexport class PathOutlineLayer extends PathLayer {\n static layerName = 'PathOutlineLayer';\n static defaultProps = defaultProps;\n state = undefined;\n // Override getShaders to inject the outline module\n getShaders() {\n const shaders = super.getShaders();\n return Object.assign({}, shaders, {\n modules: shaders.modules.concat([outline]),\n vs: injectShaderCode({ source: shaders.vs, code: VS_CODE }),\n fs: injectShaderCode({ source: shaders.fs, code: FS_CODE })\n });\n }\n // @ts-expect-error PathLayer is missing LayerContext arg\n initializeState(context) {\n super.initializeState();\n // Create an outline \"shadow\" map\n // TODO - we should create a single outlineMap for all layers\n this.setState({\n outlineFramebuffer: context.device.createFramebuffer({}),\n dummyTexture: context.device.createTexture({})\n });\n // Create an attribute manager\n // @ts-expect-error check whether this.getAttributeManager works here\n this.state.attributeManager.addInstanced({\n instanceZLevel: {\n size: 1,\n type: GL.UNSIGNED_BYTE,\n accessor: 'getZLevel'\n }\n });\n }\n // Override draw to add render module\n draw({ moduleParameters = {}, parameters, uniforms, context }) {\n // Need to calculate same uniforms as base layer\n const { jointRounded, capRounded, billboard, miterLimit, widthUnits, widthScale, widthMinPixels, widthMaxPixels } = this.props;\n uniforms = Object.assign({}, uniforms, {\n jointType: Number(jointRounded),\n capType: Number(capRounded),\n billboard,\n widthUnits: UNIT[widthUnits],\n widthScale,\n miterLimit,\n widthMinPixels,\n widthMaxPixels\n });\n // Render the outline shadowmap (based on segment z orders)\n const { outlineFramebuffer, dummyTexture } = this.state;\n // TODO(v9): resize, see 'sf' example.\n // outlineFramebuffer.resize();\n // TODO(v9) clear FBO\n // outlineFramebuffer.clear({ color: true, depth: true, stencil: true });\n this.state.model.updateModuleSettings({\n outlineEnabled: true,\n outlineRenderShadowmap: true,\n outlineShadowmap: dummyTexture\n });\n this.state.model.draw({\n uniforms: Object.assign({}, uniforms, {\n jointType: 0,\n widthScale: this.props.widthScale * 1.3\n }),\n parameters: {\n depthTest: false,\n // Biggest value needs to go into buffer\n blendEquation: GL.MAX\n },\n framebuffer: outlineFramebuffer\n });\n // Now use the outline shadowmap to render the lines (with outlines)\n this.state.model.updateModuleSettings({\n outlineEnabled: true,\n outlineRenderShadowmap: false,\n outlineShadowmap: outlineFramebuffer\n });\n this.state.model.draw({\n uniforms: Object.assign({}, uniforms, {\n jointType: Number(jointRounded),\n capType: Number(capRounded),\n widthScale: this.props.widthScale\n }),\n parameters: {\n depthTest: false\n }\n });\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/* eslint-disable camelcase */\nconst INITIAL_STATE = {\n outlineEnabled: false,\n outlineRenderShadowmap: false,\n outlineShadowmap: null\n};\nfunction getUniforms({ outlineEnabled, outlineRenderShadowmap, outlineShadowmap } = INITIAL_STATE) {\n const uniforms = {};\n if (outlineEnabled !== undefined) {\n // ? 1.0 : 0.0;\n uniforms.outline_uEnabled = outlineEnabled;\n }\n if (outlineRenderShadowmap !== undefined) {\n // ? 1.0 : 0.0;\n uniforms.outline_uRenderOutlines = outlineRenderShadowmap;\n }\n if (outlineShadowmap !== undefined) {\n uniforms.outline_uShadowmap = outlineShadowmap;\n }\n return uniforms;\n}\nconst vs = `\\\n#version 300 es\nin float instanceZLevel;\nout float outline_vzLevel;\nout vec4 outline_vPosition;\n\n// Set the z level for the outline shadowmap rendering\nvoid outline_setZLevel(float zLevel) {\n outline_vzLevel = zLevel;\n}\n\n// Store an adjusted position for texture2DProj\nvoid outline_setUV(vec4 position) {\n // mat4(\n // 0.5, 0.0, 0.0, 0.0,\n // 0.0, 0.5, 0.0, 0.0,\n // 0.0, 0.0, 0.5, 0.0,\n // 0.5, 0.5, 0.5, 1.0\n // ) * position;\n outline_vPosition = vec4(position.xyz * 0.5 + position.w * 0.5, position.w);\n}\n`;\nconst fs = `\\\nuniform bool outline_uEnabled;\nuniform bool outline_uRenderOutlines;\nuniform sampler2D outline_uShadowmap;\n\nin float outline_vzLevel;\n// in vec2 outline_vUV;\nin vec4 outline_vPosition;\n\nout vec4 fragColor;\n\nconst float OUTLINE_Z_LEVEL_ERROR = 0.01;\n\n// Return a darker color in shadowmap\nvec4 outline_filterShadowColor(vec4 color) {\n return vec4(outline_vzLevel / 255., outline_vzLevel / 255., outline_vzLevel / 255., 1.);\n}\n\n// Return a darker color if in shadowmap\nvec4 outline_filterDarkenColor(vec4 color) {\n if (outline_uEnabled) {\n float maxZLevel;\n if (outline_vPosition.q > 0.0) {\n maxZLevel = texture2DProj(outline_uShadowmap, outline_vPosition).r * 255.;\n } else {\n discard;\n }\n if (maxZLevel < outline_vzLevel + OUTLINE_Z_LEVEL_ERROR) {\n vec4(color.rgb * 0.5, color.a);\n } else {\n discard;\n }\n }\n return color;\n}\n\n// if enabled and rendering outlines - Render depth to shadowmap\n// if enabled and rendering colors - Return a darker color if in shadowmap\n// if disabled, just return color\nvec4 outline_filterColor(vec4 color) {\n if (outline_uEnabled) {\n return outline_uRenderOutlines ?\n outline_filterShadowColor(color) :\n outline_filterDarkenColor(color);\n }\n return color;\n}\n`;\nexport const outline = {\n name: 'outline',\n vs,\n fs,\n getUniforms\n};\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { CompositeLayer, COORDINATE_SYSTEM } from '@deck.gl/core';\nimport { ScatterplotLayer } from '@deck.gl/layers';\nimport { SimpleMeshLayer } from '@deck.gl/mesh-layers';\nimport { PathOutlineLayer } from '../path-outline-layer/path-outline-layer';\nimport { Arrow2DGeometry } from './arrow-2d-geometry';\nimport { createPathMarkers } from './create-path-markers';\nimport { getClosestPointOnPolyline } from './polyline';\nconst DISTANCE_FOR_MULTI_ARROWS = 0.1;\nconst ARROW_HEAD_SIZE = 0.2;\nconst ARROW_TAIL_WIDTH = 0.05;\n// const ARROW_CENTER_ADJUST = -0.8;\nconst DEFAULT_MARKER_LAYER = SimpleMeshLayer;\nconst DEFAULT_MARKER_LAYER_PROPS = {\n mesh: new Arrow2DGeometry({ headSize: ARROW_HEAD_SIZE, tailWidth: ARROW_TAIL_WIDTH })\n};\nconst defaultProps = Object.assign({}, PathOutlineLayer.defaultProps, {\n MarkerLayer: DEFAULT_MARKER_LAYER,\n markerLayerProps: DEFAULT_MARKER_LAYER_PROPS,\n sizeScale: 100,\n fp64: false,\n highlightIndex: -1,\n highlightPoint: null,\n getPath: (x) => x.path,\n getColor: (x) => x.color,\n getMarkerColor: (x) => [0, 0, 0, 255],\n getDirection: (x) => x.direction,\n getMarkerPercentages: (object, { lineLength }) => lineLength > DISTANCE_FOR_MULTI_ARROWS ? [0.25, 0.5, 0.75] : [0.5]\n});\nexport class PathMarkerLayer extends CompositeLayer {\n static layerName = 'PathMarkerLayer';\n static defaultProps = defaultProps;\n state = undefined;\n initializeState() {\n this.state = {\n markers: [],\n mesh: new Arrow2DGeometry({ headSize: ARROW_HEAD_SIZE, tailWidth: ARROW_TAIL_WIDTH }),\n closestPoint: null,\n closestPoints: []\n };\n }\n projectFlat(xyz, viewport, coordinateSystem, coordinateOrigin) {\n if (coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS) {\n const [dx, dy] = viewport.metersToLngLatDelta(xyz);\n const [x, y] = coordinateOrigin;\n return viewport.projectFlat([x + dx, dy + y]);\n }\n else if (coordinateSystem === COORDINATE_SYSTEM.LNGLAT_OFFSETS) {\n const [dx, dy] = xyz;\n const [x, y] = coordinateOrigin;\n return viewport.projectFlat([x + dx, dy + y]);\n }\n return viewport.projectFlat(xyz);\n }\n updateState({ props, oldProps, changeFlags }) {\n if (changeFlags.dataChanged || changeFlags.updateTriggersChanged) {\n const { data, getPath, getDirection, getMarkerColor, getMarkerPercentages, coordinateSystem, coordinateOrigin } = this.props;\n const { viewport } = this.context;\n const projectFlat = (o) => this.projectFlat(o, viewport, coordinateSystem, coordinateOrigin);\n this.state.markers = createPathMarkers({\n data,\n getPath,\n getDirection,\n getColor: getMarkerColor,\n getMarkerPercentages,\n projectFlat\n });\n this._recalculateClosestPoint();\n }\n if (changeFlags.propsChanged) {\n if (props.point !== oldProps.point) {\n this._recalculateClosestPoint();\n }\n }\n }\n _recalculateClosestPoint() {\n const { highlightPoint, highlightIndex } = this.props;\n if (highlightPoint && highlightIndex >= 0) {\n const object = this.props.data[highlightIndex];\n const points = this.props.getPath(object, null);\n const { point } = getClosestPointOnPolyline({ points, p: highlightPoint });\n this.state.closestPoints = [{ position: point }];\n }\n else {\n this.state.closestPoints = [];\n }\n }\n getPickingInfo({ info }) {\n return Object.assign(info, {\n // override object with picked feature\n object: (info.object && info.object.path) || info.object\n });\n }\n renderLayers() {\n return [\n new PathOutlineLayer(this.props, this.getSubLayerProps({\n id: 'paths',\n // Note: data has to be passed explicitly like this to avoid being empty\n data: this.props.data\n })),\n new this.props.MarkerLayer(this.getSubLayerProps(Object.assign({}, this.props.markerLayerProps, {\n id: 'markers',\n data: this.state.markers,\n getOrientation: (x) => [0, -x.angle, 0],\n getColor: (x) => x.color,\n sizeScale: this.props.sizeScale,\n fp64: this.props.fp64,\n pickable: false,\n parameters: {\n blend: false,\n depthTest: false\n }\n }))),\n this.state.closestPoints &&\n new ScatterplotLayer({\n id: `${this.props.id}-highlight`,\n data: this.state.closestPoints,\n fp64: this.props.fp64\n })\n ];\n }\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Geometry } from '@luma.gl/engine';\nexport class Arrow2DGeometry extends Geometry {\n constructor(opts = {}) {\n super(Object.assign({}, opts, {\n attributes: getArrowAttributes(opts),\n topology: 'triangle-list'\n }));\n }\n}\nfunction getArrowAttributes({ length = 1, headSize = 0.2, tailWidth = 0.05, tailStart = 0.05 }) {\n const texCoords = [\n // HEAD\n 0.5,\n 1.0,\n 0,\n 0.5 - headSize / 2,\n 1.0 - headSize,\n 0,\n 0.5 + headSize / 2,\n 1.0 - headSize,\n 0,\n 0.5 - tailWidth / 2,\n tailStart,\n 0,\n 0.5 + tailWidth / 2,\n 1.0 - headSize,\n 0,\n 0.5 + tailWidth / 2,\n tailStart,\n 0,\n 0.5 - tailWidth / 2,\n tailStart,\n 0,\n 0.5 - tailWidth / 2,\n 1.0 - headSize,\n 0,\n 0.5 + tailWidth / 2,\n 1.0 - headSize,\n 0\n ];\n const normals = [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1];\n // Center and scale\n const positions = new Array(texCoords.length);\n for (let i = 0; i < texCoords.length / 3; i++) {\n const i3 = i * 3;\n positions[i3 + 0] = (texCoords[i3 + 0] - 0.5) * length;\n positions[i3 + 1] = (texCoords[i3 + 1] - 0.5) * length;\n positions[i3 + 2] = 0;\n }\n return {\n positions: { size: 3, value: new Float32Array(positions) },\n normals: { size: 3, value: new Float32Array(normals) },\n texCoords: { size: 2, value: new Float32Array(texCoords) }\n };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Vector2 } from '@math.gl/core';\nfunction getLineLength(vPoints) {\n // calculate total length\n let lineLength = 0;\n for (let i = 0; i < vPoints.length - 1; i++) {\n lineLength += vPoints[i].distance(vPoints[i + 1]);\n }\n return lineLength;\n}\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst DEFAULT_DIRECTION = { forward: true, backward: false };\nexport function createPathMarkers({ data, getPath = (x, context) => x.path, getDirection = (x) => x.direction, getColor = (x) => DEFAULT_COLOR, getMarkerPercentages = (x, info) => [0.5], projectFlat }) {\n const markers = [];\n for (const object of data) {\n const path = getPath(object, null);\n const direction = getDirection(object) || DEFAULT_DIRECTION;\n const color = getColor(object);\n const vPoints = path.map((p) => new Vector2(p));\n const vPointsReverse = vPoints.slice(0).reverse();\n // calculate total length\n const lineLength = getLineLength(vPoints);\n // Ask for where to put markers\n const percentages = getMarkerPercentages(object, { lineLength });\n // Create the markers\n for (const percentage of percentages) {\n if (direction.forward) {\n const marker = createMarkerAlongPath({\n path: vPoints,\n percentage,\n lineLength,\n color,\n object,\n projectFlat\n });\n markers.push(marker);\n }\n if (direction.backward) {\n const marker = createMarkerAlongPath({\n path: vPointsReverse,\n percentage,\n lineLength,\n color,\n object,\n projectFlat\n });\n markers.push(marker);\n }\n }\n }\n return markers;\n}\nfunction createMarkerAlongPath({ path, percentage, lineLength, color, object, projectFlat }) {\n const distanceAlong = lineLength * percentage;\n let currentDistance = 0;\n let previousDistance = 0;\n let i = 0;\n for (i = 0; i < path.length - 1; i++) {\n currentDistance += path[i].distance(path[i + 1]);\n if (currentDistance > distanceAlong) {\n break;\n }\n previousDistance = currentDistance;\n }\n // If reached the end of the loop without exiting early,\n // undo the final increment to avoid a null-pointer exception\n if (i === path.length - 1) {\n i -= 1;\n }\n const vDirection = path[i + 1].clone().subtract(path[i]).normalize();\n const along = distanceAlong - previousDistance;\n const vCenter = vDirection.clone().multiply(new Vector2(along, along)).add(path[i]);\n const vDirection2 = new Vector2(projectFlat(path[i + 1])).subtract(projectFlat(path[i]));\n const angle = (vDirection2.verticalAngle() * 180) / Math.PI;\n return { position: [vCenter.x, vCenter.y, 0], angle, color, object };\n}\n", "// deck.gl-community\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Vector3, clamp } from '@math.gl/core';\n// Return the closest point on a line segment\nexport function getClosestPointOnLine({ p, p1, p2, clampToLine = true }) {\n const lineVector = new Vector3(p2).subtract(p1);\n const pointVector = new Vector3(p).subtract(p1);\n let dotProduct = lineVector.dot(pointVector);\n if (clampToLine) {\n dotProduct = clamp(dotProduct, 0, 1);\n }\n return lineVector.lerp(p1, p2, dotProduct);\n}\n// Return the closest point on a line segment\nexport function getClosestPointOnPolyline({ p, points }) {\n p = new Vector3(p);\n let pClosest = null;\n let distanceSquared = Infinity;\n let index = -1;\n for (let i = 0; i < points.length - 1; ++i) {\n const p1 = points[i];\n const p2 = points[i + 1];\n const pClosestOnLine = getClosestPointOnLine({ p, p1, p2 });\n const distanceToLineSquared = p.distanceSquared(pClosestOnLine);\n if (distanceToLineSquared < distanceSquared) {\n distanceSquared = distanceToLineSquared;\n pClosest = pClosestOnLine;\n index = i;\n }\n }\n return {\n point: pClosest,\n index,\n p1: points[index],\n p2: points[index + 1],\n distanceSquared,\n distance: Math.sqrt(distanceSquared)\n };\n}\n"],
5
+ "mappings": ";;;;;;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