@abi-software/flatmap-viewer 2.7.2 → 2.7.3-a.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.
Files changed (121) hide show
  1. package/dist/flatmapviewer.es.js +80577 -0
  2. package/dist/flatmapviewer.umd.js +1687 -0
  3. package/dist/lib/index.d.ts +4 -0
  4. package/dist/style.css +1 -0
  5. package/package.json +10 -8
  6. package/lib/index.ts +0 -10
  7. package/src/contextmenu.js +0 -97
  8. package/src/controls/annotation.js +0 -302
  9. package/src/controls/controls.js +0 -645
  10. package/src/controls/flightpaths.js +0 -95
  11. package/src/controls/info.js +0 -291
  12. package/src/controls/minimap.js +0 -442
  13. package/src/controls/paths.js +0 -143
  14. package/src/controls/search.js +0 -113
  15. package/src/controls/systems.js +0 -75
  16. package/src/controls/taxons.js +0 -73
  17. package/src/flatmap-viewer.js +0 -1789
  18. package/src/images.js +0 -66
  19. package/src/interactions.js +0 -1569
  20. package/src/layers/cluster.js +0 -177
  21. package/src/layers/filter.js +0 -310
  22. package/src/layers/flightpaths.js +0 -383
  23. package/src/layers/index.js +0 -478
  24. package/src/layers/styling.js +0 -1077
  25. package/src/main.js +0 -272
  26. package/src/mapserver.js +0 -64
  27. package/src/mathjax.js +0 -100
  28. package/src/pathways.js +0 -427
  29. package/src/search.js +0 -137
  30. package/src/systems.js +0 -146
  31. package/src/utils.js +0 -152
  32. package/static/css/flatmap-viewer.css +0 -238
  33. package/static/icons/favicon.ico +0 -0
  34. package/static/images/active.png +0 -0
  35. package/static/images/inactive.png +0 -0
  36. package/static/images/reset-map-active.png +0 -0
  37. package/static/images/reset-map-button.png +0 -0
  38. package/static/images/rounded-background.png +0 -0
  39. package/static/images/zoom-in-active.png +0 -0
  40. package/static/images/zoom-in-button.png +0 -0
  41. package/static/images/zoom-out-active.png +0 -0
  42. package/static/images/zoom-out-button.png +0 -0
  43. package/thirdParty/maplibre-gl-svg/CHANGELOG.md +0 -13
  44. package/thirdParty/maplibre-gl-svg/LICENSE +0 -21
  45. package/thirdParty/maplibre-gl-svg/LICENSE.md +0 -21
  46. package/thirdParty/maplibre-gl-svg/README.md +0 -24
  47. package/thirdParty/maplibre-gl-svg/assets/Add custom SVG template to template manager.jpg +0 -0
  48. package/thirdParty/maplibre-gl-svg/assets/All built-in SVG templates as HTML markers.jpg +0 -0
  49. package/thirdParty/maplibre-gl-svg/assets/All built-in SVG templates as symbols.jpg +0 -0
  50. package/thirdParty/maplibre-gl-svg/assets/Fill polygon with built-in SVG template.jpg +0 -0
  51. package/thirdParty/maplibre-gl-svg/assets/HTML Marker with Custom SVG Template.jpg +0 -0
  52. package/thirdParty/maplibre-gl-svg/assets/HTML Marker with built-in SVG template.jpg +0 -0
  53. package/thirdParty/maplibre-gl-svg/assets/Line layer with built-in SVG template.jpg +0 -0
  54. package/thirdParty/maplibre-gl-svg/assets/Load SVG from URL.jpg +0 -0
  55. package/thirdParty/maplibre-gl-svg/assets/SVG template options.jpg +0 -0
  56. package/thirdParty/maplibre-gl-svg/assets/Smiley_face_changed.svg +0 -37
  57. package/thirdParty/maplibre-gl-svg/assets/Symbol layer with built-in SVG template.jpg +0 -0
  58. package/thirdParty/maplibre-gl-svg/assets/image-templates/arrow-up-thin.png +0 -0
  59. package/thirdParty/maplibre-gl-svg/assets/image-templates/arrow-up.png +0 -0
  60. package/thirdParty/maplibre-gl-svg/assets/image-templates/car.png +0 -0
  61. package/thirdParty/maplibre-gl-svg/assets/image-templates/checker-rotated.png +0 -0
  62. package/thirdParty/maplibre-gl-svg/assets/image-templates/checker.png +0 -0
  63. package/thirdParty/maplibre-gl-svg/assets/image-templates/circles-spaced.png +0 -0
  64. package/thirdParty/maplibre-gl-svg/assets/image-templates/circles.png +0 -0
  65. package/thirdParty/maplibre-gl-svg/assets/image-templates/diagonal-lines-down.png +0 -0
  66. package/thirdParty/maplibre-gl-svg/assets/image-templates/diagonal-lines-up.png +0 -0
  67. package/thirdParty/maplibre-gl-svg/assets/image-templates/diagonal-stripes-down.png +0 -0
  68. package/thirdParty/maplibre-gl-svg/assets/image-templates/diagonal-stripes-up.png +0 -0
  69. package/thirdParty/maplibre-gl-svg/assets/image-templates/dots.png +0 -0
  70. package/thirdParty/maplibre-gl-svg/assets/image-templates/flag-triangle.png +0 -0
  71. package/thirdParty/maplibre-gl-svg/assets/image-templates/flag.png +0 -0
  72. package/thirdParty/maplibre-gl-svg/assets/image-templates/grid-lines.png +0 -0
  73. package/thirdParty/maplibre-gl-svg/assets/image-templates/hexagon-rounded-thick.png +0 -0
  74. package/thirdParty/maplibre-gl-svg/assets/image-templates/hexagon-rounded.png +0 -0
  75. package/thirdParty/maplibre-gl-svg/assets/image-templates/hexagon-thick.png +0 -0
  76. package/thirdParty/maplibre-gl-svg/assets/image-templates/hexagon.png +0 -0
  77. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-arrow.png +0 -0
  78. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-ball-pin.png +0 -0
  79. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-circle.png +0 -0
  80. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-flat.png +0 -0
  81. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-square-cluster.png +0 -0
  82. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-square-rounded-cluster.png +0 -0
  83. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-square-rounded.png +0 -0
  84. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-square.png +0 -0
  85. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker-thick.png +0 -0
  86. package/thirdParty/maplibre-gl-svg/assets/image-templates/marker.png +0 -0
  87. package/thirdParty/maplibre-gl-svg/assets/image-templates/pin-round.png +0 -0
  88. package/thirdParty/maplibre-gl-svg/assets/image-templates/pin.png +0 -0
  89. package/thirdParty/maplibre-gl-svg/assets/image-templates/rotated-grid-lines.png +0 -0
  90. package/thirdParty/maplibre-gl-svg/assets/image-templates/rotated-grid-stripes.png +0 -0
  91. package/thirdParty/maplibre-gl-svg/assets/image-templates/rounded-square-thick.png +0 -0
  92. package/thirdParty/maplibre-gl-svg/assets/image-templates/rounded-square.png +0 -0
  93. package/thirdParty/maplibre-gl-svg/assets/image-templates/triangle-arrow-left.png +0 -0
  94. package/thirdParty/maplibre-gl-svg/assets/image-templates/triangle-arrow-up.png +0 -0
  95. package/thirdParty/maplibre-gl-svg/assets/image-templates/triangle-thick.png +0 -0
  96. package/thirdParty/maplibre-gl-svg/assets/image-templates/triangle.png +0 -0
  97. package/thirdParty/maplibre-gl-svg/assets/image-templates/x-fill.png +0 -0
  98. package/thirdParty/maplibre-gl-svg/assets/image-templates/zig-zag-vertical.png +0 -0
  99. package/thirdParty/maplibre-gl-svg/assets/image-templates/zig-zag.png +0 -0
  100. package/thirdParty/maplibre-gl-svg/build/build.js +0 -210
  101. package/thirdParty/maplibre-gl-svg/dist/maplibre-gl-svg.js +0 -339
  102. package/thirdParty/maplibre-gl-svg/dist/maplibre-gl-svg.min.js +0 -4
  103. package/thirdParty/maplibre-gl-svg/docs/docs.md +0 -375
  104. package/thirdParty/maplibre-gl-svg/examples/Add custom SVG template to template manager.html +0 -101
  105. package/thirdParty/maplibre-gl-svg/examples/All built-in SVG templates as HTML markers.html +0 -82
  106. package/thirdParty/maplibre-gl-svg/examples/All built-in SVG templates as symbols.html +0 -124
  107. package/thirdParty/maplibre-gl-svg/examples/Fill polygon with built-in SVG template.html +0 -94
  108. package/thirdParty/maplibre-gl-svg/examples/HTML Marker with Custom SVG Template.html +0 -86
  109. package/thirdParty/maplibre-gl-svg/examples/HTML Marker with built-in SVG template.html +0 -83
  110. package/thirdParty/maplibre-gl-svg/examples/Line layer with built-in SVG template.html +0 -129
  111. package/thirdParty/maplibre-gl-svg/examples/Load SVG from URL.html +0 -96
  112. package/thirdParty/maplibre-gl-svg/examples/SVG template options.html +0 -264
  113. package/thirdParty/maplibre-gl-svg/examples/Symbol layer with built-in SVG template.html +0 -93
  114. package/thirdParty/maplibre-gl-svg/index.html +0 -151
  115. package/thirdParty/maplibre-gl-svg/package-lock.json +0 -5882
  116. package/thirdParty/maplibre-gl-svg/package.json +0 -49
  117. package/thirdParty/maplibre-gl-svg/src/SvgManager.ts +0 -186
  118. package/thirdParty/maplibre-gl-svg/src/SvgTemplateManager.ts +0 -144
  119. package/thirdParty/maplibre-gl-svg/src/index.ts +0 -4
  120. package/thirdParty/maplibre-gl-svg/tsconfig.json +0 -31
  121. package/thirdParty/maplibre-gl-svg/typings/index.d.ts +0 -111
