@opensystemslab/map 0.6.1 → 0.6.3
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/dist/component-lib.es.js +8114 -8037
- package/dist/component-lib.umd.js +36 -75
- package/dist/index.html +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/types/components/address-autocomplete/index.d.ts +1 -0
- package/types/components/my-map/drawing.d.ts +3 -2
- package/types/components/my-map/index.d.ts +5 -2
- package/types/components/my-map/os-features.d.ts +2 -1
- package/types/components/my-map/os-layers.d.ts +3 -3
- package/types/components/my-map/os-layers.test.d.ts +10 -0
- package/types/lib/ordnanceSurvey.d.ts +19 -0
- package/types/lib/ordnanceSurvey.test.d.ts +1 -0
- package/types/test-utils.d.ts +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@opensystemslab/map",
|
3
|
-
"version": "0.6.
|
3
|
+
"version": "0.6.3",
|
4
4
|
"license": "OGL-UK-3.0",
|
5
5
|
"private": false,
|
6
6
|
"repository": {
|
@@ -42,16 +42,16 @@
|
|
42
42
|
"@testing-library/user-event": "^14.4.3",
|
43
43
|
"@types/node": "^18.6.3",
|
44
44
|
"@types/proj4": "^2.5.2",
|
45
|
-
"@vitest/ui": "^0.
|
46
|
-
"happy-dom": "^
|
45
|
+
"@vitest/ui": "^0.26.1",
|
46
|
+
"happy-dom": "^8.1.0",
|
47
47
|
"husky": "^8.0.1",
|
48
48
|
"lint-staged": "^13.0.3",
|
49
49
|
"prettier": "^2.3.2",
|
50
50
|
"rollup-plugin-postcss-lit": "^2.0.0",
|
51
51
|
"sass": "^1.44.0",
|
52
52
|
"typescript": "^4.3.5",
|
53
|
-
"vite": "^
|
54
|
-
"vitest": "0.
|
53
|
+
"vite": "^4.0.0",
|
54
|
+
"vitest": "0.26.1",
|
55
55
|
"wait-for-expect": "^3.0.2"
|
56
56
|
},
|
57
57
|
"engines": {
|
@@ -1,9 +1,10 @@
|
|
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 DrawTypeEnum = "Polygon" | "Point";
|
4
5
|
export declare type DrawPointerEnum = "crosshair" | "dot";
|
5
6
|
export declare const drawingSource: VectorSource<import("ol/geom/Geometry").default>;
|
6
|
-
export declare
|
7
|
-
export declare function configureDraw(pointerStyle: DrawPointerEnum): Draw;
|
7
|
+
export declare function configureDrawingLayer(drawType: DrawTypeEnum, pointColor: string): VectorLayer<VectorSource<import("ol/geom/Geometry").default>>;
|
8
|
+
export declare function configureDraw(drawType: DrawTypeEnum, pointerStyle: DrawPointerEnum, pointColor: string): Draw;
|
8
9
|
export declare const snap: Snap;
|
9
10
|
export declare function configureModify(pointerStyle: DrawPointerEnum): Modify;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { LitElement } from "lit";
|
2
2
|
import Map from "ol/Map";
|
3
|
-
import { DrawPointerEnum } from "./drawing";
|
3
|
+
import { DrawPointerEnum, DrawTypeEnum } from "./drawing";
|
4
4
|
import { ProjectionEnum } from "./projections";
|
5
5
|
import { AreaUnitEnum } from "./utils";
|
6
6
|
declare type MarkerImageEnum = "circle" | "pin";
|
7
|
-
declare type ResetControlImageEnum = "unicode" | "
|
7
|
+
declare type ResetControlImageEnum = "unicode" | "trash";
|
8
8
|
export declare class MyMap extends LitElement {
|
9
9
|
static styles: import("lit").CSSResult;
|
10
10
|
id: string;
|
@@ -15,6 +15,8 @@ export declare class MyMap extends LitElement {
|
|
15
15
|
minZoom: number;
|
16
16
|
maxZoom: number;
|
17
17
|
drawMode: boolean;
|
18
|
+
drawType: DrawTypeEnum;
|
19
|
+
drawPointColor: string;
|
18
20
|
drawGeojsonData: {
|
19
21
|
type: string;
|
20
22
|
geometry: {};
|
@@ -43,6 +45,7 @@ export declare class MyMap extends LitElement {
|
|
43
45
|
osVectorTilesApiKey: string;
|
44
46
|
osFeaturesApiKey: string;
|
45
47
|
osCopyright: string;
|
48
|
+
osProxyEndpoint: string;
|
46
49
|
hideResetControl: boolean;
|
47
50
|
resetControlImage: ResetControlImageEnum;
|
48
51
|
staticMode: boolean;
|
@@ -7,6 +7,7 @@ export declare function makeFeatureLayer(color: string, featureFill: boolean, bo
|
|
7
7
|
* features containing the coordinates of the provided point
|
8
8
|
* @param coord - xy coordinate
|
9
9
|
* @param apiKey - Ordnance Survey Features API key, sign up here: https://osdatahub.os.uk/plans
|
10
|
+
* @param proxyEndpoint - Endpoint to proxy all requests to Ordnance Survey
|
10
11
|
* @param supportClickFeatures - whether the featureSource should support `clickFeatures` mode or be cleared upfront
|
11
12
|
*/
|
12
|
-
export declare function getFeaturesAtPoint(coord: Array<number>, apiKey: any, supportClickFeatures: boolean): void;
|
13
|
+
export declare function getFeaturesAtPoint(coord: Array<number>, apiKey: any, proxyEndpoint: string, supportClickFeatures: boolean): void;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Tile as TileLayer } from "ol/layer";
|
2
2
|
import VectorTileLayer from "ol/layer/VectorTile";
|
3
|
-
import {
|
4
|
-
export declare function makeRasterBaseMap(
|
5
|
-
export declare function makeOsVectorTileBaseMap(
|
3
|
+
import { OSM } from "ol/source";
|
4
|
+
export declare function makeRasterBaseMap(apiKey: string, proxyEndpoint: string, copyright: string): TileLayer<OSM>;
|
5
|
+
export declare function makeOsVectorTileBaseMap(apiKey: string, proxyEndpoint: string, copyright: string): VectorTileLayer | undefined;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
declare type OSServices = "xyz" | "vectorTile" | "vectorTileStyle" | "places" | "features";
|
2
|
+
interface ServiceOptions {
|
3
|
+
service: OSServices;
|
4
|
+
apiKey: string;
|
5
|
+
proxyEndpoint: string;
|
6
|
+
params?: Record<string, string>;
|
7
|
+
}
|
8
|
+
export declare function constructURL(domain: string, path: string, params?: Record<string, string>): string;
|
9
|
+
export declare function getOSServiceURL({ service, apiKey, params, }: Omit<ServiceOptions, "proxyEndpoint">): string;
|
10
|
+
/**
|
11
|
+
* Generate a proxied OS service URL
|
12
|
+
* XXX: OS API key must be appended to requests by the proxy endpoint
|
13
|
+
*/
|
14
|
+
export declare function getProxyServiceURL({ service, proxyEndpoint, params, }: Omit<ServiceOptions, "apiKey">): string;
|
15
|
+
/**
|
16
|
+
* Get either an OS service URL, or a proxied endpoint to an OS service URL
|
17
|
+
*/
|
18
|
+
export declare function getServiceURL({ service, apiKey, proxyEndpoint, params, }: ServiceOptions): string;
|
19
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/types/test-utils.d.ts
CHANGED