@opensystemslab/map 0.3.4 → 0.4.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/README.md +1 -1
- package/dist/index.html +16 -1
- package/dist/map.es.js +11 -4
- package/dist/map.umd.js +14 -7
- package/package.json +4 -3
- package/types/{draw.d.ts → drawing.d.ts} +3 -2
- package/types/my-map.d.ts +7 -1
- package/types/snapping.d.ts +12 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@opensystemslab/map",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.0",
|
4
4
|
"license": "OGL-UK-3.0",
|
5
5
|
"private": false,
|
6
6
|
"repository": {
|
@@ -18,7 +18,8 @@
|
|
18
18
|
"scripts": {
|
19
19
|
"dev": "vite",
|
20
20
|
"build": "tsc && vite build && sed 's/src=\".*\"/src=\"map.es.js\"/' index.html > dist/index.html",
|
21
|
-
"prepublishOnly": "rm -rf dist types && npm run build"
|
21
|
+
"prepublishOnly": "rm -rf dist types && npm run build",
|
22
|
+
"prepare": "husky install"
|
22
23
|
},
|
23
24
|
"dependencies": {
|
24
25
|
"@turf/union": "^6.5.0",
|
@@ -30,7 +31,7 @@
|
|
30
31
|
"devDependencies": {
|
31
32
|
"@types/node": "^16.4.13",
|
32
33
|
"husky": "^7.0.1",
|
33
|
-
"lint-staged": "^
|
34
|
+
"lint-staged": "^12.0.3",
|
34
35
|
"prettier": "^2.3.2",
|
35
36
|
"typescript": "^4.3.5",
|
36
37
|
"vite": "^2.4.4"
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { Draw, Modify, Snap } from "ol/interaction";
|
2
2
|
import { Vector as VectorLayer } from "ol/layer";
|
3
3
|
import { Vector as VectorSource } from "ol/source";
|
4
|
+
export declare type DrawPointerEnum = "crosshair" | "dot";
|
4
5
|
export declare const drawingSource: VectorSource<import("ol/geom/Geometry").default>;
|
5
6
|
export declare const drawingLayer: VectorLayer<VectorSource<import("ol/geom/Geometry").default>>;
|
6
|
-
export declare
|
7
|
+
export declare function configureDraw(pointerStyle: DrawPointerEnum): Draw;
|
7
8
|
export declare const snap: Snap;
|
8
|
-
export declare
|
9
|
+
export declare function configureModify(pointerStyle: DrawPointerEnum): Modify;
|
package/types/my-map.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { LitElement } from "lit";
|
2
|
+
import { DrawPointerEnum } from "./drawing";
|
2
3
|
import { AreaUnitEnum } from "./utils";
|
3
4
|
export declare class MyMap extends LitElement {
|
4
5
|
static styles: import("lit").CSSResultGroup;
|
@@ -8,6 +9,12 @@ export declare class MyMap extends LitElement {
|
|
8
9
|
minZoom: number;
|
9
10
|
maxZoom: number;
|
10
11
|
drawMode: boolean;
|
12
|
+
drawGeojsonData: {
|
13
|
+
type: string;
|
14
|
+
geometry: {};
|
15
|
+
};
|
16
|
+
drawGeojsonDataBuffer: number;
|
17
|
+
drawPointer: DrawPointerEnum;
|
11
18
|
showFeaturesAtPoint: boolean;
|
12
19
|
clickFeatures: boolean;
|
13
20
|
featureColor: string;
|
@@ -26,7 +33,6 @@ export declare class MyMap extends LitElement {
|
|
26
33
|
hideResetControl: boolean;
|
27
34
|
staticMode: boolean;
|
28
35
|
areaUnit: AreaUnitEnum;
|
29
|
-
ariaLabel: string;
|
30
36
|
showScale: boolean;
|
31
37
|
useScaleBarStyle: boolean;
|
32
38
|
firstUpdated(): void;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Vector as VectorLayer } from "ol/layer";
|
2
|
+
import VectorTileLayer from "ol/layer/VectorTile";
|
3
|
+
import VectorSource from "ol/source/Vector";
|
4
|
+
export declare const pointsSource: VectorSource<import("ol/geom/Geometry").default>;
|
5
|
+
export declare const pointsLayer: VectorLayer<VectorSource<import("ol/geom/Geometry").default>>;
|
6
|
+
/**
|
7
|
+
* Extract points that are available to snap to when a VectorTileLayer basemap is displayed
|
8
|
+
* @param basemap - a VectorTileLayer
|
9
|
+
* @param extent - an array of 4 points
|
10
|
+
* @returns - a VectorSource populated with points within the extent
|
11
|
+
*/
|
12
|
+
export declare function getSnapPointsFromVectorTiles(basemap: VectorTileLayer, extent: number[]): void;
|