|
1 | | -import { map, mapProperties } from 'maplibre/map' |
2 | | -import { resetControls } from 'maplibre/controls/shared' |
3 | | -import { highlightFeature } from 'maplibre/feature' |
4 | | -import * as functions from 'helpers/functions' |
5 | | -import { status } from 'helpers/status' |
6 | | -import { length } from "@turf/length" |
7 | | -import { point } from "@turf/helpers" |
8 | | -import distance from "@turf/distance" |
9 | 1 | import { along } from "@turf/along" |
10 | 2 | import { centroid } from "@turf/centroid" |
11 | | -import { getFeatureSource } from 'maplibre/layers/layers' |
| 3 | +import distance from "@turf/distance" |
| 4 | +import { point } from "@turf/helpers" |
| 5 | +import { length } from "@turf/length" |
| 6 | +import * as functions from 'helpers/functions' |
| 7 | +import { status } from 'helpers/status' |
| 8 | +import { resetControls } from 'maplibre/controls/shared' |
| 9 | +import { highlightFeature } from 'maplibre/feature' |
12 | 10 | import { renderGeoJSONLayers } from 'maplibre/layers/geojson' |
| 11 | +import { getFeatureSource } from 'maplibre/layers/layers' |
| 12 | +import { map, mapProperties } from 'maplibre/map' |
13 | 13 |
|
14 | 14 | export class AnimationManager { |
15 | 15 | constructor () { |
@@ -76,7 +76,7 @@ export class AnimatePointAnimation extends AnimationManager { |
76 | 76 |
|
77 | 77 | export class AnimateLineAnimation extends AnimationManager { |
78 | 78 | run = (line, follow = true, steps=750) => { |
79 | | - |
| 79 | + |
80 | 80 | const lineLength = length(line, { units: "kilometers" }) |
81 | 81 | const stepLength = lineLength / (steps - 1) |
82 | 82 | console.log('Line length: ' + lineLength + ' km, step length: ' + stepLength + ' km') |
@@ -162,7 +162,9 @@ export function flyToFeature(feature) { |
162 | 162 | console.log('Fly to: ' + feature.id + ' ' + center.geometry.coordinates) |
163 | 163 | resetControls() |
164 | 164 | map.once('moveend', function () { |
165 | | - highlightFeature(feature, true, source) |
| 165 | + if (feature.properties?.onclick !== false) { |
| 166 | + highlightFeature(feature, true, source) |
| 167 | + } |
166 | 168 | }) |
167 | 169 | map.flyTo({ |
168 | 170 | center: center.geometry.coordinates, |
|
0 commit comments