@opengeoweb/core 10.1.0 → 10.2.1-spike-ol.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/README.md +3 -16
  2. package/index.esm.js +1389 -406
  3. package/package.json +7 -2
  4. package/src/lib/components/ConfigurableMapConnect/ConfigurableMapConnect.d.ts +2 -1
  5. package/src/lib/components/FeatureInfo/utils.d.ts +4 -1
  6. package/src/lib/components/MapDrawToolRedux/OpenLayersFeatureLayerConnect.d.ts +13 -0
  7. package/src/lib/components/MapViewConnect/MapViewConnect.d.ts +4 -2
  8. package/src/lib/components/MapViewConnect/OlMapViewConnect.d.ts +16 -0
  9. package/src/lib/components/MapViewConnect/OlMapViewLayerConnect.d.ts +8 -0
  10. package/src/lib/components/MapViewConnect/index.d.ts +1 -0
  11. package/src/lib/components/MapViewConnect/olMapUtils.d.ts +5 -0
  12. package/src/lib/components/MapViewConnect/useGetOpenlayersView.d.ts +9 -0
  13. package/src/lib/components/MultiMapViewConnect/HarmoniePresets/HarmonieTempAndPrecipPreset.spec.d.ts +1 -0
  14. package/src/lib/components/Providers/Providers.d.ts +0 -2
  15. package/src/lib/components/Search/MyMapLocation.d.ts +5 -6
  16. package/src/lib/components/Search/SearchDialog.d.ts +4 -1
  17. package/src/lib/components/Search/{SearchControl.stories.d.ts → SearchDialog.stories.d.ts} +4 -4
  18. package/src/lib/components/Search/SearchDialogConnect.d.ts +5 -0
  19. package/src/lib/components/Search/SearchDialogConnect.spec.d.ts +1 -0
  20. package/src/lib/components/Search/SearchDialogConnect.stories.d.ts +7 -0
  21. package/src/lib/components/Search/index.d.ts +1 -1
  22. package/src/lib/components/Search/types.d.ts +13 -0
  23. package/src/lib/components/Search/utils.d.ts +8 -0
  24. package/src/lib/components/SyncGroups/SimpleTimeSliderConnect.d.ts +2 -2
  25. package/src/lib/components/TimeSliderConnect/TimeSliderConnect.d.ts +1 -1
  26. package/src/lib/components/TimeSliderConnect/TimeSliderLegendConnect.d.ts +4 -0
  27. package/src/lib/utils/location-api/api.d.ts +3 -0
  28. package/src/lib/utils/location-api/fakeApi.d.ts +70 -0
  29. package/src/lib/utils/location-api/hooks.d.ts +4 -0
  30. package/src/lib/components/Search/SearchControlConnect.d.ts +0 -5
  31. /package/src/lib/components/{Search/SearchControlConnect.spec.d.ts → MapViewConnect/olMapUtils.spec.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/core",
3
- "version": "10.1.0",
3
+ "version": "10.2.1-spike-ol.0",
4
4
  "description": "GeoWeb Core library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -19,6 +19,7 @@
19
19
  "axios": "^1.7.7",
20
20
  "@opengeoweb/layer-select": "*",
21
21
  "lodash": "^4.17.21",
22
+ "ol": "^10.4.0",
22
23
  "react-sortablejs": "^6.1.4",
23
24
  "sortablejs": "^1.15.1",
24
25
  "@mui/system": "^6.1.1",
@@ -29,7 +30,11 @@
29
30
  "react-i18next": "^15.1.1",
30
31
  "dompurify": "^3.0.6",
31
32
  "@mui/material": "^6.1.1",
32
- "@sentry/react": "^8.34.0"
33
+ "@sentry/react": "^8.34.0",
34
+ "@opengeoweb/authentication": "*",
35
+ "@tanstack/react-query": "^5.62.7",
36
+ "@opengeoweb/api": "*",
37
+ "msw": "^1.3.3"
33
38
  },
