@opensystemslab/map 0.5.5 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensystemslab/map",
3
- "version": "0.5.5",
3
+ "version": "0.5.8",
4
4
  "license": "OGL-UK-3.0",
5
5
  "private": false,
6
6
  "repository": {
@@ -19,29 +19,48 @@
19
19
  "dev": "vite",
20
20
  "build": "rm -rf dist types && tsc && vite build && sed 's/src=\".*\"/src=\"component-lib.es.js\"/' index.html > dist/index.html",
21
21
  "prepublishOnly": "npm run build",
22
- "prepare": "husky install"
22
+ "prepare": "husky install",
23
+ "test": "vitest",
24
+ "test:ui": "vitest --ui",
25
+ "docs": "NODE_ENV=development pitsby build --watch --port=7007",
26
+ "docsPublish": "pitsby build"
23
27
  },
24
28
  "dependencies": {
25
29
  "@turf/union": "^6.5.0",
26
30
  "accessible-autocomplete": "^2.0.4",
27
31
  "govuk-frontend": "^4.0.1",
28
- "lit": "^2.0.0-rc.2",
29
- "ol": "^6.9.0",
30
- "ol-mapbox-style": "^8.0.7",
32
+ "lit": "^2.3.1",
33
+ "ol": "^7.0.0",
34
+ "ol-mapbox-style": "^9.0.0",
31
35
  "postcode": "^5.1.0",
36
+ "proj4": "^2.8.0",
32
37
  "rambda": "^7.0.1"
33
38
  },
34
39
  "devDependencies": {
35
- "@types/node": "^17.0.7",
40
+ "@glorious/pitsby": "^1.30.16",
41
+ "@testing-library/dom": "^8.17.1",
42
+ "@testing-library/user-event": "^14.4.3",
43
+ "@types/node": "^18.6.3",
44
+ "@types/proj4": "^2.5.2",
45
+ "@vitest/ui": "^0.22.1",
46
+ "happy-dom": "^6.0.4",
36
47
  "husky": "^8.0.1",
37
- "lint-staged": "^12.0.3",
48
+ "lint-staged": "^13.0.3",
38
49
  "prettier": "^2.3.2",
39
50
  "rollup-plugin-postcss-lit": "^2.0.0",
40
51
  "sass": "^1.44.0",
41
52
  "typescript": "^4.3.5",
42
- "vite": "^2.4.4"
53
+ "vite": "^3.0.4",
54
+ "vitest": "0.20.3"
55
+ },
56
+ "engines": {
57
+ "node": "^16",
58
+ "pnpm": "^7.8.0"
43
59
  },
44
60
  "lint-staged": {
45
61
  "src/**/*.{js,jsx,ts,tsx,json,css,scss,md,html}": "prettier --write"
62
+ },
63
+ "stackblitz": {
64
+ "startCommand": "npm run test:ui"
46
65
  }
47
66
  }
@@ -0,0 +1,6 @@
1
+ import type { IWindow } from "happy-dom";
2
+ import "./index";
3
+ declare global {
4
+ interface Window extends IWindow {
5
+ }
6
+ }
@@ -1,12 +1,15 @@
1
1
  import { LitElement } from "lit";
2
2
  import Map from "ol/Map";
3
3
  import { DrawPointerEnum } from "./drawing";
4
+ import { ProjectionEnum } from "./projections";
4
5
  import { AreaUnitEnum } from "./utils";
6
+ declare type MarkerImageEnum = "circle" | "pin";
5
7
  export declare class MyMap extends LitElement {
6
8
  static styles: import("lit").CSSResult;
7
9
  id: string;
8
10
  latitude: number;
9
11
  longitude: number;
12
+ projection: ProjectionEnum;
10
13
  zoom: number;
11
14
  minZoom: number;
12
15
  maxZoom: number;
@@ -21,7 +24,12 @@ export declare class MyMap extends LitElement {
21
24
  clickFeatures: boolean;
22
25
  featureColor: string;
23
26
  featureFill: boolean;
27
+ featureBorderNone: boolean;
24
28
  featureBuffer: number;
29
+ showMarker: boolean;
30
+ markerLatitude: number;
31
+ markerLongitude: number;
32
+ markerColor: string;
25
33
  geojsonData: {
26
34
  type: string;
27
35
  features: never[];
@@ -38,6 +46,7 @@ export declare class MyMap extends LitElement {
38
46
  areaUnit: AreaUnitEnum;
39
47
  showScale: boolean;
40
48
  useScaleBarStyle: boolean;
49
+ markerImage: MarkerImageEnum;
41
50
  map?: Map;
42
51
  constructor();
43
52
  firstUpdated(): void;
@@ -55,3 +64,4 @@ declare global {
55
64
  "my-map": MyMap;
56
65
  }
57
66
  }
67
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { IWindow } from "happy-dom";
2
+ import "./index";
3
+ declare global {
4
+ interface Window extends IWindow {
5
+ }
6
+ }
@@ -1,7 +1,7 @@
1
1
  import { Vector as VectorLayer } from "ol/layer";
2
2
  import { Vector as VectorSource } from "ol/source";
3
3
  export declare const outlineSource: VectorSource<import("ol/geom/Geometry").default>;
4
- export declare function makeFeatureLayer(color: string, featureFill: boolean): VectorLayer<VectorSource<import("ol/geom/Geometry").default>>;
4
+ export declare function makeFeatureLayer(color: string, featureFill: boolean, borderNone: boolean): VectorLayer<VectorSource<import("ol/geom/Geometry").default>>;
5
5
  /**
6
6
  * Create an OGC XML filter parameter value which will select the TopographicArea
7
7
  * features containing the coordinates of the provided point
@@ -0,0 +1,3 @@
1
+ import { Projection } from "ol/proj";
2
+ export declare type ProjectionEnum = "EPSG:4326" | "EPSG:3857" | "EPSG:27700";
3
+ export declare const proj27700: Projection | null;
@@ -0,0 +1,6 @@
1
+ import type { IWindow } from "happy-dom";
2
+ import "./index";
3
+ declare global {
4
+ interface Window extends IWindow {
5
+ }
6
+ }
@@ -0,0 +1,2 @@
1
+ export declare function getShadowRoot(customEl: string): ShadowRoot | null | undefined;
2
+ export declare function getShadowRootEl(customEl: string, el: string): Element | null | undefined;