@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
package/es/utils/layer/index.mjs
CHANGED
|
@@ -1,58 +1,65 @@
|
|
|
1
1
|
import { Tile as c } from "ol/layer";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { createStyle as
|
|
7
|
-
|
|
8
|
-
const { type: r = "img", projection: o = i, key:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const { zIndex: r, projection: o, className:
|
|
2
|
+
import l from "ol/layer/Vector";
|
|
3
|
+
import { XYZ as u, BingMaps as y, OSM as m } from "ol/source";
|
|
4
|
+
import T from "ol/source/Vector";
|
|
5
|
+
import { WebMercatorProjection as i, WGS84Projection as p } from "../../constants/projection.mjs";
|
|
6
|
+
import { createStyle as f } from "../style/index.mjs";
|
|
7
|
+
function E(e) {
|
|
8
|
+
const { type: r = "img", projection: o = i, key: n } = e, t = e.url || "https://t{0-4}.tianditu.gov.cn", s = `&tk=${n}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}`;
|
|
9
|
+
return `${t}/${r}_${o === p ? "c" : o === i ? "w" : "c"}/wmts?LAYER=${r}${s}`;
|
|
10
|
+
}
|
|
11
|
+
function R(e) {
|
|
12
|
+
const { zIndex: r, projection: o, className: n } = e;
|
|
13
13
|
return new c({
|
|
14
|
-
className:
|
|
15
|
-
source: new
|
|
16
|
-
url:
|
|
14
|
+
className: n,
|
|
15
|
+
source: new u({
|
|
16
|
+
url: E(e),
|
|
17
17
|
projection: o,
|
|
18
18
|
crossOrigin: "Anonymous"
|
|
19
19
|
}),
|
|
20
20
|
zIndex: r
|
|
21
21
|
});
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
|
+
function j({
|
|
23
24
|
name: e,
|
|
24
25
|
zIndex: r,
|
|
25
26
|
key: o,
|
|
26
|
-
className:
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
className: n
|
|
28
|
+
}) {
|
|
29
|
+
return new c({
|
|
30
|
+
className: n,
|
|
31
|
+
source: new y({
|
|
32
|
+
key: o,
|
|
33
|
+
imagerySet: e,
|
|
34
|
+
placeholderTiles: !1
|
|
35
|
+
}),
|
|
36
|
+
zIndex: r
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function x(e) {
|
|
40
|
+
return new c({
|
|
41
|
+
className: e == null ? void 0 : e.className,
|
|
42
|
+
source: new m({
|
|
43
|
+
crossOrigin: "Anonymous"
|
|
44
|
+
}),
|
|
45
|
+
zIndex: e == null ? void 0 : e.zIndex
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function A(e) {
|
|
49
|
+
const { styleOptions: r, ...o } = e || {}, n = r ? f(r) : void 0, t = new T(), s = new l({
|
|
50
|
+
source: t,
|
|
44
51
|
...o,
|
|
45
|
-
style:
|
|
52
|
+
style: n || o.style
|
|
46
53
|
});
|
|
47
54
|
return {
|
|
48
|
-
source:
|
|
55
|
+
source: t,
|
|
49
56
|
layer: s
|
|
50
57
|
};
|
|
51
|
-
}
|
|
58
|
+
}
|
|
52
59
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
60
|
+
A as createVectorLayer,
|
|
61
|
+
j as getBingLayer,
|
|
62
|
+
x as getOSMLayer,
|
|
56
63
|
R as getTianDiTuLayer,
|
|
57
|
-
|
|
64
|
+
E as getTianDiTuUrl
|
|
58
65
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Coordinate } from 'ol/coordinate';
|
|
2
2
|
import { Extent } from 'ol/extent';
|
|
3
3
|
/** WGS84坐标转墨卡托 */
|
|
4
|
-
export declare
|
|
4
|
+
export declare function wgs84ToMercator(coordinate: Coordinate): Coordinate;
|
|
5
5
|
/** WGS84坐标转墨卡托 */
|
|
6
|
-
export declare const EPSG_4326ToEPSG_3857:
|
|
6
|
+
export declare const EPSG_4326ToEPSG_3857: typeof wgs84ToMercator;
|
|
7
7
|
/** 墨卡托坐标转WGS84 */
|
|
8
|
-
export declare
|
|
8
|
+
export declare function mercatorToWgs84(coordinate: Coordinate): Coordinate;
|
|
9
9
|
/** 墨卡托坐标转WGS84 */
|
|
10
|
-
export declare const EPSG_3857ToEPSG_4326:
|
|
10
|
+
export declare const EPSG_3857ToEPSG_4326: typeof mercatorToWgs84;
|
|
11
11
|
/** WGS84范围转墨卡托 */
|
|
12
|
-
export declare
|
|
12
|
+
export declare function wgs84ExtentToMercator(extent: Extent): Extent;
|
|
13
13
|
/** WGS84范围转墨卡托 */
|
|
14
|
-
export declare const EPSG_4326ExtentToEPSG_3857:
|
|
14
|
+
export declare const EPSG_4326ExtentToEPSG_3857: typeof wgs84ExtentToMercator;
|
|
15
15
|
/** 墨卡托范围转WGS84 */
|
|
16
|
-
export declare
|
|
16
|
+
export declare function mercatorExtentToWgs84(extent: Extent): Extent;
|
|
17
17
|
/** 墨卡托范围转WGS84 */
|
|
18
|
-
export declare const EPSG_3857ExtentToEPSG_4326:
|
|
18
|
+
export declare const EPSG_3857ExtentToEPSG_4326: typeof mercatorExtentToWgs84;
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
import { transform as n, transformExtent as E } from "ol/proj";
|
|
2
2
|
import { EPSG_4326 as o, EPSG_3857 as r } from "../../constants/projection.mjs";
|
|
3
|
-
|
|
3
|
+
function e(t) {
|
|
4
|
+
return n(t, o, r);
|
|
5
|
+
}
|
|
6
|
+
const _ = e;
|
|
7
|
+
function c(t) {
|
|
8
|
+
return n(t, r, o);
|
|
9
|
+
}
|
|
10
|
+
const f = c;
|
|
11
|
+
function s(t) {
|
|
12
|
+
return E(t, o, r);
|
|
13
|
+
}
|
|
14
|
+
const m = s;
|
|
15
|
+
function G(t) {
|
|
16
|
+
return E(t, r, o);
|
|
17
|
+
}
|
|
18
|
+
const u = G;
|
|
4
19
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
20
|
+
u as EPSG_3857ExtentToEPSG_4326,
|
|
21
|
+
f as EPSG_3857ToEPSG_4326,
|
|
22
|
+
m as EPSG_4326ExtentToEPSG_3857,
|
|
8
23
|
_ as EPSG_4326ToEPSG_3857,
|
|
9
24
|
G as mercatorExtentToWgs84,
|
|
10
|
-
|
|
11
|
-
|
|
25
|
+
c as mercatorToWgs84,
|
|
26
|
+
s as wgs84ExtentToMercator,
|
|
12
27
|
e as wgs84ToMercator
|
|
13
28
|
};
|
|
@@ -3,7 +3,7 @@ import { Coordinate } from 'ol/coordinate';
|
|
|
3
3
|
* 获取一个地理圆形的坐标点
|
|
4
4
|
* @param coordinate 中心坐标 EPSG:4326 WGS84
|
|
5
5
|
* @param radius 单位:米
|
|
6
|
-
* @param [sides
|
|
6
|
+
* @param [sides] 边数
|
|
7
7
|
* @returns 伪圆形坐标 EPSG:4326 WGS84
|
|
8
8
|
*/
|
|
9
|
-
export declare
|
|
9
|
+
export declare function getRealCircleCoordinates(coordinate: Coordinate, radius: number, sides?: number): Coordinate[][];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { getDestinationPoint as s } from "../calculate/index.mjs";
|
|
2
|
-
|
|
2
|
+
function c(e, n, i = 60) {
|
|
3
3
|
const o = [], r = 360 / i;
|
|
4
4
|
for (let t = -180; t < 180; t = t + r)
|
|
5
5
|
o.push(s(e, n, t));
|
|
6
6
|
return [o];
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
export {
|
|
9
9
|
c as getRealCircleCoordinates
|
|
10
10
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fill, Icon, Stroke, Style,
|
|
1
|
+
import { Circle, Fill, Icon, Stroke, Style, Text } from 'ol/style';
|
|
2
2
|
export type FillOptions = ConstructorParameters<typeof Fill>[0];
|
|
3
3
|
export type StrokeOptions = ConstructorParameters<typeof Stroke>[0];
|
|
4
4
|
export type IconOptions = ConstructorParameters<typeof Icon>[0];
|
|
@@ -22,6 +22,6 @@ export type StyleOptions = _StyleOptions & {
|
|
|
22
22
|
circleOptions?: CircleOptions;
|
|
23
23
|
textOptions?: TextOptions;
|
|
24
24
|
};
|
|
25
|
-
export declare
|
|
26
|
-
export declare
|
|
27
|
-
export declare
|
|
25
|
+
export declare function createCircleStyle(options: CircleOptions): Circle;
|
|
26
|
+
export declare function createTextStyle(options: TextOptions): Text;
|
|
27
|
+
export declare function createStyle(options: StyleOptions): Style;
|
package/es/utils/style/index.mjs
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { Circle as O, Stroke as s, Fill as c, Text as
|
|
2
|
-
|
|
1
|
+
import { Circle as O, Stroke as s, Fill as c, Text as f, Icon as u, Style as a } from "ol/style";
|
|
2
|
+
function S(n) {
|
|
3
3
|
const { fillOptions: o, strokeOptions: t, ...e } = n;
|
|
4
4
|
return new O({
|
|
5
5
|
...e,
|
|
6
6
|
fill: o ? new c(o) : void 0,
|
|
7
7
|
stroke: t ? new s(t) : void 0
|
|
8
8
|
});
|
|
9
|
-
}
|
|
9
|
+
}
|
|
10
|
+
function g(n) {
|
|
10
11
|
const { fillOptions: o, strokeOptions: t, backgroundFillOptions: e, backgroundStrokeOptions: i, ...r } = n;
|
|
11
|
-
return new
|
|
12
|
+
return new f({
|
|
12
13
|
...r,
|
|
13
14
|
fill: o ? new c(o) : void 0,
|
|
14
15
|
stroke: t ? new s(t) : void 0,
|
|
15
16
|
backgroundFill: e ? new c(e) : void 0,
|
|
16
17
|
backgroundStroke: i ? new s(i) : void 0
|
|
17
18
|
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
}
|
|
20
|
+
function b(n) {
|
|
21
|
+
const { fillOptions: o, strokeOptions: t, iconOptions: e, circleOptions: i, textOptions: r, ...l } = n, d = o ? new c(o) : void 0, k = t ? new s(t) : void 0, p = e ? new u(e) : void 0, w = i ? S(i) : void 0, v = r ? g(r) : void 0;
|
|
22
|
+
return new a({
|
|
21
23
|
...l,
|
|
22
24
|
fill: d,
|
|
23
25
|
stroke: k,
|
|
24
26
|
image: p || w,
|
|
25
27
|
text: v
|
|
26
28
|
});
|
|
27
|
-
}
|
|
29
|
+
}
|
|
28
30
|
export {
|
|
29
31
|
S as createCircleStyle,
|
|
30
32
|
b as createStyle,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),d=require("naive-ui"),f=t.defineComponent({__name:"index",props:{olMap:{},createOptions:{type:Function}},setup(
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),d=require("naive-ui"),f=t.defineComponent({__name:"index",props:{olMap:{},createOptions:{type:Function}},setup(u){const c=u,{olMap:i}=c,o=t.ref({visible:!1,x:0,y:0});function a(){o.value.visible=!1}const l=t.ref();t.onMounted(()=>{const s=i.getViewport();s&&(s.oncontextmenu=e=>{e.preventDefault();const n=i.getEventPixel(e),p=i.getEventCoordinate(e),v=i.getFeaturesAtPixel(n);l.value=c.createOptions({event:e,pixel:n,coordinate:p,features:v}),o.value={visible:!0,x:e.clientX,y:e.clientY}})});function r(s,e){const{onClick:n}=e;n&&n(),o.value.visible=!1}return(s,e)=>(t.openBlock(),t.createBlock(t.unref(d.NDropdown),{placement:"bottom-start",trigger:"manual",show:l.value&&l.value.length>0&&o.value.visible,x:o.value.x,y:o.value.y,options:l.value,"on-clickoutside":a,onSelect:r},null,8,["show","x","y","options"]))}});exports.default=f;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Map as OLMap } from 'ol';
|
|
2
1
|
import { DropdownMixedOption } from 'naive-ui/es/dropdown/src/interface';
|
|
3
|
-
import {
|
|
2
|
+
import { Map as OLMap } from 'ol';
|
|
4
3
|
import { Coordinate } from 'ol/coordinate';
|
|
5
4
|
import { FeatureLike } from 'ol/Feature';
|
|
5
|
+
import { Pixel } from 'ol/pixel';
|
|
6
6
|
export interface NOlContextmenuOptions {
|
|
7
7
|
event: MouseEvent;
|
|
8
8
|
pixel: Pixel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("@summeruse/common"),m=require("naive-ui"),w=e.defineComponent({__name:"index",props:{olMap:{},createOptions:{type:Function}},setup(u){const n=u,o=e.ref({visible:!1,x:0,y:0}),r=e.shallowRef(),s=e.ref("bottom-start"),i=e.ref(!1),c=e.ref(!1);return e.onMounted(()=>{var l;(l=n.olMap)==null||l.on("pointermove",t=>{const v=n.olMap.getFeaturesAtPixel(t.pixel),{clientX:p,clientY:f}=t.originalEvent;o.value.visible=!1;const a=n.createOptions({pixel:t.pixel,coordinate:t.coordinate,features:v});a&&(r.value=a.content,s.value=a.placement||"bottom-start",c.value=a.showArrow||!1,i.value=a.raw||!1,o.value.visible=!0,o.value.x=p,o.value.y=f)})}),(l,t)=>(e.openBlock(),e.createBlock(e.unref(m.NPopover),{"show-arrow":c.value,raw:i.value,placement:s.value,show:o.value.visible,x:o.value.x,y:o.value.y,trigger:"manual",class:"n-ol-pointermove","theme-overrides":{boxShadow:"none"}},{default:e.withCtx(()=>[e.createVNode(e.unref(d.RenderVNode),{"dynamic-v-node":r.value},null,8,["dynamic-v-node"])]),_:1},8,["show-arrow","raw","placement","show","x","y"]))}});exports.default=w;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),h=require("ol"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),h=require("ol"),i=require("ol/control"),a=require("ol/interaction"),S=require("./props.js"),P=o.defineComponent({__name:"index",props:{olMap:{default:()=>new h.Map},center:{default:()=>[0,0]},zoom:{default:2},minZoom:{default:2},maxZoom:{default:18},constrainResolution:{type:Boolean,default:!0},projection:{},extent:{},showZoom:{type:Boolean,default:!1},showAttribution:{type:Boolean,default:!1},showRotate:{type:Boolean,default:!1},showFullScreen:{type:Boolean,default:!1},showOverview:{type:Boolean,default:!1},showScale:{type:Boolean,default:!1},dragPan:{type:Boolean,default:!0},mouseWheelZoom:{type:Boolean,default:!0},doubleClickZoom:{type:Boolean,default:!1},pinchRotate:{type:Boolean},pinchZoom:{type:Boolean},altShiftDragRotate:{type:Boolean}},setup(Z,{expose:v}){const n=Z,s=o.ref(),t=n.olMap,c=new h.View({projection:n.projection,extent:n.extent});t.setView(c),o.watch(()=>n.zoom,e=>{c.setZoom(e)},{immediate:!0}),o.watch(()=>n.center,e=>{c.setCenter(e)},{immediate:!0}),o.watch(()=>n.constrainResolution,e=>{c.setConstrainResolution(e)},{immediate:!0}),o.watch(()=>n.minZoom,e=>{e&&c.setMinZoom(e)},{immediate:!0}),o.watch(()=>n.maxZoom,e=>{e&&c.setMaxZoom(e)},{immediate:!0}),o.watch(s,e=>{e&&t.setTarget(e)}),v({olMap:t}),o.provide(S.olMapInjectionKey,t);const l=t.getControls().getArray(),y=l.find(e=>e instanceof i.Zoom)||new i.Zoom,M=l.find(e=>e instanceof i.Attribution)||new i.Attribution,R=l.find(e=>e instanceof i.Rotate)||new i.Rotate,b=l.find(e=>e instanceof i.FullScreen)||new i.FullScreen,g=l.find(e=>e instanceof i.OverviewMap)||new i.OverviewMap,I=l.find(e=>e instanceof i.ScaleLine)||new i.ScaleLine;o.watch(()=>n.showZoom,e=>{y.setMap(e?t:null)},{immediate:!0}),o.watch(()=>n.showAttribution,e=>{M.setMap(e?t:null)},{immediate:!0}),o.watch(()=>n.showRotate,e=>{R.setMap(e?t:null)},{immediate:!0}),o.watch(()=>n.showFullScreen,e=>{b.setMap(e?t:null)},{immediate:!0}),o.watch(()=>n.showOverview,e=>{g.setMap(e?t:null)},{immediate:!0}),o.watch(()=>n.showScale,e=>{I.setMap(e?t:null)},{immediate:!0});const r=t.getInteractions().getArray(),m=r.find(e=>e instanceof a.DragPan)||new a.DragPan,u=r.find(e=>e instanceof a.MouseWheelZoom)||new a.MouseWheelZoom,d=r.find(e=>e instanceof a.DoubleClickZoom)||new a.DoubleClickZoom,f=r.find(e=>e instanceof a.PinchRotate)||new a.PinchRotate,w=r.find(e=>e instanceof a.PinchZoom)||new a.PinchZoom,p=r.find(e=>e instanceof a.DragRotate)||new a.DragRotate,B=r.find(e=>e instanceof a.KeyboardPan)||new a.KeyboardPan,C=r.find(e=>e instanceof a.KeyboardZoom)||new a.KeyboardZoom;return t.removeInteraction(m),t.addInteraction(m),t.removeInteraction(u),t.addInteraction(u),t.removeInteraction(d),t.addInteraction(d),t.removeInteraction(f),t.addInteraction(f),t.removeInteraction(w),t.addInteraction(w),t.removeInteraction(p),t.addInteraction(p),t.removeInteraction(B),t.removeInteraction(C),o.watch(()=>n.dragPan,e=>{m.setActive(e)},{immediate:!0}),o.watch(()=>n.mouseWheelZoom,e=>{u.setActive(e)},{immediate:!0}),o.watch(()=>n.doubleClickZoom,e=>{d.setActive(e)},{immediate:!0}),o.watch(()=>n.pinchRotate,e=>{f.setActive(e)},{immediate:!0}),o.watch(()=>n.pinchZoom,e=>{w.setActive(e)},{immediate:!0}),o.watch(()=>n.altShiftDragRotate,e=>{p.setActive(e)},{immediate:!0}),(e,A)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"mapRef",ref:s},[o.renderSlot(e.$slots,"default",{olMap:o.unref(t),mapRef:s.value})],512))}});exports.default=P;
|
|
@@ -3,7 +3,7 @@ import { Coordinate } from 'ol/coordinate';
|
|
|
3
3
|
import { Extent } from 'ol/extent';
|
|
4
4
|
import { InjectionKey } from 'vue';
|
|
5
5
|
import { ProjectionLike } from '../../constants/projection';
|
|
6
|
-
export
|
|
6
|
+
export interface OlMapProps {
|
|
7
7
|
olMap?: OLMap;
|
|
8
8
|
center?: Coordinate;
|
|
9
9
|
zoom?: number;
|
|
@@ -24,5 +24,5 @@ export type OlMapProps = {
|
|
|
24
24
|
pinchRotate?: boolean;
|
|
25
25
|
pinchZoom?: boolean;
|
|
26
26
|
altShiftDragRotate?: boolean;
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
28
|
export declare const olMapInjectionKey: InjectionKey<OLMap>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Symbol();exports.olMapInjectionKey=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Symbol("olMapInjectionKey");exports.olMapInjectionKey=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function createToolTipElement(text: string): HTMLDivElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function o(t){const e=document.createElement("div");return e.innerHTML=t,e.style.cursor="pointer",e.style.userSelect="none",e.style.backgroundColor="red",e.style.color="white",e.style.borderRadius="5px",e.style.padding="0 5px",e.style.fontSize="12px",e.style.border="2px solid white",e}exports.createToolTipElement=o;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Coordinate } from 'ol/coordinate';
|
|
2
2
|
import { Style } from 'ol/style';
|
|
3
|
+
import { VNode } from 'vue';
|
|
4
|
+
import { OLMap } from '../../types';
|
|
5
|
+
import { StyleOptions } from '../../utils';
|
|
3
6
|
import { Feature } from 'ol';
|
|
4
7
|
import { LineString } from 'ol/geom';
|
|
5
|
-
|
|
6
|
-
import { Coordinate } from 'ol/coordinate';
|
|
7
|
-
export type DrawLineStringOptions = {
|
|
8
|
+
export interface DrawLineStringOptions {
|
|
8
9
|
defaultCoordinates?: Coordinate[][];
|
|
9
10
|
deletePointLabel?: VNode;
|
|
10
11
|
deleteFeatureLabel?: VNode;
|
|
11
12
|
style?: Style;
|
|
13
|
+
styleOptions?: StyleOptions;
|
|
12
14
|
drawStyle?: Style;
|
|
15
|
+
drawStyleOptions?: StyleOptions;
|
|
13
16
|
modifyStyle?: Style;
|
|
17
|
+
modifyStyleOptions?: StyleOptions;
|
|
14
18
|
zIndex?: number;
|
|
15
19
|
size?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare
|
|
20
|
+
}
|
|
21
|
+
export declare function useDrawLineString(olMap: OLMap, options: DrawLineStringOptions): {
|
|
18
22
|
inDraw: import('vue').Ref<boolean, boolean>;
|
|
19
23
|
start: () => void;
|
|
20
24
|
stop: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("ol"),z=require("ol/geom"),T=require("ol/interaction"),j=require("ol/layer/Vector"),U=require("ol/source/Vector"),a=require("vue"),W=require("../../utils/calculate/index.js"),v=require("../../utils/style/index.js");require("ol/layer");require("ol/source");const b=require("../../utils/projection/index.js"),A=require("../common/index.js");function _(r,e){const m=a.ref(!0),d=a.ref([]),I=a.computed(()=>d.value.map(c=>c.getGeometry().getCoordinates())),t=new U,y=e.styleOptions?v.createStyle(e.styleOptions):e==null?void 0:e.style,S=new j({source:t,style:y,zIndex:e==null?void 0:e.zIndex});r.addLayer(S);const C=e.drawStyleOptions?v.createStyle(e.drawStyleOptions):e==null?void 0:e.drawStyle,n=new T.Draw({source:t,style:C||y,type:"LineString"});n.setActive(!1);const D=e.modifyStyleOptions?v.createStyle(e.modifyStyleOptions):e==null?void 0:e.modifyStyle,w=new T.Modify({source:t,style:D||y}),i=new Set;r.addInteraction(n),a.onMounted(()=>{r.addInteraction(w)}),t.on("addfeature",()=>{e.size&&t.getFeatures().length>=e.size&&n.setActive(!1)}),t.on("removefeature",()=>{e.size&&t.getFeatures().length<e.size&&n.setActive(!0)});const L=()=>{i.forEach(c=>{r.removeOverlay(c)}),i.clear()};t.on("change",()=>{L(),t.getFeatures().forEach(c=>{const l=c.getGeometry(),o=W.getExtentCenter(b.mercatorExtentToWgs84(l.getExtent()));let s=document.createElement("div");e.deleteFeatureLabel?a.render(e.deleteFeatureLabel,s):s=A.createToolTipElement("删除线"),s.addEventListener("click",()=>{t.removeFeature(c)});const F=new f.Overlay({position:b.wgs84ToMercator(o),positioning:"center-center",element:s});i.add(F),r.addOverlay(F);const g=l.getCoordinates();g.length<3||g.forEach(($,k)=>{let u=document.createElement("div");e.deletePointLabel?a.render(e.deletePointLabel,u):u=A.createToolTipElement("删除点"),u.addEventListener("click",()=>{c.setGeometry(new z.LineString(g.filter((B,V)=>V!==k)))});const x=new f.Overlay({position:$,positioning:"top-center",offset:[0,-30],element:u});i.add(x),r.addOverlay(x)})})}),n.on("change:active",()=>{m.value=n.getActive()}),t.on("change",()=>{d.value=t.getFeatures()});const E=()=>{L(),r.removeLayer(S),r.removeInteraction(n),r.removeInteraction(w)},G=()=>{e.size&&d.value.length>=e.size||n.setActive(!0)},O=()=>{n.setActive(!1)},h=c=>{t.clear(),c.forEach(l=>{if(l.length<2)return;const o=new f.Feature({geometry:new z.LineString(l)});t.addFeature(o)})},q=()=>{h(e.defaultCoordinates||[])};q();const P=()=>{t.clear(),O()};return a.onUnmounted(()=>{E()}),{inDraw:m,start:G,stop:O,clear:P,setFeatures:h,reset:q,features:d,coordinates:I,destroy:E}}exports.useDrawLineString=_;
|
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Coordinate } from 'ol/coordinate';
|
|
2
2
|
import { Style } from 'ol/style';
|
|
3
|
+
import { VNode } from 'vue';
|
|
4
|
+
import { OLMap } from '../../types';
|
|
5
|
+
import { StyleOptions } from '../../utils';
|
|
3
6
|
import { Feature } from 'ol';
|
|
4
7
|
import { Polygon } from 'ol/geom';
|
|
5
|
-
|
|
6
|
-
import { Coordinate } from 'ol/coordinate';
|
|
7
|
-
export type DrawPolygonOptions = {
|
|
8
|
+
export interface DrawPolygonOptions {
|
|
8
9
|
defaultCoordinates?: Coordinate[][][];
|
|
9
10
|
deletePointLabel?: VNode;
|
|
10
11
|
deleteFeatureLabel?: VNode;
|
|
11
12
|
style?: Style;
|
|
13
|
+
styleOptions?: StyleOptions;
|
|
14
|
+
drawStyleOptions?: StyleOptions;
|
|
15
|
+
modifyStyleOptions?: StyleOptions;
|
|
12
16
|
drawStyle?: Style;
|
|
13
17
|
modifyStyle?: Style;
|
|
14
18
|
zIndex?: number;
|
|
15
19
|
size?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare
|
|
20
|
+
}
|
|
21
|
+
export declare function useDrawPolygon(olMap: OLMap, options: DrawPolygonOptions): {
|
|
18
22
|
inDraw: import('vue').Ref<boolean, boolean>;
|
|
19
23
|
start: () => void;
|
|
20
24
|
stop: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("ol"),z=require("ol/geom"),P=require("ol/interaction"),j=require("ol/layer/Vector"),U=require("ol/source/Vector"),l=require("vue"),W=require("../../utils/calculate/index.js"),v=require("../../utils/style/index.js");require("ol/layer");require("ol/source");const T=require("../../utils/projection/index.js"),b=require("../common/index.js");function _(n,e){const m=l.ref(!0),u=l.ref([]),A=l.computed(()=>u.value.map(r=>r.getGeometry().getCoordinates())),o=e.styleOptions?v.createStyle(e.styleOptions):e==null?void 0:e.style,t=new U,w=new j({source:t,style:o,zIndex:e==null?void 0:e.zIndex});n.addLayer(w);const I=e.drawStyleOptions?v.createStyle(e.drawStyleOptions):e==null?void 0:e.drawStyle,c=new P.Draw({source:t,style:I||o,type:"Polygon"});c.setActive(!1);const C=e.modifyStyleOptions?v.createStyle(e.modifyStyleOptions):e==null?void 0:e.modifyStyle,S=new P.Modify({source:t,style:C||o}),d=new Set;n.addInteraction(c),l.onMounted(()=>{n.addInteraction(S)}),t.on("addfeature",()=>{e.size&&t.getFeatures().length>=e.size&&c.setActive(!1)}),t.on("removefeature",()=>{e.size&&t.getFeatures().length<e.size&&c.setActive(!0)});const h=()=>{d.forEach(r=>{n.removeOverlay(r)}),d.clear()};t.on("change",()=>{h(),t.getFeatures().forEach(r=>{const y=r.getGeometry(),a=W.getExtentCenter(T.mercatorExtentToWgs84(y.getExtent()));let s=document.createElement("div");e.deleteFeatureLabel?l.render(e.deleteFeatureLabel,s):s=b.createToolTipElement("删除区域"),s.addEventListener("click",()=>{t.removeFeature(r)});const x=new g.Overlay({position:T.wgs84ToMercator(a),positioning:"center-center",element:s});d.add(x),n.addOverlay(x);const f=y.getCoordinates()[0];f.length<3||f.forEach(($,k)=>{let i=document.createElement("div");e.deletePointLabel?l.render(e.deletePointLabel,i):i=b.createToolTipElement("删除点"),i.addEventListener("click",()=>{r.setGeometry(new z.Polygon([f.filter((B,V)=>V!==k)]))});const L=new g.Overlay({position:$,positioning:"top-center",offset:[0,-30],element:i});d.add(L),n.addOverlay(L)})})}),c.on("change:active",()=>{m.value=c.getActive()}),t.on("change",()=>{u.value=t.getFeatures()});const E=()=>{h(),n.removeLayer(w),n.removeInteraction(c),n.removeInteraction(S)},D=()=>{e.size&&u.value.length>=e.size||c.setActive(!0)},O=()=>{c.setActive(!1)},q=r=>{t.clear(),r==null||r.forEach(y=>{y.forEach(a=>{if(a.length<2)return;a[0]!==a[a.length-1]&&a.push(a[0]);const s=new g.Feature({geometry:new z.Polygon([a])});t.addFeature(s)})})},F=()=>{q(e.defaultCoordinates)};F();const G=()=>{t.clear(),O()};return l.onUnmounted(()=>{E()}),{inDraw:m,start:D,stop:O,clear:G,setFeatures:q,reset:F,features:u,coordinates:A,destroy:E}}exports.useDrawPolygon=_;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Stroke } from 'ol/style';
|
|
2
|
-
import { MaybeRef, Ref } from 'vue';
|
|
3
1
|
import { Map as OLMap } from 'ol';
|
|
4
|
-
|
|
2
|
+
import { MaybeRef, Ref } from 'vue';
|
|
3
|
+
import { Stroke } from 'ol/style';
|
|
4
|
+
export interface UseGraticuleOptions {
|
|
5
5
|
olMap: MaybeRef<OLMap | null | undefined>;
|
|
6
6
|
strokeStyle?: Stroke;
|
|
7
7
|
defaultShow?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare
|
|
8
|
+
}
|
|
9
|
+
export declare function useGraticule(options: UseGraticuleOptions): {
|
|
10
10
|
showGraticule: Ref<boolean, boolean>;
|
|
11
11
|
};
|
|
12
12
|
export type UseGraticuleReturn = ReturnType<typeof useGraticule>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("ol/layer"),s=require("ol/style"),r=require("vue");function i(e){const l=r.ref(e.defaultShow||!1);let t=new u.Graticule({strokeStyle:e.strokeStyle||new s.Stroke({color:"#000",width:1.5,lineDash:[4,4]}),showLabels:!0,wrapX:!1,zIndex:1});return r.watch(l,o=>{if(t.setMap(null),o){t=new u.Graticule({strokeStyle:new s.Stroke({color:"#555",width:1.5,lineDash:[4,4]}),showLabels:!0,wrapX:!1,zIndex:1});const a=r.toValue(e.olMap);a&&t.setMap(a)}},{immediate:!0,deep:!0}),{showGraticule:l}}exports.useGraticule=i;
|
|
@@ -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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("vue");function l(e){const r=a.ref(e.defaultLayerName||Object.keys(e.layers)[0]);return Object.values(e.layers).forEach(s=>{s.forEach(t=>{e.olMap.addLayer(t)})}),a.watch(r,()=>{Object.entries(e.layers).forEach(([s,t])=>{const c=s===r.value;t.forEach(i=>{i.setVisible(c)})})},{immediate:!0}),{visibleLayerName:r}}exports.useSwitchBaseLayer=l;
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./components/n-ol-contextmenu/index.vue.js"),l=require("./components/ol-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./components/n-ol-contextmenu/index.vue.js"),l=require("./components/n-ol-pointermove/index.vue.js"),g=require("./components/ol-map/index.vue.js"),s=require("./components/ol-map/props.js"),P=require("./composables/useDrawLineString/index.js"),S=require("./composables/useDrawPolygon/index.js"),_=require("./composables/useGraticule/index.js"),y=require("./composables/useSwitchBaseLayer/index.js"),T=require("./constants/distance.js"),i=require("./constants/projection.js"),r=require("./utils/calculate/index.js"),o=require("./utils/distance/index.js"),e=require("./utils/feature/index.js"),c=require("./utils/format/index.js"),n=require("./utils/layer/index.js"),t=require("./utils/projection/index.js"),E=require("./utils/realCircle/index.js"),a=require("./utils/style/index.js");exports.NOlContextmenu=u.default;exports.NOlPointermove=l.default;exports.OlMap=g.default;exports.olMapInjectionKey=s.olMapInjectionKey;exports.useDrawLineString=P.useDrawLineString;exports.useDrawPolygon=S.useDrawPolygon;exports.useGraticule=_.useGraticule;exports.useSwitchBaseLayer=y.useSwitchBaseLayer;exports.ONE_NM=T.ONE_NM;exports.EPSG_3857=i.EPSG_3857;exports.EPSG_4326=i.EPSG_4326;exports.WGS84Projection=i.WGS84Projection;exports.WebMercatorProjection=i.WebMercatorProjection;exports.getAngle=r.getAngle;exports.getArea=r.getArea;exports.getCenter=r.getCenter;exports.getDestinationPoint=r.getDestinationPoint;exports.getExtentCenter=r.getExtentCenter;exports.getLineLength=r.getLineLength;exports.kmToNauticalMiles=o.kmToNauticalMiles;exports.nauticalMilesToKm=o.nauticalMilesToKm;exports.createCircle=e.createCircle;exports.createCircleFeature=e.createCircleFeature;exports.createFeature=e.createFeature;exports.createLineString=e.createLineString;exports.createLineStringFeature=e.createLineStringFeature;exports.createMultiLineString=e.createMultiLineString;exports.createMultiLineStringFeature=e.createMultiLineStringFeature;exports.createMultiPoint=e.createMultiPoint;exports.createMultiPointFeature=e.createMultiPointFeature;exports.createMultiPolygon=e.createMultiPolygon;exports.createMultiPolygonFeature=e.createMultiPolygonFeature;exports.createPoint=e.createPoint;exports.createPointFeature=e.createPointFeature;exports.createPolygon=e.createPolygon;exports.createPolygonFeature=e.createPolygonFeature;exports.toOlAngle=c.toOlAngle;exports.toTurfAngle=c.toTurfAngle;exports.createVectorLayer=n.createVectorLayer;exports.getBingLayer=n.getBingLayer;exports.getOSMLayer=n.getOSMLayer;exports.getTianDiTuLayer=n.getTianDiTuLayer;exports.getTianDiTuUrl=n.getTianDiTuUrl;exports.EPSG_3857ExtentToEPSG_4326=t.EPSG_3857ExtentToEPSG_4326;exports.EPSG_3857ToEPSG_4326=t.EPSG_3857ToEPSG_4326;exports.EPSG_4326ExtentToEPSG_3857=t.EPSG_4326ExtentToEPSG_3857;exports.EPSG_4326ToEPSG_3857=t.EPSG_4326ToEPSG_3857;exports.mercatorExtentToWgs84=t.mercatorExtentToWgs84;exports.mercatorToWgs84=t.mercatorToWgs84;exports.wgs84ExtentToMercator=t.wgs84ExtentToMercator;exports.wgs84ToMercator=t.wgs84ToMercator;exports.getRealCircleCoordinates=E.getRealCircleCoordinates;exports.createCircleStyle=a.createCircleStyle;exports.createStyle=a.createStyle;exports.createTextStyle=a.createTextStyle;
|
|
@@ -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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@turf/turf"),r=require("../format/index.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@turf/turf"),r=require("../format/index.js");function g(e,t,o){return n.destination(e,t,r.toTurfAngle(o),{units:"meters"}).geometry.coordinates}function u(e){const t=n.lineString(e);return n.length(t,{units:"meters"})}function s(e){return n.area(n.polygon(e))}function c(e,t){return r.toOlAngle(n.bearing(e,t))}function i(e,t){return n.midpoint(e,t).geometry.coordinates}function a(e){return i([e[0],e[1]],[e[2],e[3]])}exports.getAngle=c;exports.getArea=s;exports.getCenter=i;exports.getDestinationPoint=g;exports.getExtentCenter=a;exports.getLineLength=u;
|
|
@@ -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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../constants/distance.js")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../constants/distance.js");function i(e){return e*1e3/t.ONE_NM}function n(e){return e*t.ONE_NM/1e3}exports.kmToNauticalMiles=i;exports.nauticalMilesToKm=n;
|