@opensystemslab/map 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/component-lib.es.js +5000 -4966
- package/dist/component-lib.umd.js +35 -35
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/types/components/address-autocomplete/index.d.ts +1 -0
- package/types/components/my-map/index.d.ts +1 -0
- 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/dist/index.html
CHANGED
@@ -43,7 +43,7 @@
|
|
43
43
|
<div style="display:flex;flex-direction:column;">
|
44
44
|
<h1 style="color:red;font-family:Inter,Helvetica,sans-serif;font-size:16px;">*** This is a testing sandbox - these components are unaware of each other! ***</h1>
|
45
45
|
<div style="margin-bottom:1em">
|
46
|
-
<my-map zoom="20" maxZoom="23" drawMode drawPointer="dot" id="example-map" showScale />
|
46
|
+
<my-map zoom="20" maxZoom="23" drawMode drawPointer="dot" id="example-map" showScale disableVectorTiles osProxyEndpoint="https://api.editor.planx.dev/proxy/ordnance-survey" />
|
47
47
|
</div>
|
48
48
|
<div style="margin-bottom:1em">
|
49
49
|
<postcode-search hintText="Optional hint text shows up here" id="example-postcode" />
|
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,7 +42,7 @@
|
|
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.
|
45
|
+
"@vitest/ui": "^0.26.1",
|
46
46
|
"happy-dom": "^8.1.0",
|
47
47
|
"husky": "^8.0.1",
|
48
48
|
"lint-staged": "^13.0.3",
|
@@ -51,7 +51,7 @@
|
|
51
51
|
"sass": "^1.44.0",
|
52
52
|
"typescript": "^4.3.5",
|
53
53
|
"vite": "^4.0.0",
|
54
|
-
"vitest": "0.
|
54
|
+
"vitest": "0.26.1",
|
55
55
|
"wait-for-expect": "^3.0.2"
|
56
56
|
},
|
57
57
|
"engines": {
|
@@ -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