@open-pioneer/overview-map 0.4.4 → 0.7.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.
- package/CHANGELOG.md +30 -0
- package/OverviewMap.d.ts +3 -6
- package/OverviewMap.js +5 -5
- package/OverviewMap.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @open-pioneer/overview-map
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 310800c: Switch from `peerDependencies` to normal `dependencies`. Peer dependencies have some usability problems when used at scale.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 310800c: Update core packages version.
|
|
12
|
+
- 583f1d6: The `mapId` or `map` properties are now optional on individual components.
|
|
13
|
+
You can use the `DefaultMapProvider` to configure an implicit default value.
|
|
14
|
+
|
|
15
|
+
Note that configuring _neither_ a default _nor_ an explicit `map` or `mapId` will trigger a runtime error.
|
|
16
|
+
|
|
17
|
+
- 583f1d6: All UI components in this project now accept the `mapId` (a `string`) _or_ the `map` (a `MapModel`) directly.
|
|
18
|
+
- a8b3449: Switch to a new versioning strategy.
|
|
19
|
+
From now on, packages released by this repository share a common version number.
|
|
20
|
+
- 900eb11: Update dependencies.
|
|
21
|
+
- Updated dependencies [310800c]
|
|
22
|
+
- Updated dependencies [2502050]
|
|
23
|
+
- Updated dependencies [583f1d6]
|
|
24
|
+
- Updated dependencies [583f1d6]
|
|
25
|
+
- Updated dependencies [397d617]
|
|
26
|
+
- Updated dependencies [a8b3449]
|
|
27
|
+
- Updated dependencies [310800c]
|
|
28
|
+
- Updated dependencies [900eb11]
|
|
29
|
+
- Updated dependencies [583f1d6]
|
|
30
|
+
- Updated dependencies [397d617]
|
|
31
|
+
- @open-pioneer/map@0.7.0
|
|
32
|
+
|
|
3
33
|
## 0.4.4
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/OverviewMap.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
1
|
import { BoxProps } from "@open-pioneer/chakra-integration";
|
|
2
|
+
import { MapModelProps } from "@open-pioneer/map";
|
|
3
3
|
import { CommonComponentProps } from "@open-pioneer/react-utils";
|
|
4
4
|
import OlBaseLayer from "ol/layer/Base";
|
|
5
|
+
import { FC } from "react";
|
|
5
6
|
/**
|
|
6
7
|
* These are properties supported by the {@link OverviewMap}.
|
|
7
8
|
*/
|
|
8
|
-
export interface OverviewMapProps extends CommonComponentProps {
|
|
9
|
-
/**
|
|
10
|
-
* The id of the map.
|
|
11
|
-
*/
|
|
12
|
-
mapId: string;
|
|
9
|
+
export interface OverviewMapProps extends CommonComponentProps, MapModelProps {
|
|
13
10
|
/**
|
|
14
11
|
* The layer shown in the overview map.
|
|
15
12
|
*/
|
package/OverviewMap.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRef, useEffect } from 'react';
|
|
3
|
-
import { useMapModel } from '@open-pioneer/map';
|
|
4
2
|
import { Box } from '@open-pioneer/chakra-integration';
|
|
5
|
-
import {
|
|
3
|
+
import { useMapModel } from '@open-pioneer/map';
|
|
6
4
|
import { useCommonComponentProps } from '@open-pioneer/react-utils';
|
|
5
|
+
import { OverviewMap as OverviewMap$1 } from 'ol/control.js';
|
|
6
|
+
import { useRef, useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
const DEFAULT_HEIGHT = "200px";
|
|
9
9
|
const DEFAULT_WIDTH = "300px";
|
|
10
10
|
const OverviewMap = (props) => {
|
|
11
|
-
const {
|
|
11
|
+
const { olLayer, height = DEFAULT_HEIGHT, width = DEFAULT_WIDTH } = props;
|
|
12
12
|
const { containerProps } = useCommonComponentProps("overview-map", props);
|
|
13
13
|
const overviewMapControlElem = useRef(null);
|
|
14
|
-
const { map } = useMapModel(
|
|
14
|
+
const { map } = useMapModel(props);
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
if (overviewMapControlElem.current && map && olLayer) {
|
|
17
17
|
const olMap = map.olMap;
|
package/OverviewMap.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverviewMap.js","sources":["OverviewMap.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport {
|
|
1
|
+
{"version":3,"file":"OverviewMap.js","sources":["OverviewMap.tsx"],"sourcesContent":["// SPDX-FileCopyrightText: 2023 Open Pioneer project (https://github.com/open-pioneer)\n// SPDX-License-Identifier: Apache-2.0\nimport { Box, BoxProps } from \"@open-pioneer/chakra-integration\";\nimport { MapModelProps, useMapModel } from \"@open-pioneer/map\";\nimport { CommonComponentProps, useCommonComponentProps } from \"@open-pioneer/react-utils\";\nimport { OverviewMap as OlOverviewMap } from \"ol/control\";\nimport OlBaseLayer from \"ol/layer/Base\";\nimport { FC, useEffect, useRef } from \"react\";\n\n/**\n * These are properties supported by the {@link OverviewMap}.\n */\nexport interface OverviewMapProps extends CommonComponentProps, MapModelProps {\n /**\n * The layer shown in the overview map.\n */\n olLayer: OlBaseLayer;\n\n /**\n * The height of the map.\n * This defaults to a reasonable pixel size.\n */\n height?: BoxProps[\"height\"];\n\n /**\n * The width of the map.\n * This defaults to a reasonable pixel size.\n */\n width?: BoxProps[\"width\"];\n}\n\nconst DEFAULT_HEIGHT = \"200px\";\nconst DEFAULT_WIDTH = \"300px\";\n\n/**\n * The `OverviewMap` component can be used in an app to have a better overview of the current location in the map.\n */\nexport const OverviewMap: FC<OverviewMapProps> = (props) => {\n const { olLayer, height = DEFAULT_HEIGHT, width = DEFAULT_WIDTH } = props;\n const { containerProps } = useCommonComponentProps(\"overview-map\", props);\n const overviewMapControlElem = useRef(null);\n const { map } = useMapModel(props);\n\n useEffect(() => {\n if (overviewMapControlElem.current && map && olLayer) {\n const olMap = map.olMap;\n const overviewMapControl: OlOverviewMap = new OlOverviewMap({\n className: \"ol-overviewmap\",\n layers: [olLayer],\n collapsible: false,\n collapsed: false,\n target: overviewMapControlElem.current\n });\n olMap.addControl(overviewMapControl);\n return () => {\n olMap.removeControl(overviewMapControl);\n };\n }\n }, [map, olLayer]);\n\n return (\n <Box height={height} width={width} ref={overviewMapControlElem} {...containerProps}></Box>\n );\n};\n"],"names":["OlOverviewMap"],"mappings":";;;;;;;AA+BA,MAAM,cAAiB,GAAA,OAAA,CAAA;AACvB,MAAM,aAAgB,GAAA,OAAA,CAAA;AAKT,MAAA,WAAA,GAAoC,CAAC,KAAU,KAAA;AACxD,EAAA,MAAM,EAAE,OAAS,EAAA,MAAA,GAAS,cAAgB,EAAA,KAAA,GAAQ,eAAkB,GAAA,KAAA,CAAA;AACpE,EAAA,MAAM,EAAE,cAAA,EAAmB,GAAA,uBAAA,CAAwB,gBAAgB,KAAK,CAAA,CAAA;AACxE,EAAM,MAAA,sBAAA,GAAyB,OAAO,IAAI,CAAA,CAAA;AAC1C,EAAA,MAAM,EAAE,GAAA,EAAQ,GAAA,WAAA,CAAY,KAAK,CAAA,CAAA;AAEjC,EAAA,SAAA,CAAU,MAAM;AACZ,IAAI,IAAA,sBAAA,CAAuB,OAAW,IAAA,GAAA,IAAO,OAAS,EAAA;AAClD,MAAA,MAAM,QAAQ,GAAI,CAAA,KAAA,CAAA;AAClB,MAAM,MAAA,kBAAA,GAAoC,IAAIA,aAAc,CAAA;AAAA,QACxD,SAAW,EAAA,gBAAA;AAAA,QACX,MAAA,EAAQ,CAAC,OAAO,CAAA;AAAA,QAChB,WAAa,EAAA,KAAA;AAAA,QACb,SAAW,EAAA,KAAA;AAAA,QACX,QAAQ,sBAAuB,CAAA,OAAA;AAAA,OAClC,CAAA,CAAA;AACD,MAAA,KAAA,CAAM,WAAW,kBAAkB,CAAA,CAAA;AACnC,MAAA,OAAO,MAAM;AACT,QAAA,KAAA,CAAM,cAAc,kBAAkB,CAAA,CAAA;AAAA,OAC1C,CAAA;AAAA,KACJ;AAAA,GACD,EAAA,CAAC,GAAK,EAAA,OAAO,CAAC,CAAA,CAAA;AAEjB,EAAA,2BACK,GAAI,EAAA,EAAA,MAAA,EAAgB,OAAc,GAAK,EAAA,sBAAA,EAAyB,GAAG,cAAgB,EAAA,CAAA,CAAA;AAE5F;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@open-pioneer/overview-map",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.7.0",
|
|
5
5
|
"description": "This package offers a UI component with which an overview map can be integrated.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"open-pioneer-trails"
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"url": "https://github.com/open-pioneer/trails-openlayers-base-packages",
|
|
14
14
|
"directory": "src/packages/overview-map"
|
|
15
15
|
},
|
|
16
|
-
"
|
|
17
|
-
"@open-pioneer/chakra-integration": "^
|
|
18
|
-
"@open-pioneer/react-utils": "^
|
|
19
|
-
"@open-pioneer/runtime": "^2.
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@open-pioneer/chakra-integration": "^2.3.0",
|
|
18
|
+
"@open-pioneer/react-utils": "^2.3.0",
|
|
19
|
+
"@open-pioneer/runtime": "^2.3.0",
|
|
20
20
|
"ol": "^9.2.4",
|
|
21
21
|
"react": "^18.3.1",
|
|
22
|
-
"@open-pioneer/map": "^0.
|
|
22
|
+
"@open-pioneer/map": "^0.7.0"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
"./package.json": "./package.json",
|