yio-map 0.8.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/LICENSE +21 -0
- package/README.md +101 -0
- package/dist/YioMap.d.ts +84 -0
- package/dist/YioMap.d.ts.map +1 -0
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/controls/LayerControl.d.ts +48 -0
- package/dist/controls/LayerControl.d.ts.map +1 -0
- package/dist/controls/UserEditInteraction.d.ts +33 -0
- package/dist/controls/UserEditInteraction.d.ts.map +1 -0
- package/dist/controls/UserPinInteraction.d.ts +18 -0
- package/dist/controls/UserPinInteraction.d.ts.map +1 -0
- package/dist/controls/UserSelectInteraction.d.ts +18 -0
- package/dist/controls/UserSelectInteraction.d.ts.map +1 -0
- package/dist/controls/YioAttribution.d.ts +3 -0
- package/dist/controls/YioAttribution.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/tiles/14/8901/5667.pbf +0 -0
- package/dist/tiles/14/8902/5667.pbf +0 -0
- package/dist/yio-map.js +1598 -0
- package/dist/yio-map.umd.cjs +144 -0
- package/package.json +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 yio
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
yio-map
|
|
2
|
+
|
|
3
|
+
A map web-component to display various geo data using OpenLayers under the hood.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i yio-map
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### With the npm package
|
|
14
|
+
|
|
15
|
+
```html
|
|
16
|
+
<script type="module">
|
|
17
|
+
import 'yio-map';
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<yio-map></yio-map>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### With the standalone build
|
|
24
|
+
|
|
25
|
+
Download `yio-map.umd.cjs` from the [latest release](https://github.com/yiogmbh/yio-map/releases/latest), put it in your project directory, and add it with a `script` element:
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<script src="./yio-map.umd.cjs"></script>
|
|
29
|
+
|
|
30
|
+
<yio-map></yio-map>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Linting and formatting
|
|
34
|
+
|
|
35
|
+
To scan the project for linting and formatting errors, run
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm run lint
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
To automatically fix linting and formatting errors, run
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm run format
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Testing with Web Test Runner
|
|
48
|
+
|
|
49
|
+
To execute a single test run:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npm test
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
To run the tests in interactive watch mode run:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm run test:watch
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Demoing with Storybook
|
|
62
|
+
|
|
63
|
+
To run a local instance of Storybook for your component, run
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm run storybook
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
To build a production version of Storybook, run
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm run storybook:build
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Local Demo and Development
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npm start
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
To run a local development server that serves the basic demo located in `index.html`
|
|
82
|
+
|
|
83
|
+
To be able to access yio resources, an `.env` file should be created. See `.env.example` for an explanation of available environment variables. As a starting point, copy `.env.example` to `.env`.
|
|
84
|
+
|
|
85
|
+
## Build
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm run build
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
To build the web component. In addition to the package files, a standalone script with all dependencies included will be available in `dist/yio-map.umd.cjs`.
|
|
92
|
+
|
|
93
|
+
## Publishing a release
|
|
94
|
+
|
|
95
|
+
The quickest way to push a tag that triggers an automated release process is to use `npm vesion {patch|minor|major}` and `git push --folow-tags`. Example:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
git pull origin main
|
|
99
|
+
npm version patch
|
|
100
|
+
git push --follow-tags
|
|
101
|
+
```
|
package/dist/YioMap.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export class YioMap extends LitElement {
|
|
2
|
+
static styles: import("lit").CSSResult[];
|
|
3
|
+
static properties: {
|
|
4
|
+
center: {
|
|
5
|
+
type: ArrayConstructor;
|
|
6
|
+
reflect: boolean;
|
|
7
|
+
};
|
|
8
|
+
zoom: {
|
|
9
|
+
type: NumberConstructor;
|
|
10
|
+
reflect: boolean;
|
|
11
|
+
};
|
|
12
|
+
contentMap: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
};
|
|
15
|
+
editCreate: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
};
|
|
18
|
+
editModify: {
|
|
19
|
+
type: ArrayConstructor;
|
|
20
|
+
};
|
|
21
|
+
enablePinning: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
};
|
|
24
|
+
enableSelect: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
};
|
|
27
|
+
geojsonSources: {
|
|
28
|
+
type: ObjectConstructor;
|
|
29
|
+
};
|
|
30
|
+
editFeatures: {
|
|
31
|
+
attribute: boolean;
|
|
32
|
+
};
|
|
33
|
+
lastClickCoordinate: {
|
|
34
|
+
type: ArrayConstructor;
|
|
35
|
+
attribute: boolean;
|
|
36
|
+
};
|
|
37
|
+
userSelect: {
|
|
38
|
+
attribute: boolean;
|
|
39
|
+
};
|
|
40
|
+
sourceLayerVisibility: {
|
|
41
|
+
type: ObjectConstructor;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/** @type {boolean} */
|
|
45
|
+
notifyNextChange: boolean;
|
|
46
|
+
center: number[];
|
|
47
|
+
zoom: number;
|
|
48
|
+
userSelect: any[];
|
|
49
|
+
/**
|
|
50
|
+
* @returns {LayerGroup}
|
|
51
|
+
*/
|
|
52
|
+
_getContentLayer(): LayerGroup;
|
|
53
|
+
/**
|
|
54
|
+
* @returns {Promise<LayerGroup>}
|
|
55
|
+
*/
|
|
56
|
+
_getContentLayerPromise(): Promise<LayerGroup>;
|
|
57
|
+
/**
|
|
58
|
+
* @param {Event} event
|
|
59
|
+
*/
|
|
60
|
+
_handleClick(event: Event): void;
|
|
61
|
+
lastClickCoordinate: import("ol/coordinate").Coordinate;
|
|
62
|
+
set contentMap(value: string);
|
|
63
|
+
get contentMap(): string;
|
|
64
|
+
set editCreate(value: string);
|
|
65
|
+
get editCreate(): string;
|
|
66
|
+
set editModify(value: number[]);
|
|
67
|
+
get editModify(): number[];
|
|
68
|
+
set enableSelect(value: boolean);
|
|
69
|
+
get enableSelect(): boolean;
|
|
70
|
+
set enablePinning(value: boolean);
|
|
71
|
+
get enablePinning(): boolean;
|
|
72
|
+
set geojsonSources(value: any);
|
|
73
|
+
get geojsonSources(): any;
|
|
74
|
+
set sourceLayerVisibility(value: any);
|
|
75
|
+
get sourceLayerVisibility(): any;
|
|
76
|
+
get editFeatures(): any;
|
|
77
|
+
firstUpdated(changedProperties: any): void;
|
|
78
|
+
updated(changedProperties: any): void;
|
|
79
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
80
|
+
#private;
|
|
81
|
+
}
|
|
82
|
+
import { LitElement } from 'lit';
|
|
83
|
+
import LayerGroup from 'ol/layer/Group.js';
|
|
84
|
+
//# sourceMappingURL=YioMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YioMap.d.ts","sourceRoot":"","sources":["../src/YioMap.js"],"names":[],"mappings":"AAgBA;IACE,yCA0BE;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAaE;IAEF,sBAAsB;IACtB,kBADW,OAAO,CACO;IA8DvB,iBAAoB;IACpB,aAAa;IACb,kBAAoB;IAYtB;;OAEG;IACH,oBAFa,UAAU,CAItB;IAED;;OAEG;IACH,2BAFa,OAAO,CAAC,UAAU,CAAC,CAI/B;IAED;;OAEG;IACH,oBAFW,KAAK,QAOf;IAHG,wDAAwE;IAS5E,8BAGC;IAPD,yBAEC;IAWD,8BAGC;IAPD,yBAEC;IAOD,gCAGC;IAED,2BAEC;IAMD,iCAGC;IAPD,4BAEC;IAWD,kCAGC;IAPD,6BAEC;IAWD,+BAEC;IAND,0BAEC;IAUD,sCAEC;IAND,iCAEC;IAMD,wBAcC;IA8GD,2CAQC;IAED,sCAgCC;IAED,+CAEC;;CACF;2BAzYgD,KAAK;uBAU/B,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.js"],"names":[],"mappings":"AASA,oCAUE;AAQF,6BAMG;;;;;sBAjC+C,aAAa"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} LayerItem
|
|
3
|
+
* @property {string} name
|
|
4
|
+
* @property {string} image
|
|
5
|
+
* @property {string=} styleUrl
|
|
6
|
+
* @property {TileLayer|LayerGroup} layer
|
|
7
|
+
* @property {HTMLDivElement} thumbnailBox
|
|
8
|
+
*/
|
|
9
|
+
export default class LayerControl extends Control {
|
|
10
|
+
/**
|
|
11
|
+
* @param {Object} [opt_options] Control options.
|
|
12
|
+
*/
|
|
13
|
+
constructor(opt_options?: any);
|
|
14
|
+
/**
|
|
15
|
+
* @type {HTMLDivElement} layer control container
|
|
16
|
+
*/
|
|
17
|
+
layerControlElement: HTMLDivElement;
|
|
18
|
+
baseLayers: LayerItem[];
|
|
19
|
+
/**
|
|
20
|
+
* @type {LayerGroup} layer group containing all base layers
|
|
21
|
+
*/
|
|
22
|
+
baseLayerGroup: LayerGroup;
|
|
23
|
+
setMap(map: any): void;
|
|
24
|
+
/**
|
|
25
|
+
* @param {boolean} visible set visibility of the layer selection
|
|
26
|
+
*/
|
|
27
|
+
set displayLayerSelection(visible: boolean);
|
|
28
|
+
/**
|
|
29
|
+
* @returns {boolean} true if the layer selection is displayed
|
|
30
|
+
*/
|
|
31
|
+
get displayLayerSelection(): boolean;
|
|
32
|
+
toggleLayerSelection(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Hides the layer selection with a fade-out animation
|
|
35
|
+
*/
|
|
36
|
+
fadeOutAndHide(): void;
|
|
37
|
+
}
|
|
38
|
+
export type LayerItem = {
|
|
39
|
+
name: string;
|
|
40
|
+
image: string;
|
|
41
|
+
styleUrl?: string | undefined;
|
|
42
|
+
layer: TileLayer | LayerGroup;
|
|
43
|
+
thumbnailBox: HTMLDivElement;
|
|
44
|
+
};
|
|
45
|
+
import Control from 'ol/control/Control.js';
|
|
46
|
+
import LayerGroup from 'ol/layer/Group.js';
|
|
47
|
+
import TileLayer from 'ol/layer/Tile.js';
|
|
48
|
+
//# sourceMappingURL=LayerControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayerControl.d.ts","sourceRoot":"","sources":["../../src/controls/LayerControl.js"],"names":[],"mappings":"AASA;;;;;;;GAOG;AAEH;IACE;;OAEG;IACH,+BA8BC;IAyFD;;OAEG;IACH,qBAFU,cAAc,CAEG;IA1F3B,wBAmEE;IAEF;;OAEG;IACH,gBAFU,UAAU,CAEL;IAEf,uBAWC;IAOD;;OAEG;IACH,mCAFW,OAAO,EA0BjB;IAED;;OAEG;IACH,6BAFa,OAAO,CAInB;IAED,6BAEC;IAED;;OAEG;IACH,uBAOC;CACF;;UA1La,MAAM;WACN,MAAM;eACN,MAAM,YAAC;WACP,SAAS,GAAC,UAAU;kBACpB,cAAc;;oBAdR,uBAAuB;uBAGpB,mBAAmB;sBAFpB,kBAAkB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} Options
|
|
3
|
+
* @property {import('../YioMap.js').YioMap} yioMap
|
|
4
|
+
*/
|
|
5
|
+
export default class UserEditInteraction extends Interaction {
|
|
6
|
+
/**
|
|
7
|
+
* @param {Options} options
|
|
8
|
+
*/
|
|
9
|
+
constructor(options: Options);
|
|
10
|
+
getEditLayer(): VectorLayer<import("ol/source.js").Vector<any>, any>;
|
|
11
|
+
/**
|
|
12
|
+
* clears features that were modified
|
|
13
|
+
*/
|
|
14
|
+
clearModifiedFeatures(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Clears features that were created
|
|
17
|
+
*/
|
|
18
|
+
clearCreatedFeatures(): void;
|
|
19
|
+
drawInteraction: any;
|
|
20
|
+
modifyInteraction: any;
|
|
21
|
+
setActive(active: any): Promise<void>;
|
|
22
|
+
get createEnabled(): boolean;
|
|
23
|
+
setCreateEnabled(value: any): Promise<void>;
|
|
24
|
+
get modifyEnabled(): boolean;
|
|
25
|
+
setModifyEnabled(ids: any): Promise<void>;
|
|
26
|
+
#private;
|
|
27
|
+
}
|
|
28
|
+
export type Options = {
|
|
29
|
+
yioMap: import("../YioMap.js").YioMap;
|
|
30
|
+
};
|
|
31
|
+
import Interaction from 'ol/interaction/Interaction.js';
|
|
32
|
+
import VectorLayer from 'ol/layer/Vector.js';
|
|
33
|
+
//# sourceMappingURL=UserEditInteraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserEditInteraction.d.ts","sourceRoot":"","sources":["../../src/controls/UserEditInteraction.js"],"names":[],"mappings":"AAeA;;;GAGG;AAEH;IA6DE;;OAEG;IACH,qBAFW,OAAO,EAKjB;IAnDD,qEAEC;IAED;;OAEG;IACH,8BAOC;IAED;;OAEG;IACH,6BAMC;IA4BD,qBAAgB;IAEhB,uBAAkB;IA6DlB,sCA4FC;IAED,6BAEC;IAED,4CAeC;IAED,6BAEC;IAED,0CAeC;;CA+DF;;YA5Ua,OAAO,cAAc,EAAE,MAAM;;wBAjBnB,+BAA+B;wBAC/B,oBAAoB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} Options
|
|
3
|
+
* @property {import('../YioMap.js').YioMap} yioMap
|
|
4
|
+
*/
|
|
5
|
+
export default class UserPinInteraction extends Interaction {
|
|
6
|
+
/**
|
|
7
|
+
* @param {Options} options
|
|
8
|
+
*/
|
|
9
|
+
constructor(options: Options);
|
|
10
|
+
setMap(map: any): void;
|
|
11
|
+
setActive(active: any): void;
|
|
12
|
+
#private;
|
|
13
|
+
}
|
|
14
|
+
export type Options = {
|
|
15
|
+
yioMap: import("../YioMap.js").YioMap;
|
|
16
|
+
};
|
|
17
|
+
import Interaction from 'ol/interaction/Interaction.js';
|
|
18
|
+
//# sourceMappingURL=UserPinInteraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserPinInteraction.d.ts","sourceRoot":"","sources":["../../src/controls/UserPinInteraction.js"],"names":[],"mappings":"AAOA;;;GAGG;AAEH;IAQE;;OAEG;IACH,qBAFW,OAAO,EAMjB;IAED,uBAUC;IAuBD,6BAKC;;CAYF;;YAtEa,OAAO,cAAc,EAAE,MAAM;;wBATnB,+BAA+B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} Options
|
|
3
|
+
* @property {import('../YioMap.js').YioMap} yioMap
|
|
4
|
+
*/
|
|
5
|
+
export default class UserSelectInteraction extends Interaction {
|
|
6
|
+
/**
|
|
7
|
+
* @param {Options} options
|
|
8
|
+
*/
|
|
9
|
+
constructor(options: Options);
|
|
10
|
+
setMap(map: any): void;
|
|
11
|
+
setActive(active: any): void;
|
|
12
|
+
#private;
|
|
13
|
+
}
|
|
14
|
+
export type Options = {
|
|
15
|
+
yioMap: import("../YioMap.js").YioMap;
|
|
16
|
+
};
|
|
17
|
+
import Interaction from 'ol/interaction/Interaction.js';
|
|
18
|
+
//# sourceMappingURL=UserSelectInteraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserSelectInteraction.d.ts","sourceRoot":"","sources":["../../src/controls/UserSelectInteraction.js"],"names":[],"mappings":"AAKA;;;GAGG;AAEH;IAQE;;OAEG;IACH,qBAFW,OAAO,EAWjB;IAED,uBAUC;IAgED,6BAQC;;CACF;;YA5Ga,OAAO,cAAc,EAAE,MAAM;;wBAPnB,+BAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YioAttribution.d.ts","sourceRoot":"","sources":["../../src/controls/YioAttribution.js"],"names":[],"mappings":"AAQA,yCA0CG;wBAlDqB,2BAA2B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
|
|
Binary file
|
|
Binary file
|