diff --git a/package-lock.json b/package-lock.json index 8e8f7c41..f49c1f8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,13 +24,13 @@ "apache-arrow": "^17.0.0", "hnswlib-node": "^3.0.0", "langchain": "^0.3.0", - "maplibre-gl": "^4.7.1", + "maplibre-gl": "^5.0.0", "next": "14.2.22", "osmtogeojson": "^3.0.0-beta.5", "pmtiles": "^4.0.0", "react": "18.3.1", "react-dom": "18.3.1", - "react-map-gl": "^7.1.7", + "react-map-gl": "^7.1.8", "react-particles": "^2.12.2", "recharts": "^2.8.0", "sass": "^1.69.6", @@ -4522,16 +4522,16 @@ } }, "node_modules/@maplibre/maplibre-gl-style-spec": { - "version": "20.4.0", - "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-20.4.0.tgz", - "integrity": "sha512-AzBy3095fTFPjDjmWpR2w6HVRAZJ6hQZUCwk5Plz6EyfnfuQW1odeW5i2Ai47Y6TBA2hQnC+azscjBSALpaWgw==", + "version": "22.0.1", + "resolved": "https://registry.npmjs.org/@maplibre/maplibre-gl-style-spec/-/maplibre-gl-style-spec-22.0.1.tgz", + "integrity": "sha512-V7bSw7Ui6+NhpeeuYqGoqamvKuy+3+uCvQ/t4ZJkwN8cx527CAlQQQ2kp+w5R9q+Tw6bUAH+fsq+mPEkicgT8g==", "license": "ISC", "dependencies": { "@mapbox/jsonlint-lines-primitives": "~2.0.2", "@mapbox/unitbezier": "^0.0.1", "json-stringify-pretty-compact": "^4.0.0", "minimist": "^1.2.8", - "quickselect": "^2.0.0", + "quickselect": "^3.0.0", "rw": "^1.3.3", "tinyqueue": "^3.0.0" }, @@ -4541,6 +4541,12 @@ "gl-style-validate": "dist/gl-style-validate.mjs" } }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/quickselect": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", + "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==", + "license": "ISC" + }, "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/tinyqueue": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", @@ -7523,9 +7529,10 @@ "license": "MIT" }, "node_modules/@types/geojson": { - "version": "7946.0.14", - "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", - "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" + "version": "7946.0.15", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.15.tgz", + "integrity": "sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA==", + "license": "MIT" }, "node_modules/@types/geojson-vt": { "version": "3.2.5", @@ -14258,9 +14265,9 @@ } }, "node_modules/maplibre-gl": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.7.1.tgz", - "integrity": "sha512-lgL7XpIwsgICiL82ITplfS7IGwrB1OJIw/pCvprDp2dhmSSEBgmPzYRvwYYYvJGJD7fxUv1Tvpih4nZ6VrLuaA==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-5.0.0.tgz", + "integrity": "sha512-WG8IYFK2gfJYXvWjlqg1yavo/YO/JlNkblAJMt19sjIafP5oJzTgXFiOLUIYkjtrv5pKiAWuSYsx4CD3ithJqw==", "license": "BSD-3-Clause", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", @@ -14270,14 +14277,14 @@ "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^20.3.1", - "@types/geojson": "^7946.0.14", + "@maplibre/maplibre-gl-style-spec": "^22.0.1", + "@types/geojson": "^7946.0.15", "@types/geojson-vt": "3.2.5", "@types/mapbox__point-geometry": "^0.1.4", "@types/mapbox__vector-tile": "^1.3.4", "@types/pbf": "^3.0.5", "@types/supercluster": "^7.1.3", - "earcut": "^3.0.0", + "earcut": "^3.0.1", "geojson-vt": "^4.0.2", "gl-matrix": "^3.4.3", "global-prefix": "^4.0.0", diff --git a/package.json b/package.json index 82dad464..1b40dc65 100644 --- a/package.json +++ b/package.json @@ -39,13 +39,13 @@ "apache-arrow": "^17.0.0", "hnswlib-node": "^3.0.0", "langchain": "^0.3.0", - "maplibre-gl": "^4.7.1", + "maplibre-gl": "^5.0.0", "next": "14.2.22", "osmtogeojson": "^3.0.0-beta.5", "pmtiles": "^4.0.0", "react": "18.3.1", "react-dom": "18.3.1", - "react-map-gl": "^7.1.7", + "react-map-gl": "^7.1.8", "react-particles": "^2.12.2", "recharts": "^2.8.0", "sass": "^1.69.6", diff --git a/src/app/agent/[id]/page.tsx b/src/app/agent/[id]/page.tsx index 3e815ef6..05137b2b 100644 --- a/src/app/agent/[id]/page.tsx +++ b/src/app/agent/[id]/page.tsx @@ -14,7 +14,7 @@ import osmtogeojson from "osmtogeojson"; import { getOverpassResponseJsonWithCache } from "@/lib/osm/getOverpass"; import { BaseMap } from "@/components/BaseMap"; import { GeoJsonToSourceLayer } from "@/components/GeoJsonToSourceLayer"; -import { usePathname, useRouter } from "next/navigation"; +import { usePathname } from "next/navigation"; import Link from "next/link"; const formatDate = (date: Date) => { diff --git a/src/components/BaseMap/index.tsx b/src/components/BaseMap/index.tsx index f0ea4d21..2ea2e433 100644 --- a/src/components/BaseMap/index.tsx +++ b/src/components/BaseMap/index.tsx @@ -6,10 +6,10 @@ import { GeolocateResultEvent, Map, MapRef, + MapStyle, NavigationControl, ViewStateChangeEvent, } from "react-map-gl/maplibre"; -import maplibregl from "maplibre-gl"; import "maplibre-gl/dist/maplibre-gl.css"; export const BaseMap: React.FC<{ @@ -19,7 +19,7 @@ export const BaseMap: React.FC<{ latitude: number; zoom: number; children?: any; - style?: string | maplibregl.StyleSpecification; + style?: string | MapStyle; onMapLoad?: () => void; onMapMove?: () => void; onMapMoveEnd?: (e: ViewStateChangeEvent) => void; @@ -74,7 +74,6 @@ export const BaseMap: React.FC<{ onLoad={onLoad} onMove={onMove} onMoveEnd={onMoveEnd} - mapLib={maplibregl} mapStyle={style} attributionControl={false} initialViewState={{ diff --git a/src/components/StaticMap/index.tsx b/src/components/StaticMap/index.tsx index 3d3fa102..c53763d6 100644 --- a/src/components/StaticMap/index.tsx +++ b/src/components/StaticMap/index.tsx @@ -1,4 +1,4 @@ -import { MapProvider, MapRef } from "react-map-gl/maplibre"; +import { MapProvider, MapRef, MapStyle } from "react-map-gl/maplibre"; import { BaseMap } from "../BaseMap"; import { useEffect, useRef } from "react"; import { TridentMapsStyle } from "@/types/TridentMaps"; @@ -7,7 +7,7 @@ import * as turf from "@turf/turf"; import { GeoJsonToSourceLayer } from "../GeoJsonToSourceLayer"; export const StaticMap: React.FC<{ - style: string | maplibregl.StyleSpecification; + style: string | MapStyle; geojsonWithStyleList?: Array<{ id: string; style: TridentMapsStyle; diff --git a/src/components/StaticRegionsMap/index.tsx b/src/components/StaticRegionsMap/index.tsx index 6ef6be8f..41641cb8 100644 --- a/src/components/StaticRegionsMap/index.tsx +++ b/src/components/StaticRegionsMap/index.tsx @@ -1,7 +1,6 @@ import { FeatureCollection } from "geojson"; -import * as turf from "@turf/turf"; -import { GeoJsonToSourceLayer } from "../GeoJsonToSourceLayer"; -import { useEffect, useRef, useState } from "react"; +import { MapStyle } from "react-map-gl/maplibre"; +import { useEffect, useState } from "react"; import { TridentMapsStyle } from "@/types/TridentMaps"; import { StaticMap } from "../StaticMap"; import { getNominatimResponseJsonWithCache } from "@/lib/osm/getNominatim"; @@ -9,7 +8,7 @@ import { getOverpassResponseJsonWithCache } from "@/lib/osm/getOverpass"; import osmtogeojson from "osmtogeojson"; export const StaticRegionsMap: React.FC<{ - mapStyle: string | maplibregl.StyleSpecification; + mapStyle: string | MapStyle; mapPadding?: number; regionNames: string[]; }> = ({