Don't use useGeographic anymore since it doesn't work with clusters.

This commit is contained in:
vdv committed 2023-01-20 21:11:18 +01:00
1 parent 6e796f88c7
commit 9ade878deb
6 files changed
+69 -51

No files matched your search

+10 -7
View File
@@ -7,6 +7,7 @@ import {
createCachedSignal,
destroyCachedSignal,
} from '../../workers/cached-signals';
import { fromLonLat } from 'ol/proj';
interface Props {
trksegId: string;
@@ -56,7 +57,10 @@ export const Trkseg: Component<Props> = ({
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [trkseg().trkpt[0].$.lon, trkseg().trkpt[0].$.lat],
coordinates: fromLonLat([
trkseg().trkpt[0].$.lon,
trkseg().trkpt[0].$.lat,
]),
},
properties: {
type: 'trkseg-start',
@@ -69,10 +73,9 @@ export const Trkseg: Component<Props> = ({
type: 'Feature',
geometry: {
type: 'LineString',
coordinates: trkseg().trkpt.map((trkpt: any) => [
trkpt.$.lon,
trkpt.$.lat,
]),
coordinates: trkseg().trkpt.map((trkpt: any) =>
fromLonLat([trkpt.$.lon, trkpt.$.lat])
),
},
properties: {
type: 'trkseg',
@@ -85,10 +88,10 @@ export const Trkseg: Component<Props> = ({
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [
coordinates: fromLonLat([
trkseg().trkpt.at(-1).$.lon,
trkseg().trkpt.at(-1).$.lat,
],
]),
},
properties: {
type: 'trkseg-finish',