|
1 | | -import { useContext } from "react"; |
2 | | -import { useDispatch } from "react-redux"; |
3 | | -import type { UnknownAction } from "redux"; |
4 | | -import L from "leaflet"; |
5 | | -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; |
6 | | -import { faSearch } from "@fortawesome/free-solid-svg-icons"; |
7 | | - |
8 | | -import { ResponsiveTopicMapContext } from "react-cismap/contexts/ResponsiveTopicMapContextProvider"; |
9 | | -import { TopicMapContext } from "react-cismap/contexts/TopicMapContextProvider"; |
10 | | - |
11 | | -import { ManagedProjections } from "@carma/geo/proj"; |
12 | | -import { ENDPOINTS, isAreaType } from "@carma/resources"; |
13 | | -import type { SearchResultItem } from "@carma/types"; |
14 | 1 | import { |
15 | 2 | SelectionMetaData, |
16 | 3 | useSelection, |
17 | 4 | useSelectionTopicMap, |
18 | 5 | } from "@carma-appframeworks/portals"; |
19 | | - |
20 | | -import { getBoundingBoxForLeafletMap } from "@carma-mapping/engines/leaflet"; |
21 | 6 | import { LibFuzzySearch } from "@carma-mapping/fuzzy-search"; |
| 7 | +import { type SearchResultItem } from "@carma/types"; |
22 | 8 |
|
| 9 | +import { ResponsiveTopicMapContext } from "react-cismap/contexts/ResponsiveTopicMapContextProvider"; |
| 10 | +import { useContext } from "react"; |
| 11 | +import { ENDPOINT, isAreaType } from "@carma-commons/resources"; |
| 12 | +import { useDispatch } from "react-redux"; |
23 | 13 | import { |
24 | 14 | getPlanFeatureByTitle, |
25 | 15 | getPlanFeatures, |
26 | 16 | } from "../../store/slices/bplaene"; |
27 | | - |
| 17 | +import { TopicMapContext } from "react-cismap/contexts/TopicMapContextProvider"; |
| 18 | +import L from "leaflet"; |
| 19 | +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; |
| 20 | +import { faSearch } from "@fortawesome/free-solid-svg-icons"; |
| 21 | +import type { UnknownAction } from "redux"; |
| 22 | +import { getBoundingBoxForLeafletMap } from "@carma-mapping/utils"; |
| 23 | +import proj4 from "proj4"; |
28 | 24 | interface FuzzySearchProps { |
29 | 25 | setFeatures: (hit) => void; |
30 | 26 | setSelectedIndex: (idx) => void; |
@@ -55,7 +51,7 @@ const FuzzySearchWrapper = ({ |
55 | 51 | const selectionMetaData: SelectionMetaData = { |
56 | 52 | selectedFrom: "gazetteer", |
57 | 53 | selectionTimestamp: Date.now(), |
58 | | - isAreaSelection: isAreaType(selection.type), |
| 54 | + isAreaSelection: isAreaType(selection.type as ENDPOINT), |
59 | 55 | }; |
60 | 56 | setSelection(Object.assign({}, selection, selectionMetaData)); |
61 | 57 |
|
@@ -90,7 +86,7 @@ const FuzzySearchWrapper = ({ |
90 | 86 | ) { |
91 | 87 | const boundingBox = getBoundingBoxForLeafletMap( |
92 | 88 | routedMapRef?.leafletMap, |
93 | | - ManagedProjections.EPSG25832 |
| 89 | + proj4.defs("EPSG:25832") |
94 | 90 | ); |
95 | 91 | dispatch( |
96 | 92 | getPlanFeatures({ |
|
0 commit comments