34
39
  "peerDependencies": {
35
40
  "react": "18",
@@ -21,7 +21,7 @@ export interface ConfigurableMapConnectProps {
21
21
  tileServerSettings?: TileServerSettings;
22
22
  autoUpdateLayerId?: string;
23
23
  autoTimeStepLayerId?: string;
24
- bbox?: mapTypes.Bbox;
24
+ initialBbox?: mapTypes.Bbox;
25
25
  srs?: string;
26
26
  dimensions?: mapTypes.Dimension[];
27
27
  animationPayload?: mapTypes.AnimationPayloadType;
@@ -43,5 +43,6 @@ export interface ConfigurableMapConnectProps {
43
43
  children?: React.ReactNode;
44
44
  mapControls?: React.ReactNode;
45
45
  shouldDisablePrefetching?: boolean;
46
+ useOl?: boolean;
46
47
  }
47
48
  export declare const ConfigurableMapConnect: React.FC<ConfigurableMapConnectProps>;
@@ -1,4 +1,6 @@
1
1
  import { layerTypes } from '@opengeoweb/store';
2
+ import { IWMJSMap } from '@opengeoweb/webmap';
3
+ import { MapLocation } from '@opengeoweb/webmap-react';
2
4
  export interface GFIResult {
3
5
  data: string;
4
6
  isLoading: boolean;
@@ -8,10 +10,11 @@ export interface GFILayer {
8
10
  url: string;
9
11
  title: string;
10
12
  }
13
+ export declare const getFeatureInfoUrl: (layer: layerTypes.Layer, wmjsMap: IWMJSMap | undefined, mapPinLocation: MapLocation | null) => string | undefined;
11
14
  /**
12
15
  * Make a list of GFI Layers to display.
13
16
  * @param layers
14
17
  * @param mapId
15
18
  * @returns
16
19
  */
17
- export declare const getLayersToUpdate: (layers: layerTypes.Layer[], mapId: string) => GFILayer[];
20
+ export declare const getLayersToUpdate: (mapPinLocation: MapLocation | null, layers: layerTypes.Layer[], mapId: string) => GFILayer[];
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { layerTypes } from '@opengeoweb/store';
3
+ import { StyleLike } from 'ol/style/Style';
4
+ import { HoverSelect } from '@opengeoweb/webmap-react';
5
+ interface OpenLayersFeatureLayerConnectProps {
6
+ layer: layerTypes.FeatureLayer;
7
+ layerId?: string;
8
+ zIndex: number;
9
+ style: StyleLike;
10
+ hoverSelect?: HoverSelect;
11
+ }
12
+ export declare const OpenLayersFeatureLayerConnect: React.FC<OpenLayersFeatureLayerConnectProps>;
13
+ export {};
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
+ import { Bbox } from '@opengeoweb/webmap';
2
3
  import { MapViewProps } from '@opengeoweb/webmap-react';
3
- export interface MapControls {
4
+ export interface MapControlsProps {
4
5
  mapControlsPositionTop?: number;
5
6
  search?: boolean;
6
7
  zoomControls?: boolean;
@@ -13,11 +14,12 @@ export interface MapControls {
13
14
  export interface MapViewConnectProps extends MapViewProps {
14
15
  mapId: string;
15
16
  displayTimeInMap?: boolean;
16
- controls?: MapControls;
17
+ controls?: MapControlsProps;
17
18
  showScaleBar?: boolean;
18
19
  children?: React.ReactNode;
19
20
  showLayerInfo?: boolean;
20
21
  passiveMap?: boolean;
22
+ initialBbox?: Bbox;
21
23
  }
22
24
  export declare const ORIGIN_REACTMAPVIEWCONNECT_ONMAPCHANGEDIMENSION = "ORIGIN_REACTMAPVIEWCONNECT_ONMAPCHANGEDIMENSION";
23
25
  export declare const ORIGIN_REACTMAPVIEWCONNECT_ONUPDATELAYERINFO = "ORIGIN_REACTMAPVIEWCONNECT_ONUPDATELAYERINFO";
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { MapViewConnectProps } from './MapViewConnect';
3
+ /**
4
+ * Connected component used to display the map and selected layers.
5
+ * Includes options to disable the map controls and legend.
6
+ *
7
+ * Expects the following props:
8
+ * @param {string} mapId mapId: string - Id of the map
9
+ * @param {object} [controls.zoomControls] **optional** controls: object - toggle the map controls, zoomControls defaults to true
10
+ * @param {boolean} [displayTimeInMap] **optional** displayTimeInMap: boolean, toggles the mapTime, defaults to true
11
+ * @param {boolean} [showScaleBar] **optional** showScaleBar: boolean, toggles the scaleBar, defaults to true
12
+ * @example
13
+ * ```<MapViewConnect mapId={mapId} controls={{ zoomControls: false }} displayTimeInMap={false} showScaleBar={false}/>```
14
+ */
15
+ declare const OlMapViewConnect: React.FC<MapViewConnectProps>;
16
+ export default OlMapViewConnect;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface OlMapViewLayerConnectProps {
3
+ layerId: string | undefined;
4
+ mapId: string;
5
+ zIndex: number;
6
+ debugMode: boolean;
7
+ }
8
+ export declare const OlMapViewLayerConnect: (layerProps: OlMapViewLayerConnectProps) => React.ReactElement | null;
@@ -1 +1,2 @@
1
1
  export { default as MapViewConnect } from './MapViewConnect';
2
+ export { default as OlMapViewConnect } from './OlMapViewConnect';
@@ -0,0 +1,5 @@
1
+ import { TimeSliderStartCenterEndTime } from '@opengeoweb/store';
2
+ import { Dimension } from '@opengeoweb/webmap';
3
+ import { OnInitializeLayerProps, TimeContextType, UpdateLayerInfoPayload } from '@opengeoweb/webmap-react';
4
+ export declare const makePrefetchTimeSpan: (timeSliderStartCenterEndTime: TimeSliderStartCenterEndTime, animationStartTime: string | undefined, animationEndTime: string | undefined, isAnimating: boolean) => TimeContextType;
5
+ export declare const makeLayerInfoPayload: (payload: OnInitializeLayerProps, mapDimensions: Dimension[], mapId: string) => UpdateLayerInfoPayload;
@@ -0,0 +1,9 @@
1
+ import { CoreAppStore } from '@opengeoweb/store';
2
+ import { Store } from '@reduxjs/toolkit';
3
+ import { View } from 'ol';
4
+ interface UseGetOpenLayersViewValue {
5
+ view?: View;
6
+ name?: string;
7
+ }
8
+ export declare const useGetOpenlayersView: (mapId: string, store: Store<CoreAppStore>) => UseGetOpenLayersViewValue;
9
+ export {};
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { Theme } from '@mui/material';
3
- import { ThemeProviderProps } from '@opengeoweb/theme';
4
3
  import { Store } from '@reduxjs/toolkit';
5
4
  interface CoreThemeProviderProps {
6
5
  children?: React.ReactNode;
@@ -15,7 +14,6 @@ interface CoreTranslationWrapperProps {
15
14
  * @returns
16
15
  */
17
16
  export declare const CoreThemeProvider: React.FC<CoreThemeProviderProps>;
18
- export declare const ThemeWrapperWithModules: React.FC<ThemeProviderProps>;
19
17
  interface CoreThemeStoreProviderProps extends CoreThemeProviderProps {
20
18
  store: Store;
21
19
  }
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
+ import { LocationDetail } from './types';
2
3
  export interface MyMapLocationProps {
3
- mapId: string | undefined;
4
- isLoading: boolean;
5
- hasFailed: boolean;
6
- setIsLoading: (value: boolean) => void;
7
- setHasFailed: (value: boolean) => void;
4
+ mapId?: string;
5
+ isSelected?: boolean;
6
+ onUpdateMyLocation?: (location?: LocationDetail) => void;
8
7
  }
9
- export declare const MY_LOCATION = "MyLocation";
8
+ export declare const MY_LOCATION = "My location";
10
9
  export declare const MyMapLocation: React.FC<MyMapLocationProps>;
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
+ import { LocationDetail } from './types';
2
3
  export interface SearchDialogProps {
3
4
  isOpen: boolean;
4
- onClose: () => void;
5
5
  mapId?: string;
6
+ onSelectLocation?: (location?: LocationDetail) => void;
7
+ onUpdateMyLocation?: (location?: LocationDetail) => void;
8
+ isMyLocationSelected?: boolean;
6
9
  }
7
10
  export declare const SearchDialog: React.FC<SearchDialogProps>;
@@ -3,11 +3,11 @@ declare const _default: {
3
3
  title: string;
4
4
  };
5
5
  export default _default;
6
- export declare const SearchControlConnectStoryLight: {
6
+ export declare const SearchDialogLight: {
7
7
  (): React.ReactElement;
8
- storyName: string;
8
+ tags: string[];
9
9
  };
10
- export declare const SearchControlConnectStoryDark: {
10
+ export declare const SearchDialogDark: {
11
11
  (): React.ReactElement;
12
- storyName: string;
12
+ tags: string[];
13
13
  };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export interface SearchDialogConnectProps {
3
+ mapId?: string;
4
+ }
5
+ export declare const SearchDialogConnect: React.FC<SearchDialogConnectProps>;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const SearchDialogConnectLight: () => React.ReactElement;
7
+ export declare const SearchDialogConnectDark: () => React.ReactElement;
@@ -1,4 +1,4 @@
1
1
  export { SearchControlButtonConnect } from './SearchControlButtonConnect';
2
- export { SearchControlConnect } from './SearchControlConnect';
2
+ export { SearchDialogConnect } from './SearchDialogConnect';
3
3
  export { SearchDialog } from './SearchDialog';
4
4
  export { MyMapLocation } from './MyMapLocation';
@@ -0,0 +1,13 @@
1
+ export interface LocationDetail {
2
+ id: string;
3
+ name: string;
4
+ source: string;
5
+ lat: number;
6
+ lon: number;
7
+ geometry?: GeoJSON.Feature;
8
+ }
9
+ export interface LocationListResult {
10
+ id: string;
11
+ name: string;
12
+ source: string;
13
+ }
@@ -0,0 +1,8 @@
1
+ import { MapDrawDrawFunctionArgs } from '@opengeoweb/webmap-react';
2
+ import { GeoJsonProperties } from 'geojson';
3
+ import { LocationDetail } from './types';
4
+ export declare const myLocationDrawFunction: (args: MapDrawDrawFunctionArgs) => void;
5
+ export declare const selectedLocationDrawFunction: (args: MapDrawDrawFunctionArgs) => void;
6
+ export declare const geometryStyling: GeoJsonProperties;
7
+ export declare const hoverDrawFunction: (args: MapDrawDrawFunctionArgs) => void;
8
+ export declare const useDrawOnMap: (mapId: string, drawFunction: (args: MapDrawDrawFunctionArgs) => void) => [(location?: LocationDetail) => void];
@@ -11,8 +11,8 @@ export declare const SimpleTimeSliderConnect: import("react-redux").ConnectedCom
11
11
  id: string;
12
12
  timeValue?: string | null | undefined;
13
13
  setTime?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/generic/types").SetTimePayload, string> | undefined;
14
- syncGroupAddSource?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/generic/synchronizationGroups/types").SyncGroupsAddSourcePayload, "synchronizationGroupsReducer/syncGroupAddSource"> | undefined;
15
- syncGroupRemoveSource?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/generic/synchronizationGroups/types").SyncGroupRemoveSourcePayload, "synchronizationGroupsReducer/syncGroupRemoveSource"> | undefined;
14
+ syncGroupAddSource?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/generic/syncGroups/types").SyncGroupsAddSourcePayload, "synchronizationGroupsReducer/syncGroupAddSource"> | undefined;
15
+ syncGroupRemoveSource?: import("@reduxjs/toolkit").ActionCreatorWithPayload<import("dist/libs/store/src/store/generic/syncGroups/types").SyncGroupRemoveSourcePayload, "synchronizationGroupsReducer/syncGroupRemoveSource"> | undefined;
16
16
  context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").AnyAction>> | undefined;
17
17
  store?: import("redux").Store<any, import("redux").AnyAction> | undefined;
18
18
  }>;
@@ -5,7 +5,7 @@ interface TimeSliderConnectProps {
5
5
  sourceId: string;
6
6
  mapId: string;
7
7
  isAlwaysVisible?: boolean;
8
- mapWindowRef?: React.MutableRefObject<null>;
8
+ mapWindowRef?: React.MutableRefObject<HTMLElement | null>;
9
9
  }
10
10
  export declare const TimeSliderConnect: React.FC<TimeSliderConnectProps>;
11
11
  export {};
@@ -5,6 +5,10 @@ interface TimeSliderLegendConnectProps {
5
5
  unfilteredSelectedTime: number;
6
6
  setUnfilteredSelectedTime: (unfilteredSelectedTime: number) => void;
7
7
  mapWindowRef?: React.MutableRefObject<HTMLElement | null>;
8
+ adjustSelectedTimeOnWheel?: ({ event, deltaY, }: {
9
+ event: WheelEvent | KeyboardEvent;
10
+ deltaY: number;
11
+ }) => void;
8
12
  }
9
13
  export declare const TimeSliderLegendConnect: React.FC<TimeSliderLegendConnectProps>;
10
14
  export {};
@@ -0,0 +1,3 @@
1
+ import { LocationListResult, LocationDetail } from '../../components/Search/types';
2
+ export declare const getLocationList: (search: string) => Promise<LocationListResult[]>;
3
+ export declare const getLocationDetail: (id: string, source: string) => Promise<LocationDetail>;
@@ -0,0 +1,70 @@
1
+ export declare const fakeLocationList: {
2
+ id: string;
3
+ name: string;
4
+ source: string;
5
+ }[];
6
+ export declare const fakeLocationDetailList: ({
7
+ id: string;
8
+ name: string;
9
+ source: string;
10
+ lon: number;
11
+ lat: number;
12
+ geometry?: undefined;
13
+ } | {
14
+ lat: number;
15
+ lon: number;
16
+ source: string;
17
+ id: string;
18
+ name: string;
19
+ geometry: {
20
+ type: string;
21
+ geometry: {
22
+ type: string;
23
+ coordinates: number[];
24
+ };
25
+ properties?: undefined;
26
+ };
27
+ } | {
28
+ id: string;
29
+ name: string;
30
+ source: string;
31
+ lat: number;
32
+ lon: number;
33
+ geometry: {
34
+ type: string;
35
+ properties: {};
36
+ geometry: {
37
+ type: string;
38
+ coordinates: number[][];
39
+ };
40
+ };
41
+ } | {
42
+ id: string;
43
+ name: string;
44
+ source: string;
45
+ lat: number;
46
+ lon: number;
47
+ geometry: {
48
+ type: string;
49
+ geometry: {
50
+ type: string;
51
+ coordinates: number[][][];
52
+ };
53
+ properties: {};
54
+ };
55
+ } | {
56
+ id: string;
57
+ name: string;
58
+ source: string;
59
+ lat: number;
60
+ lon: number;
61
+ geometry: {
62
+ type: string;
63
+ geometry: {
64
+ type: string;
65
+ coordinates: number[][][][];
66
+ };
67
+ properties: {};
68
+ };
69
+ })[];
70
+ export declare const locationApiEndpoints: import("msw").RestHandler<import("msw").MockedRequest<import("msw").DefaultBodyType>>[];
@@ -0,0 +1,4 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import { LocationDetail, LocationListResult } from '../../components/Search/types';
3
+ export declare const useLocationList: (search: string) => UseQueryResult<LocationListResult[]>;
4
+ export declare const useLocationDetail: (id?: string, source?: string) => UseQueryResult<LocationDetail>;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export interface SearchControlConnectProps {
3
- mapId?: string;
4
- }
5
- export declare const SearchControlConnect: React.FC<SearchControlConnectProps>;