{
}}
/>
-
+ {/*
*/}
{place.geojson &&
}
diff --git a/app/types.ts b/app/types.ts
index cb70d7f..b51ea7b 100644
--- a/app/types.ts
+++ b/app/types.ts
@@ -10,6 +10,7 @@ import type {
import type { LabeledIIIFExternalWebResource } from "@samvera/clover-iiif/image";
import type { ImageService } from "@iiif/presentation-3";
import type { SourceSpecification } from "maplibre-gl";
+import { ESPlace } from "./esTypes";
export type Geometry =
| Point
@@ -111,7 +112,7 @@ export type TCoreDataPlace = {
user_defined: TUserDefinedField;
};
-export type TPlaceRecord = TCoreDataPlace & {
+export type TPlaceRecord = {
uuid: string;
name: string;
place_names: TNames[];
@@ -172,6 +173,9 @@ type TCoreDataItem = {
export type TVideoItem = TCoreDataItem & {
embed_id: string;
provider: "Vimeo" | "YouTube";
+ name: string;
+ thumbnail_url: string;
+ embed_url: string;
};
type TThumbnail = {
@@ -243,7 +247,7 @@ export type TIslandConfig = {
export type TIslandServerData = {
island: TIslandConfig;
- place: TPlaceRecord;
+ place: ESPlace;
};
export type TRelatedPlaceRecord = {
diff --git a/app/utils/toFeatureCollection.ts b/app/utils/toFeatureCollection.ts
index b81c7d8..479e563 100644
--- a/app/utils/toFeatureCollection.ts
+++ b/app/utils/toFeatureCollection.ts
@@ -1,10 +1,11 @@
-import { feature, featureCollection } from "@turf/turf";
+import { featureCollection, point } from "@turf/turf";
import { PLACE_TYPES } from "~/config";
import resolveConfig from "tailwindcss/resolveConfig";
import tailwindConfig from "tailwind.config";
-import type { TPlaceGeoJSON, TPlaceRecord, TRelatedPlaceRecord } from "~/types";
+import type { TPlaceGeoJSON } from "~/types";
import type { Hit } from "instantsearch.js";
import type { FeatureCollection } from "geojson";
+import type { ESRelatedPlace } from "~/esTypes";
// TODO: Maybe use Tailwind config to keep things constant.
const DEFAULT_COLOR = "#ea580c";
@@ -19,15 +20,13 @@ const getColor = (type: string) => {
return DEFAULT_COLOR;
};
-export const toFeatureCollection = (
- places: TPlaceRecord[] | TRelatedPlaceRecord[]
-) => {
+export const toFeatureCollection = (places: ESRelatedPlace[]) => {
return featureCollection(
places.map((place) => {
- // @ts-ignore
- const placeFeature = feature(place.place_geometry.geometry_json);
- placeFeature.properties = place;
- placeFeature.properties.hexColor = DEFAULT_COLOR;
+ const placeFeature = point([place.location.lon, place.location.lat], {
+ ...place,
+ hexColor: getColor(place.type),
+ });
return placeFeature;
})
);
diff --git a/package-lock.json b/package-lock.json
index eaada1a..dafd45d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -25,7 +25,7 @@
"save-dev": "^0.0.1-security"
},
"devDependencies": {
- "@allmaps/maplibre": "^1.0.0-beta.25",
+ "@allmaps/maplibre": "^1.0.0-beta.30",
"@iiif/presentation-3": "^2.2.3",
"@remix-run/dev": "^2.9.2",
"@remix-run/eslint-config": "^2.9.2",
diff --git a/package.json b/package.json
index f0641c4..1810814 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,7 @@
"save-dev": "^0.0.1-security"
},
"devDependencies": {
- "@allmaps/maplibre": "^1.0.0-beta.25",
+ "@allmaps/maplibre": "^1.0.0-beta.30",
"@iiif/presentation-3": "^2.2.3",
"@remix-run/dev": "^2.9.2",
"@remix-run/eslint-config": "^2.9.2",