@@ -1,478 +0,0 @@
1
- /******************************************************************************
2
-
3
- Flatmap viewer and annotation tool
4
-
5
- Copyright (c) 2019 David Brooks
6
-
7
- Licensed under the Apache License, Version 2.0 (the "License");
8
- you may not use this file except in compliance with the License.
9
- You may obtain a copy of the License at
10
-
11
- http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- Unless required by applicable law or agreed to in writing, software
14
- distributed under the License is distributed on an "AS IS" BASIS,
15
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- See the License for the specific language governing permissions and
17
- limitations under the License.
18
-
19
- ******************************************************************************/
20
-
21
- 'use strict';
22
-
23
- //==============================================================================
24
-
25
- import {PATHWAYS_LAYER} from '../pathways.js';
26
- import * as utils from '../utils.js';
27
-
28
- import {ClusteredMarkerLayer} from './cluster'
29
- import * as style from './styling.js';
30
-
31
- import {FlightPathLayer} from './flightpaths'
32
- import {PropertiesFilter} from './filter'
33
-
34
- const FEATURES_LAYER = 'features';
35
- const RASTER_LAYERS_NAME = 'Background image layer';
36
- const RASTER_LAYERS_ID = 'background-image-layer';
37
-
38
- //==============================================================================
39
-
40
- class MapStylingLayers
41
- {
42
- constructor(flatmap, layer, options)
43
- {
44
- this.__map = flatmap.map;
45
- this.__id = layer.id;
46
- this.__description = layer.description;
47
- this.__active = true;
48
- this.__layers = [];
49
- this.__layerOptions = options;
50
- this.__separateLayers = flatmap.options.separateLayers;
51
- }
52
-
53
- get id()
54
- //======
55
- {
56
- return this.__id;
57
- }
58
-
59
- get description()
60
- //===============
61
- {
62
- return this.__description;
63
- }
64
-
65
- get active()
66
- //==========
67
- {
68
- return this.__active;
69
- }
70
-
71
- get map()
72
- //=======
73
- {
74
- return this.__map
75
- }
76
-
77
- addLayer(styleLayer, options)
78
- //===========================
79
- {
80
- this.__map.addLayer(styleLayer.style(options));
81
- this.__layers.push(styleLayer);
82
- }
83
-
84
- __showLayer(layer, visible=true)
85
- //===============================
86
- {
87
- this.__map.setLayoutProperty(layer.id, 'visibility', visible ? 'visible' : 'none');
88
- }
89
-
90
- activate(enable=true)
91
- //===================
92
- {
93
- for (const layer of this.__layers) {
94
- this.__showLayer(layer, enable);
95
- }
96
- this.__active = enable;
97
- }
98
-
99
- vectorSourceId(sourceLayer)
100
- //=========================
101
- {
102
- return (this.__separateLayers ? `${this.__id}_${sourceLayer}`
103
- : sourceLayer).replaceAll('/', '_');
104
- }
105
-
106
- setPaint(options)
107
- {
108
- }
109
-
110
- setFilter(options)
111
- {
112
- }
113
- }
114
-
115
- //==============================================================================
116
-
117
- class MapFeatureLayers extends MapStylingLayers
118
- {
119
- #pathLayers = []
120
-
121
- constructor(flatmap, layer, options)
122
- {
123
- super(flatmap, layer, options);
124
- const vectorTileSource = this.__map.getSource('vector-tiles');
125
- const haveVectorLayers = (typeof vectorTileSource !== 'undefined');
126
-
127
- // if no image layers then make feature borders (and lines?) more visible...??
128
- if (haveVectorLayers) {
129
- const featuresVectorSource = this.vectorSourceId(FEATURES_LAYER);
130
- const vectorFeatures = vectorTileSource.vectorLayerIds.includes(featuresVectorSource);
131
- if (vectorFeatures) {
132
- this.__addStyleLayer(style.FeatureFillLayer);
133
- this.__addStyleLayer(style.FeatureDashLineLayer);
134
- this.__addStyleLayer(style.FeatureLineLayer);
135
- this.__addStyleLayer(style.FeatureBorderLayer);
136
- this.__addStyleLayer(style.CentrelineNodeFillLayer);
137
- }
138
- this.__addPathwayStyleLayers();
139
- if (vectorFeatures) {
140
- this.__addStyleLayer(style.FeatureLargeSymbolLayer);
141
- if (!flatmap.options.tooltips) {
142
- this.__addStyleLayer(style.FeatureSmallSymbolLayer);
143
- }
144
- }
145
- }
146
-
147
- // Make sure our paint options are set properly, in particular raster layer visibility
148
-
149
- this.setPaint(this.__layerOptions);
150
- }
151
-
152
- __addStyleLayer(styleClass, sourceLayer=FEATURES_LAYER, path2dLayer=false)
153
- //========================================================================
154
- {
155
- const styleLayer = new styleClass(`${this.__id}_${sourceLayer}`,
156
- this.vectorSourceId(sourceLayer))
157
- this.addLayer(styleLayer, this.__layerOptions)
158
- if (path2dLayer) {
159
- this.#pathLayers.push(styleLayer)
160
- }
161
- }
162
-
163
- __addPathwayStyleLayers()
164
- //=======================
165
- {
166
- const pathwaysVectorSource = this.vectorSourceId(PATHWAYS_LAYER)
167
- if (this.__map.getSource('vector-tiles')
168
- .vectorLayerIds
169
- .includes(pathwaysVectorSource)) {
170
- this.__addStyleLayer(style.AnnotatedPathLayer, PATHWAYS_LAYER, true)
171
-
172
- this.__addStyleLayer(style.CentrelineEdgeLayer, PATHWAYS_LAYER)
173
- this.__addStyleLayer(style.CentrelineTrackLayer, PATHWAYS_LAYER)
174
-
175
- this.__addStyleLayer(style.PathLineLayer, PATHWAYS_LAYER, true)
176
- this.__addStyleLayer(style.PathDashlineLayer, PATHWAYS_LAYER, true)
177
-
178
- this.__addStyleLayer(style.NervePolygonBorder, PATHWAYS_LAYER, true)
179
- this.__addStyleLayer(style.NervePolygonFill, PATHWAYS_LAYER, true)
180
- this.__addStyleLayer(style.FeatureNerveLayer, PATHWAYS_LAYER, true)
181
-
182
- this.__addStyleLayer(style.PathHighlightLayer, PATHWAYS_LAYER, true)
183
- this.__addStyleLayer(style.PathDashHighlightLayer, PATHWAYS_LAYER, true)
184
- }
185
- }
186
-
187
- setFlatPathMode(visible)
188
- //======================
189
- {
190
- for (const layer of this.#pathLayers) {
191
- this.map.setLayoutProperty(layer.id, 'visibility', visible ? 'visible' : 'none')
192
- }
193
- }
194
-
195
- setPaint(options)
196
- //===============
197
- {
198
- for (const layer of this.__layers) {
199
- const paintStyle = layer.paintStyle(options, true);
200
- for (const [property, value] of Object.entries(paintStyle)) {
201
- this.__map.setPaintProperty(layer.id, property, value, {validate: false});
202
- }
203
- }
204
- }
205
-
206
- setFilter(options)
207
- //================
208
- {
209
- for (const layer of this.__layers) {
210
- const filter = layer.makeFilter(options);
211
- if (filter !== null) {
212
- this.__map.setFilter(layer.id, filter, {validate: true});
213
- }
214
- }
215
- }
216
- }
217
-
218
- //==============================================================================
219
-
220
- class MapRasterLayers extends MapStylingLayers
221
- {
222
- constructor(flatmap, options, bodyLayerId=null)
223
- {
224
- const rasterLayer = {
225
- id: RASTER_LAYERS_ID,
226
- description: RASTER_LAYERS_NAME
227
- };
228
- super(flatmap, rasterLayer, options);
229
- if (bodyLayerId !== null) {
230
- const layerId = `${bodyLayerId}_${FEATURES_LAYER}`;
231
- const source = flatmap.options.separateLayers ? layerId : FEATURES_LAYER;
232
- const styleLayer = new style.BodyLayer(layerId, source);
233
- this.__map.addLayer(styleLayer.style(this.__layerOptions));
234
- this.__layers.push(styleLayer);
235
- }
236
- // Make sure our paint options are set properly, in particular raster layer visibility
237
- this.setPaint(this.__layerOptions);
238
- }
239
-
240
- addLayer(layer)
241
- //=============
242
- {
243
- for (const layer_id of layer['image-layers']) {
244
- const rasterLayer = new style.RasterLayer(layer_id);
245
- this.__map.addLayer(rasterLayer.style(this.__layerOptions));
246
- this.__layers.push(rasterLayer);
247
- }
248
- // Make sure our paint options are set properly, in particular raster layer visibility
249
- this.setPaint(this.__layerOptions);
250
- }
251
-
252
- setPaint(options)
253
- //===============
254
- {
255
- const coloured = !('colour' in options) || options.colour;
256
- for (const layer of this.__layers) {
257
- // Check active status when resetting to visible....
258
- this.__map.setLayoutProperty(layer.id, 'visibility',
259
- (coloured && this.active) ? 'visible' : 'none',
260
- {validate: false});
261
- }
262
- }
263
- }
264
-
265
- //==============================================================================
266
-
267
- export class LayerManager
268
- {
269
- #featureLayers = new Map()
270
- #markerLayer = null
271
- #flightPathLayer = null
272
- #rasterLayer = null
273
-
274
- constructor(flatmap, ui)
275
- {
276
- this.__flatmap = flatmap;
277
- this.__map = flatmap.map;
278
- this.__layerOptions = utils.setDefaults(flatmap.options.layerOptions, {
279
- colour: true,
280
- outline: true,
281
- sckan: 'valid'
282
- });
283
- const backgroundLayer = new style.BackgroundLayer();
284
- if ('background' in flatmap.options) {
285
- this.__map.addLayer(backgroundLayer.style(flatmap.options.background));
286
- } else {
287
- this.__map.addLayer(backgroundLayer.style('white'));
288
- }
289
-
290
- // Add the map's layers
291
- if (flatmap.details['image-layers']) {
292
- this.__layerOptions.activeRasterLayer = true;
293
-
294
- // Image layers are below all feature layers
295
- const bodyLayer = flatmap.layers[0];
296
- this.#rasterLayer = new MapRasterLayers(this.__flatmap,
297
- this.__layerOptions,
298
- bodyLayer.id); // body layer if not FC??
299
- for (const layer of flatmap.layers) {
300
- this.#rasterLayer.addLayer(layer);
301
- }
302
- } else {
303
- this.__layerOptions.activeRasterLayer = false;
304
- }
305
- for (const layer of flatmap.layers) {
306
- this.#featureLayers.set(layer.id, new MapFeatureLayers(this.__flatmap,
307
- layer,
308
- this.__layerOptions));
309
- }
310
-
311
- // Support flight path view
312
- this.#flightPathLayer = new FlightPathLayer(flatmap, ui)
313
-
314
- // Show clustered markers in a layer
315
- this.#markerLayer = new ClusteredMarkerLayer(flatmap, ui)
316
- }
317
-
318
- get layers()
319
- //==========
320
- {
321
- const layers = []
322
- if (this.#rasterLayer) {
323
- layers.push({
324
- id: this.#rasterLayer.id,
325
- description: this.#rasterLayer.description,
326
- enabled: this.#rasterLayer.active
327
- })
328
- }
329
- for (const mapLayer of this.#featureLayers.values()) {
330
- layers.push({
331
- id: mapLayer.id,
332
- description: mapLayer.description,
333
- enabled: mapLayer.active
334
- });
335
- }
336
- return layers;
337
- }
338
-
339
- get sckanState()
340
- //==============
341
- {
342
- return this.__layerOptions.sckan;
343
- }
344
-
345
- activate(layerId, enable=true)
346
- //============================
347
- {
348
- if (layerId === RASTER_LAYERS_ID) {
349
- if (this.#rasterLayer) {
350
- this.#rasterLayer.activate(enable)
351
- this.__layerOptions.activeRasterLayer = enable
352
- for (const mapLayer of this.#featureLayers.values()) {
353
- mapLayer.setPaint(this.__layerOptions)
354
- }
355
- }
356
- } else {
357
- const layer = this.#featureLayers.get(layerId)
358
- if (layer) {
359
- layer.activate(enable)
360
- }
361
- }
362
- }
363
-
364
- addMarker(id, position, properties={})
365
- //====================================
366
- {
367
- this.#markerLayer.addMarker(id, position, properties)
368
- }
369
-
370
- clearMarkers()
371
- //============
372
- {
373
- this.#markerLayer.clearMarkers()
374
- }
375
-
376
- featuresAtPoint(point)
377
- //====================
378
- {
379
- let features = []
380
- if (this.#flightPathLayer) {
381
- features = this.#flightPathLayer.queryFeaturesAtPoint(point)
382
- }
383
- if (features.length === 0) {
384
- features = this.__map.queryRenderedFeatures(point)
385
- }
386
- return features
387
- }
388
-
389
- removeFeatureState(feature, key)
390
- //==============================
391
- {
392
- if (this.#flightPathLayer) {
393
- this.#flightPathLayer.removeFeatureState(feature.id, key)
394
- }
395
- }
396
-
397
- setFeatureState(feature, state)
398
- //=============================
399
- {
400
- if (this.#flightPathLayer) {
401
- this.#flightPathLayer.setFeatureState(feature.id, state)
402
- }
403
- }
404
-
405
- setPaint(options={})
406
- //==================
407
- {
408
- this.__layerOptions = utils.setDefaults(options, this.__layerOptions)
409
- if (this.#rasterLayer) {
410
- this.#rasterLayer.setPaint(this.__layerOptions)
411
- }
412
- for (const mapLayer of this.#featureLayers.values()) {
413
- mapLayer.setPaint(this.__layerOptions)
414
- }
415
- if (this.#flightPathLayer) {
416
- this.#flightPathLayer.setPaint(options)
417
- }
418
- }
419
-
420
- setFilter(options={})
421
- //===================
422
- {
423
- this.__layerOptions = utils.setDefaults(options, this.__layerOptions);
424
- for (const mapLayer of this.#featureLayers.values()) {
425
- mapLayer.setFilter(this.__layerOptions);
426
- }
427
- if (this.#flightPathLayer) {
428
- const sckanState = options.sckan || 'valid'
429
- const sckanFilter = (sckanState == 'none') ? {NOT: {HAS: 'sckan'}} :
430
- (sckanState == 'valid') ? {sckan: true} :
431
- (sckanState == 'invalid') ? {NOT: {sckan: true}} :
432
- true
433
- const featureFilter = new PropertiesFilter(sckanFilter)
434
- if ('taxons' in options) {
435
- featureFilter.narrow({taxons: options.taxons})
436
- }
437
- this.#flightPathLayer.setFilter(featureFilter)
438
- }
439
- }
440
-
441
- setFlightPathMode(enable=true)
442
- //============================
443
- {
444
- if (this.#flightPathLayer) {
445
- this.#flightPathLayer.enable(enable)
446
- for (const mapLayer of this.#featureLayers.values()) {
447
- mapLayer.setFlatPathMode(!enable)
448
- }
449
- }
450
- }
451
-
452
- enableSckanPaths(sckanState, enable=true)
453
- //=======================================
454
- {
455
- const currentState = this.__layerOptions.sckan;
456
- const validEnabled = ['valid', 'all'].includes(currentState);
457
- const invalidEnabled = ['invalid', 'all'].includes(currentState);
458
- let newState = sckanState.toLowerCase();
459
- if (newState === 'valid') {
460
- if (enable && !validEnabled) {
461
- newState = invalidEnabled ? 'all' : 'valid';
462
- } else if (!enable && validEnabled) {
463
- newState = invalidEnabled ? 'invalid' : 'none';
464
- }
465
- } else if (newState === 'invalid') {
466
- if (enable && !invalidEnabled) {
467
- newState = validEnabled ? 'all' : 'invalid';
468
- } else if (!enable && invalidEnabled) {
469
- newState = validEnabled ? 'valid' : 'none';
470
- }
471
- }
472
- if (newState !== this.__layerOptions.sckan) {
473
- this.setFilter({sckan: newState});
474
- }
475
- }
476
- }
477
-
478
- //==============================================================================