@summeruse/ol 0.0.1-beta.5 → 0.1.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/CHANGELOG.md +26 -0
- package/dist/index.js +600 -521
- package/es/components/index.d.ts +1 -1
- package/es/components/n-ol-contextmenu/index.vue.mjs +14 -12
- package/es/components/n-ol-contextmenu/props.d.ts +2 -2
- package/es/components/n-ol-pointermove/index.vue.mjs +14 -14
- package/es/components/ol-map/index.vue.d.ts +1 -1
- package/es/components/ol-map/index.vue.mjs +1 -1
- package/es/components/ol-map/props.d.ts +2 -2
- package/es/components/ol-map/props.mjs +1 -1
- package/es/composables/common/index.d.ts +1 -1
- package/es/composables/common/index.mjs +2 -2
- package/es/composables/index.d.ts +2 -2
- package/es/composables/useDrawLineString/index.d.ts +10 -6
- package/es/composables/useDrawLineString/index.mjs +73 -69
- package/es/composables/useDrawPolygon/index.d.ts +10 -6
- package/es/composables/useDrawPolygon/index.mjs +65 -61
- package/es/composables/useGraticule/index.d.ts +5 -5
- package/es/composables/useGraticule/index.mjs +2 -2
- package/es/composables/useSwitchBaseLayer/index.d.ts +2 -2
- package/es/composables/useSwitchBaseLayer/index.mjs +12 -12
- package/es/index.mjs +64 -64
- package/es/utils/calculate/index.d.ts +10 -8
- package/es/utils/calculate/index.mjs +23 -8
- package/es/utils/distance/index.d.ts +2 -2
- package/es/utils/distance/index.mjs +8 -3
- package/es/utils/feature/index.d.ts +21 -21
- package/es/utils/feature/index.mjs +72 -44
- package/es/utils/format/index.d.ts +2 -2
- package/es/utils/format/index.mjs +6 -1
- package/es/utils/index.d.ts +2 -2
- package/es/utils/layer/index.d.ts +14 -14
- package/es/utils/layer/index.mjs +47 -40
- package/es/utils/projection/index.d.ts +8 -8
- package/es/utils/projection/index.mjs +21 -6
- package/es/utils/realCircle/index.d.ts +2 -2
- package/es/utils/realCircle/index.mjs +2 -2
- package/es/utils/style/index.d.ts +4 -4
- package/es/utils/style/index.mjs +10 -8
- package/lib/components/index.d.ts +1 -1
- package/lib/components/n-ol-contextmenu/index.vue.js +1 -1
- package/lib/components/n-ol-contextmenu/props.d.ts +2 -2
- package/lib/components/n-ol-pointermove/index.vue.js +1 -1
- package/lib/components/ol-map/index.vue.d.ts +1 -1
- package/lib/components/ol-map/index.vue.js +1 -1
- package/lib/components/ol-map/props.d.ts +2 -2
- package/lib/components/ol-map/props.js +1 -1
- package/lib/composables/common/index.d.ts +1 -1
- package/lib/composables/common/index.js +1 -1
- package/lib/composables/index.d.ts +2 -2
- package/lib/composables/useDrawLineString/index.d.ts +10 -6
- package/lib/composables/useDrawLineString/index.js +1 -1
- package/lib/composables/useDrawPolygon/index.d.ts +10 -6
- package/lib/composables/useDrawPolygon/index.js +1 -1
- package/lib/composables/useGraticule/index.d.ts +5 -5
- package/lib/composables/useGraticule/index.js +1 -1
- package/lib/composables/useSwitchBaseLayer/index.d.ts +2 -2
- package/lib/composables/useSwitchBaseLayer/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/utils/calculate/index.d.ts +10 -8
- package/lib/utils/calculate/index.js +1 -1
- package/lib/utils/distance/index.d.ts +2 -2
- package/lib/utils/distance/index.js +1 -1
- package/lib/utils/feature/index.d.ts +21 -21
- package/lib/utils/feature/index.js +1 -1
- package/lib/utils/format/index.d.ts +2 -2
- package/lib/utils/format/index.js +1 -1
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/layer/index.d.ts +14 -14
- package/lib/utils/layer/index.js +1 -1
- package/lib/utils/projection/index.d.ts +8 -8
- package/lib/utils/projection/index.js +1 -1
- package/lib/utils/realCircle/index.d.ts +2 -2
- package/lib/utils/realCircle/index.js +1 -1
- package/lib/utils/style/index.d.ts +4 -4
- package/lib/utils/style/index.js +1 -1
- package/package.json +20 -19
- package/es/components/common/render-v-node.vue.d.ts +0 -17
- package/es/components/common/render-v-node.vue.mjs +0 -22
- package/es/components/common/render-v-node.vue2.mjs +0 -4
- package/lib/components/common/render-v-node.vue.d.ts +0 -17
- package/lib/components/common/render-v-node.vue.js +0 -1
- package/lib/components/common/render-v-node.vue2.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Graticule as a } from "ol/layer";
|
|
2
2
|
import { Stroke as o } from "ol/style";
|
|
3
3
|
import { ref as i, watch as u, toValue as w } from "vue";
|
|
4
|
-
|
|
4
|
+
function h(e) {
|
|
5
5
|
const r = i(e.defaultShow || !1);
|
|
6
6
|
let t = new a({
|
|
7
7
|
strokeStyle: e.strokeStyle || new o({
|
|
@@ -38,7 +38,7 @@ const h = (e) => {
|
|
|
38
38
|
), {
|
|
39
39
|
showGraticule: r
|
|
40
40
|
};
|
|
41
|
-
}
|
|
41
|
+
}
|
|
42
42
|
export {
|
|
43
43
|
h as useGraticule
|
|
44
44
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Map as OLMap } from 'ol';
|
|
2
2
|
import { default as TileLayer } from 'ol/layer/Tile';
|
|
3
|
-
export declare
|
|
3
|
+
export declare function useSwitchBaseLayer(data: {
|
|
4
4
|
olMap: OLMap;
|
|
5
5
|
defaultLayerName?: string;
|
|
6
6
|
layers: {
|
|
7
7
|
[key: string]: TileLayer[];
|
|
8
8
|
};
|
|
9
|
-
})
|
|
9
|
+
}): {
|
|
10
10
|
visibleLayerName: import('vue').Ref<string, string>;
|
|
11
11
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
|
|
3
|
-
const r =
|
|
4
|
-
return Object.values(e.layers).
|
|
5
|
-
s.
|
|
1
|
+
import { ref as t, watch as o } from "vue";
|
|
2
|
+
function f(e) {
|
|
3
|
+
const r = t(e.defaultLayerName || Object.keys(e.layers)[0]);
|
|
4
|
+
return Object.values(e.layers).forEach((s) => {
|
|
5
|
+
s.forEach((a) => {
|
|
6
6
|
e.olMap.addLayer(a);
|
|
7
7
|
});
|
|
8
|
-
}),
|
|
8
|
+
}), o(
|
|
9
9
|
r,
|
|
10
10
|
() => {
|
|
11
|
-
Object.entries(e.layers).
|
|
12
|
-
const
|
|
13
|
-
a.
|
|
14
|
-
i.setVisible(
|
|
11
|
+
Object.entries(e.layers).forEach(([s, a]) => {
|
|
12
|
+
const c = s === r.value;
|
|
13
|
+
a.forEach((i) => {
|
|
14
|
+
i.setVisible(c);
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
},
|
|
@@ -19,7 +19,7 @@ const y = (e) => {
|
|
|
19
19
|
immediate: !0
|
|
20
20
|
}
|
|
21
21
|
), { visibleLayerName: r };
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
f as useSwitchBaseLayer
|
|
25
25
|
};
|
package/es/index.mjs
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { default as r } from "./components/n-ol-contextmenu/index.vue.mjs";
|
|
2
|
-
import { default as a } from "./components/ol-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { default as a } from "./components/n-ol-pointermove/index.vue.mjs";
|
|
3
|
+
import { default as i } from "./components/ol-map/index.vue.mjs";
|
|
4
|
+
import { olMapInjectionKey as l } from "./components/ol-map/props.mjs";
|
|
5
|
+
import { useDrawLineString as u } from "./composables/useDrawLineString/index.mjs";
|
|
6
|
+
import { useDrawPolygon as m } from "./composables/useDrawPolygon/index.mjs";
|
|
7
|
+
import { useGraticule as f } from "./composables/useGraticule/index.mjs";
|
|
8
|
+
import { useSwitchBaseLayer as p } from "./composables/useSwitchBaseLayer/index.mjs";
|
|
9
9
|
import { ONE_NM as E } from "./constants/distance.mjs";
|
|
10
10
|
import { EPSG_3857 as M, EPSG_4326 as y, WGS84Projection as G, WebMercatorProjection as L } from "./constants/projection.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { toOlAngle as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
11
|
+
import { getAngle as C, getArea as F, getCenter as O, getDestinationPoint as w, getExtentCenter as D, getLineLength as N } from "./utils/calculate/index.mjs";
|
|
12
|
+
import { kmToNauticalMiles as A, nauticalMilesToKm as W } from "./utils/distance/index.mjs";
|
|
13
|
+
import { createCircle as h, createCircleFeature as B, createFeature as K, createLineString as b, createLineStringFeature as k, createMultiLineString as v, createMultiLineStringFeature as I, createMultiPoint as R, createMultiPointFeature as U, createMultiPolygon as V, createMultiPolygonFeature as q, createPoint as z, createPointFeature as H, createPolygon as J, createPolygonFeature as Q } from "./utils/feature/index.mjs";
|
|
14
|
+
import { toOlAngle as Y, toTurfAngle as Z } from "./utils/format/index.mjs";
|
|
15
|
+
import { createVectorLayer as ee, getBingLayer as te, getOSMLayer as re, getTianDiTuLayer as oe, getTianDiTuUrl as ae } from "./utils/layer/index.mjs";
|
|
16
|
+
import { EPSG_3857ExtentToEPSG_4326 as ie, EPSG_3857ToEPSG_4326 as ce, EPSG_4326ExtentToEPSG_3857 as le, EPSG_4326ToEPSG_3857 as ge, mercatorExtentToWgs84 as ue, mercatorToWgs84 as xe, wgs84ExtentToMercator as me, wgs84ToMercator as Pe } from "./utils/projection/index.mjs";
|
|
17
|
+
import { getRealCircleCoordinates as Se } from "./utils/realCircle/index.mjs";
|
|
18
|
+
import { createCircleStyle as se, createStyle as Ee, createTextStyle as Te } from "./utils/style/index.mjs";
|
|
19
19
|
export {
|
|
20
20
|
M as EPSG_3857,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
ie as EPSG_3857ExtentToEPSG_4326,
|
|
22
|
+
ce as EPSG_3857ToEPSG_4326,
|
|
23
23
|
y as EPSG_4326,
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
le as EPSG_4326ExtentToEPSG_3857,
|
|
25
|
+
ge as EPSG_4326ToEPSG_3857,
|
|
26
26
|
r as NOlContextmenu,
|
|
27
|
-
|
|
27
|
+
a as NOlPointermove,
|
|
28
28
|
E as ONE_NM,
|
|
29
|
-
|
|
29
|
+
i as OlMap,
|
|
30
30
|
G as WGS84Projection,
|
|
31
31
|
L as WebMercatorProjection,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
32
|
+
h as createCircle,
|
|
33
|
+
B as createCircleFeature,
|
|
34
|
+
se as createCircleStyle,
|
|
35
|
+
K as createFeature,
|
|
36
|
+
b as createLineString,
|
|
37
|
+
k as createLineStringFeature,
|
|
38
|
+
v as createMultiLineString,
|
|
39
|
+
I as createMultiLineStringFeature,
|
|
40
|
+
R as createMultiPoint,
|
|
41
|
+
U as createMultiPointFeature,
|
|
42
|
+
V as createMultiPolygon,
|
|
43
|
+
q as createMultiPolygonFeature,
|
|
44
|
+
z as createPoint,
|
|
45
|
+
H as createPointFeature,
|
|
46
|
+
J as createPolygon,
|
|
47
|
+
Q as createPolygonFeature,
|
|
48
|
+
Ee as createStyle,
|
|
49
|
+
Te as createTextStyle,
|
|
50
|
+
ee as createVectorLayer,
|
|
51
|
+
C as getAngle,
|
|
52
|
+
F as getArea,
|
|
53
|
+
te as getBingLayer,
|
|
54
|
+
O as getCenter,
|
|
55
|
+
w as getDestinationPoint,
|
|
56
|
+
D as getExtentCenter,
|
|
57
|
+
N as getLineLength,
|
|
58
|
+
re as getOSMLayer,
|
|
59
|
+
Se as getRealCircleCoordinates,
|
|
60
|
+
oe as getTianDiTuLayer,
|
|
61
|
+
ae as getTianDiTuUrl,
|
|
62
|
+
A as kmToNauticalMiles,
|
|
63
|
+
ue as mercatorExtentToWgs84,
|
|
64
|
+
xe as mercatorToWgs84,
|
|
65
|
+
W as nauticalMilesToKm,
|
|
66
|
+
l as olMapInjectionKey,
|
|
67
|
+
Y as toOlAngle,
|
|
68
|
+
Z as toTurfAngle,
|
|
69
|
+
u as useDrawLineString,
|
|
70
|
+
m as useDrawPolygon,
|
|
71
|
+
f as useGraticule,
|
|
72
|
+
p as useSwitchBaseLayer,
|
|
73
|
+
me as wgs84ExtentToMercator,
|
|
74
|
+
Pe as wgs84ToMercator
|
|
75
75
|
};
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { Coordinate } from 'ol/coordinate';
|
|
2
2
|
import { Extent } from 'ol/extent';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* 计算已知方位距离的目标点
|
|
4
5
|
* @param coordinates 起点坐标 WGS84 EPSG:4326
|
|
5
6
|
* @param distance 距离,单位为米
|
|
6
7
|
* @param azimuth 方位角,单位为度
|
|
7
8
|
* @returns 目标点坐标 WGS84 EPSG:4326
|
|
8
9
|
*/
|
|
9
|
-
export declare
|
|
10
|
-
/**
|
|
10
|
+
export declare function getDestinationPoint(coordinates: Coordinate, distance: number, azimuth: number): Coordinate;
|
|
11
|
+
/**
|
|
12
|
+
* 计算线段的长度
|
|
11
13
|
* @param coordinates 线段坐标 WGS84 EPSG:4326
|
|
12
14
|
* @returns 线段长度,单位为米
|
|
13
15
|
*/
|
|
14
|
-
export declare
|
|
16
|
+
export declare function getLineLength(coordinates: Coordinate[]): number;
|
|
15
17
|
/** 计算面积 */
|
|
16
|
-
export declare
|
|
18
|
+
export declare function getArea(coordinates: Coordinate[][]): number;
|
|
17
19
|
/** 计算2点之间的角度 */
|
|
18
|
-
export declare
|
|
20
|
+
export declare function getAngle(start: Coordinate, end: Coordinate): number;
|
|
19
21
|
/** 计算2点的中心点 */
|
|
20
|
-
export declare
|
|
22
|
+
export declare function getCenter(start: Coordinate, end: Coordinate): Coordinate;
|
|
21
23
|
/** 计算Extent中心点 */
|
|
22
|
-
export declare
|
|
24
|
+
export declare function getExtentCenter(extent: Extent): Coordinate;
|
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import { destination as r, lineString as o, length as i, area as g, polygon as
|
|
2
|
-
import { toTurfAngle as m, toOlAngle as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { destination as r, lineString as o, length as i, area as g, polygon as u, bearing as f, midpoint as c } from "@turf/turf";
|
|
2
|
+
import { toTurfAngle as m, toOlAngle as s } from "../format/index.mjs";
|
|
3
|
+
function d(n, t, e) {
|
|
4
|
+
return r(n, t, m(e), { units: "meters" }).geometry.coordinates;
|
|
5
|
+
}
|
|
6
|
+
function A(n) {
|
|
7
|
+
const t = o(n);
|
|
8
|
+
return i(t, { units: "meters" });
|
|
9
|
+
}
|
|
10
|
+
function y(n) {
|
|
11
|
+
return g(u(n));
|
|
12
|
+
}
|
|
13
|
+
function L(n, t) {
|
|
14
|
+
return s(f(n, t));
|
|
15
|
+
}
|
|
16
|
+
function a(n, t) {
|
|
17
|
+
return c(n, t).geometry.coordinates;
|
|
18
|
+
}
|
|
19
|
+
function h(n) {
|
|
20
|
+
return a([n[0], n[1]], [n[2], n[3]]);
|
|
21
|
+
}
|
|
7
22
|
export {
|
|
8
23
|
L as getAngle,
|
|
9
24
|
y as getArea,
|
|
10
|
-
|
|
11
|
-
|
|
25
|
+
a as getCenter,
|
|
26
|
+
d as getDestinationPoint,
|
|
12
27
|
h as getExtentCenter,
|
|
13
28
|
A as getLineLength
|
|
14
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** 公里转海里 */
|
|
2
|
-
export declare
|
|
2
|
+
export declare function kmToNauticalMiles(km: number): number;
|
|
3
3
|
/** 海里转公里 */
|
|
4
|
-
export declare
|
|
4
|
+
export declare function nauticalMilesToKm(nauticalMiles: number): number;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ONE_NM as e } from "../../constants/distance.mjs";
|
|
2
|
-
|
|
2
|
+
function n(t) {
|
|
3
|
+
return t * 1e3 / e;
|
|
4
|
+
}
|
|
5
|
+
function o(t) {
|
|
6
|
+
return t * e / 1e3;
|
|
7
|
+
}
|
|
3
8
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
9
|
+
n as kmToNauticalMiles,
|
|
10
|
+
o as nauticalMilesToKm
|
|
6
11
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Feature } from 'ol';
|
|
2
|
-
import { Circle, Geometry, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from 'ol/geom';
|
|
3
|
-
import { StyleOptions } from '../style';
|
|
4
|
-
import { Style } from 'ol/style';
|
|
5
1
|
import { Coordinate } from 'ol/coordinate';
|
|
6
|
-
|
|
2
|
+
import { Geometry, Circle, LineString, MultiLineString, MultiPoint, MultiPolygon, Point, Polygon } from 'ol/geom';
|
|
3
|
+
import { Style } from 'ol/style';
|
|
4
|
+
import { StyleOptions } from '../style';
|
|
5
|
+
import { Feature } from 'ol';
|
|
6
|
+
export interface FeatureOptions {
|
|
7
7
|
style?: Style;
|
|
8
8
|
styleOptions?: StyleOptions;
|
|
9
9
|
geometry?: Geometry;
|
|
10
10
|
[key: string]: any;
|
|
11
|
-
}
|
|
12
|
-
export declare
|
|
13
|
-
export declare
|
|
14
|
-
export declare
|
|
15
|
-
export declare
|
|
16
|
-
export declare
|
|
17
|
-
export declare
|
|
18
|
-
export declare
|
|
19
|
-
export declare
|
|
20
|
-
export declare
|
|
21
|
-
export declare
|
|
22
|
-
export declare
|
|
23
|
-
export declare
|
|
24
|
-
export declare
|
|
25
|
-
export declare
|
|
26
|
-
export declare
|
|
11
|
+
}
|
|
12
|
+
export declare function createPoint(coordinates: Coordinate): Point;
|
|
13
|
+
export declare function createLineString(coordinates: Coordinate[]): LineString;
|
|
14
|
+
export declare function createPolygon(coordinates: Coordinate[][]): Polygon;
|
|
15
|
+
export declare function createCircle(center: Coordinate, radius: number): Circle;
|
|
16
|
+
export declare function createMultiPoint(coordinates: Coordinate[]): MultiPoint;
|
|
17
|
+
export declare function createMultiLineString(coordinates: Coordinate[][]): MultiLineString;
|
|
18
|
+
export declare function createMultiPolygon(coordinates: Coordinate[][][]): MultiPolygon;
|
|
19
|
+
export declare function createFeature(options?: FeatureOptions): Feature<Geometry>;
|
|
20
|
+
export declare function createPointFeature(coordinates: Coordinate, options?: FeatureOptions): Feature<Point>;
|
|
21
|
+
export declare function createLineStringFeature(coordinates: Coordinate[], options?: FeatureOptions): Feature<LineString>;
|
|
22
|
+
export declare function createPolygonFeature(coordinates: Coordinate[][], options?: FeatureOptions): Feature<Polygon>;
|
|
23
|
+
export declare function createCircleFeature(center: Coordinate, radius: number, options?: FeatureOptions): Feature<Circle>;
|
|
24
|
+
export declare function createMultiPointFeature(coordinates: Coordinate[], options?: FeatureOptions): Feature<MultiPoint>;
|
|
25
|
+
export declare function createMultiLineStringFeature(coordinates: Coordinate[][], options?: FeatureOptions): Feature<MultiLineString>;
|
|
26
|
+
export declare function createMultiPolygonFeature(coordinates: Coordinate[][][], options?: FeatureOptions): Feature<MultiPolygon>;
|
|
@@ -1,69 +1,97 @@
|
|
|
1
|
-
import { Feature as
|
|
2
|
-
import { Point as
|
|
3
|
-
import { createStyle as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Feature as i } from "ol";
|
|
2
|
+
import { Point as u, LineString as c, Polygon as a, Circle as l, MultiPoint as f, MultiLineString as g, MultiPolygon as y } from "ol/geom";
|
|
3
|
+
import { createStyle as s } from "../style/index.mjs";
|
|
4
|
+
function m(e) {
|
|
5
|
+
return new u(e);
|
|
6
|
+
}
|
|
7
|
+
function P(e) {
|
|
8
|
+
return new c(e);
|
|
9
|
+
}
|
|
10
|
+
function F(e) {
|
|
11
|
+
return new a(e);
|
|
12
|
+
}
|
|
13
|
+
function M(e, t) {
|
|
14
|
+
return new l(e, t);
|
|
15
|
+
}
|
|
16
|
+
function w(e) {
|
|
17
|
+
return new f(e);
|
|
18
|
+
}
|
|
19
|
+
function S(e) {
|
|
20
|
+
return new g(e);
|
|
21
|
+
}
|
|
22
|
+
function p(e) {
|
|
23
|
+
return new y(e);
|
|
24
|
+
}
|
|
25
|
+
function r(e) {
|
|
26
|
+
const { styleOptions: t, ...n } = e ?? {}, o = t ? s(t) : n.style;
|
|
27
|
+
return new i({
|
|
28
|
+
...n,
|
|
8
29
|
style: o
|
|
9
30
|
});
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
31
|
+
}
|
|
32
|
+
function b(e, t) {
|
|
33
|
+
const n = m(e);
|
|
34
|
+
return r({
|
|
13
35
|
...t,
|
|
14
|
-
geometry:
|
|
36
|
+
geometry: n
|
|
15
37
|
});
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
38
|
+
}
|
|
39
|
+
function d(e, t) {
|
|
40
|
+
const n = P(e);
|
|
41
|
+
return r({
|
|
19
42
|
...t,
|
|
20
|
-
geometry:
|
|
43
|
+
geometry: n
|
|
21
44
|
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
45
|
+
}
|
|
46
|
+
function h(e, t) {
|
|
47
|
+
const n = F(e);
|
|
48
|
+
return r({
|
|
25
49
|
...t,
|
|
26
|
-
geometry:
|
|
50
|
+
geometry: n
|
|
27
51
|
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
52
|
+
}
|
|
53
|
+
function j(e, t, n) {
|
|
54
|
+
const o = M(e, t);
|
|
55
|
+
return r({
|
|
56
|
+
...n,
|
|
32
57
|
geometry: o
|
|
33
58
|
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
59
|
+
}
|
|
60
|
+
function k(e, t) {
|
|
61
|
+
const n = w(e);
|
|
62
|
+
return r({
|
|
37
63
|
...t,
|
|
38
|
-
geometry:
|
|
64
|
+
geometry: n
|
|
39
65
|
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
66
|
+
}
|
|
67
|
+
function q(e, t) {
|
|
68
|
+
const n = S(e);
|
|
69
|
+
return r({
|
|
43
70
|
...t,
|
|
44
|
-
geometry:
|
|
71
|
+
geometry: n
|
|
45
72
|
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
73
|
+
}
|
|
74
|
+
function v(e, t) {
|
|
75
|
+
const n = p(e);
|
|
76
|
+
return r({
|
|
49
77
|
...t,
|
|
50
|
-
geometry:
|
|
78
|
+
geometry: n
|
|
51
79
|
});
|
|
52
|
-
}
|
|
80
|
+
}
|
|
53
81
|
export {
|
|
54
|
-
|
|
82
|
+
M as createCircle,
|
|
55
83
|
j as createCircleFeature,
|
|
56
|
-
|
|
57
|
-
|
|
84
|
+
r as createFeature,
|
|
85
|
+
P as createLineString,
|
|
58
86
|
d as createLineStringFeature,
|
|
59
|
-
|
|
87
|
+
S as createMultiLineString,
|
|
60
88
|
q as createMultiLineStringFeature,
|
|
61
|
-
|
|
89
|
+
w as createMultiPoint,
|
|
62
90
|
k as createMultiPointFeature,
|
|
63
|
-
|
|
91
|
+
p as createMultiPolygon,
|
|
64
92
|
v as createMultiPolygonFeature,
|
|
65
|
-
|
|
93
|
+
m as createPoint,
|
|
66
94
|
b as createPointFeature,
|
|
67
|
-
|
|
95
|
+
F as createPolygon,
|
|
68
96
|
h as createPolygonFeature
|
|
69
97
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** 任意角度转换为 0-360 */
|
|
2
|
-
export declare
|
|
2
|
+
export declare function toOlAngle(angle: number): number;
|
|
3
3
|
/** 任意角度转换为 -180-180 */
|
|
4
|
-
export declare
|
|
4
|
+
export declare function toTurfAngle(angle: number): number;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
function t(r) {
|
|
2
|
+
return r < 0 ? t(r + 360) : r > 360 ? t(r - 360) : r;
|
|
3
|
+
}
|
|
4
|
+
function u(r) {
|
|
5
|
+
return r < -180 ? u(r + 360) : r > 180 ? u(r - 360) : r;
|
|
6
|
+
}
|
|
2
7
|
export {
|
|
3
8
|
t as toOlAngle,
|
|
4
9
|
u as toTurfAngle
|
package/es/utils/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './layer';
|
|
2
1
|
export * from './calculate';
|
|
3
2
|
export * from './distance';
|
|
3
|
+
export * from './feature';
|
|
4
4
|
export * from './format';
|
|
5
|
+
export * from './layer';
|
|
5
6
|
export * from './projection';
|
|
6
7
|
export * from './realCircle';
|
|
7
8
|
export * from './style';
|
|
8
|
-
export * from './feature';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Feature } from 'ol';
|
|
2
|
+
import { Geometry } from 'ol/geom';
|
|
2
3
|
import { ProjectionLike } from 'ol/proj';
|
|
4
|
+
import { StyleOptions } from '../style';
|
|
5
|
+
import { Tile as TileLayer } from 'ol/layer';
|
|
6
|
+
import { default as VectorLayer } from 'ol/layer/Vector';
|
|
3
7
|
import { BingMaps, OSM, XYZ } from 'ol/source';
|
|
4
8
|
import { default as VectorSource } from 'ol/source/Vector';
|
|
5
|
-
import { default as VectorLayer } from 'ol/layer/Vector';
|
|
6
|
-
import { Geometry } from 'ol/geom';
|
|
7
|
-
import { Feature } from 'ol';
|
|
8
|
-
import { StyleOptions } from '../style';
|
|
9
9
|
/**
|
|
10
10
|
* 天地图类型
|
|
11
11
|
* vec: 矢量底图
|
|
@@ -17,35 +17,35 @@ import { StyleOptions } from '../style';
|
|
|
17
17
|
* ibo: 全球境界
|
|
18
18
|
*/
|
|
19
19
|
export type T_MAP_TYPE = 'vec' | 'cva' | 'img' | 'cia' | 'ter' | 'cta' | 'ibo';
|
|
20
|
-
export declare
|
|
20
|
+
export declare function getTianDiTuUrl(data: {
|
|
21
21
|
url?: string;
|
|
22
22
|
type: T_MAP_TYPE;
|
|
23
23
|
projection: ProjectionLike;
|
|
24
24
|
key: string;
|
|
25
|
-
})
|
|
26
|
-
export declare
|
|
25
|
+
}): string;
|
|
26
|
+
export declare function getTianDiTuLayer(data: {
|
|
27
27
|
url?: string;
|
|
28
28
|
projection: ProjectionLike;
|
|
29
29
|
zIndex?: number;
|
|
30
30
|
key: string;
|
|
31
31
|
type: T_MAP_TYPE;
|
|
32
32
|
className?: string;
|
|
33
|
-
})
|
|
34
|
-
export declare
|
|
33
|
+
}): TileLayer<XYZ>;
|
|
34
|
+
export declare function getBingLayer({ name, zIndex, key, className, }: {
|
|
35
35
|
name: string;
|
|
36
36
|
zIndex?: number;
|
|
37
37
|
key: string;
|
|
38
38
|
className?: string;
|
|
39
|
-
})
|
|
40
|
-
export declare
|
|
39
|
+
}): TileLayer<BingMaps>;
|
|
40
|
+
export declare function getOSMLayer(data?: {
|
|
41
41
|
zIndex?: number;
|
|
42
42
|
className?: string;
|
|
43
|
-
})
|
|
43
|
+
}): TileLayer<OSM>;
|
|
44
44
|
export type _VectorLayerOptions = ConstructorParameters<typeof VectorLayer>[0];
|
|
45
45
|
export type VectorLayerOptions = _VectorLayerOptions & {
|
|
46
46
|
styleOptions?: StyleOptions;
|
|
47
47
|
};
|
|
48
|
-
export declare
|
|
48
|
+
export declare function createVectorLayer<T extends Geometry = Geometry>(options?: VectorLayerOptions): {
|
|
49
49
|
source: VectorSource<Feature<T>>;
|
|
50
50
|
layer: VectorLayer<VectorSource<import('ol/Feature').FeatureLike>, import('ol/Feature').FeatureLike>;
|
|
51
51
|
};
|