Skip to content

Commit

Permalink
Merge branch 'main' into preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Ribiere committed Dec 15, 2023
2 parents 025252a + 0cbd3b0 commit 04e3bd1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
3 changes: 1 addition & 2 deletions src/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FeatureCollection } from "geojson"
import { BaseMap } from "@/classes/BaseMap"
import { HistogramSlider } from "@/classes/HistogramSlider"
import { GeoJSONSourceRaw } from "mapbox-gl"
import convert from "geo-coordinates-parser"
import { convert } from "geo-coordinates-parser"

const CssClass: {
[key in SwitchType]: { [key: string]: boolean }
Expand Down Expand Up @@ -208,7 +208,6 @@ export const store = {
// eslint-disable-next-line array-callback-return
sheet.values.map(x => {
const rawCoordinates = x[1] + " " + x[2]
// console.log(rawCoordinates)
try {
const coordinates = convert(rawCoordinates)
harbors.features.push({
Expand Down
24 changes: 13 additions & 11 deletions src/utils/arrayToGeojson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ export function opsDataToGeoJSON (rawData: OpsData[]): FeatureCollection {
if (x.videoSrc.length > 0 && typeof (x.videoSrc) !== "string") {
(x as any).videoSrc = x.videoSrc.join()
}
featuresCollection.features.push({
type: "Feature",
properties: { ...x },
geometry: {
coordinates: [
x.longitude,
x.latitude
],
type: "Point"
}
})
if (!isNaN(x.latitude) || !isNaN(x.longitude)) {
featuresCollection.features.push({
type: "Feature",
properties: { ...x },
geometry: {
coordinates: [
x.longitude,
x.latitude
],
type: "Point"
}
})
}
})

return featuresCollection
Expand Down

0 comments on commit 04e3bd1

Please sign in to comment.