@opensystemslab/map 0.6.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/component-lib.es.js +7952 -7914
- package/dist/component-lib.umd.js +36 -36
- package/dist/index.html +1 -1
- package/dist/style.css +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/components/my-map/utils.d.ts +11 -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
@@ -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;
|
@@ -1,6 +1,10 @@
|
|
1
|
+
import { GeoJSONObject } from "ol/format/GeoJSON";
|
1
2
|
import Geometry from "ol/geom/Geometry";
|
3
|
+
import { Feature } from "ol/index";
|
2
4
|
import Map from "ol/Map";
|
3
5
|
import { Vector } from "ol/source";
|
6
|
+
import VectorSource from "ol/source/Vector";
|
7
|
+
import { ProjectionEnum } from "./projections";
|
4
8
|
export declare type AreaUnitEnum = "m2" | "ha";
|
5
9
|
/**
|
6
10
|
* Calculate & format the area of a polygon
|
@@ -24,3 +28,10 @@ export declare function fitToData(olMap: Map, olSource: Vector<Geometry>, buffer
|
|
24
28
|
* @returns - a 'rgba(r,g,b,a)' string
|
25
29
|
*/
|
26
30
|
export declare function hexToRgba(hexColor: string, alpha: number): string;
|
31
|
+
/**
|
32
|
+
* Generate a geojson object from a vector source or an array of features
|
33
|
+
* @param source
|
34
|
+
* @param projection
|
35
|
+
* @returns
|
36
|
+
*/
|
37
|
+
export declare function makeGeoJSON(source: VectorSource<Geometry> | Feature<Geometry>[], projection: ProjectionEnum): GeoJSONObject;
|
@@ -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