@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.
Files changed (83) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/index.js +600 -521
  3. package/es/components/index.d.ts +1 -1
  4. package/es/components/n-ol-contextmenu/index.vue.mjs +14 -12
  5. package/es/components/n-ol-contextmenu/props.d.ts +2 -2
  6. package/es/components/n-ol-pointermove/index.vue.mjs +14 -14
  7. package/es/components/ol-map/index.vue.d.ts +1 -1
  8. package/es/components/ol-map/index.vue.mjs +1 -1
  9. package/es/components/ol-map/props.d.ts +2 -2
  10. package/es/components/ol-map/props.mjs +1 -1
  11. package/es/composables/common/index.d.ts +1 -1
  12. package/es/composables/common/index.mjs +2 -2
  13. package/es/composables/index.d.ts +2 -2
  14. package/es/composables/useDrawLineString/index.d.ts +10 -6
  15. package/es/composables/useDrawLineString/index.mjs +73 -69
  16. package/es/composables/useDrawPolygon/index.d.ts +10 -6
  17. package/es/composables/useDrawPolygon/index.mjs +65 -61
  18. package/es/composables/useGraticule/index.d.ts +5 -5
  19. package/es/composables/useGraticule/index.mjs +2 -2
  20. package/es/composables/useSwitchBaseLayer/index.d.ts +2 -2
  21. package/es/composables/useSwitchBaseLayer/index.mjs +12 -12
  22. package/es/index.mjs +64 -64
  23. package/es/utils/calculate/index.d.ts +10 -8
  24. package/es/utils/calculate/index.mjs +23 -8
  25. package/es/utils/distance/index.d.ts +2 -2
  26. package/es/utils/distance/index.mjs +8 -3
  27. package/es/utils/feature/index.d.ts +21 -21
  28. package/es/utils/feature/index.mjs +72 -44
  29. package/es/utils/format/index.d.ts +2 -2
  30. package/es/utils/format/index.mjs +6 -1
  31. package/es/utils/index.d.ts +2 -2
  32. package/es/utils/layer/index.d.ts +14 -14
  33. package/es/utils/layer/index.mjs +47 -40
  34. package/es/utils/projection/index.d.ts +8 -8
  35. package/es/utils/projection/index.mjs +21 -6
  36. package/es/utils/realCircle/index.d.ts +2 -2
  37. package/es/utils/realCircle/index.mjs +2 -2
  38. package/es/utils/style/index.d.ts +4 -4
  39. package/es/utils/style/index.mjs +10 -8
  40. package/lib/components/index.d.ts +1 -1
  41. package/lib/components/n-ol-contextmenu/index.vue.js +1 -1
  42. package/lib/components/n-ol-contextmenu/props.d.ts +2 -2
  43. package/lib/components/n-ol-pointermove/index.vue.js +1 -1
  44. package/lib/components/ol-map/index.vue.d.ts +1 -1
  45. package/lib/components/ol-map/index.vue.js +1 -1
  46. package/lib/components/ol-map/props.d.ts +2 -2
  47. package/lib/components/ol-map/props.js +1 -1
  48. package/lib/composables/common/index.d.ts +1 -1
  49. package/lib/composables/common/index.js +1 -1
  50. package/lib/composables/index.d.ts +2 -2
  51. package/lib/composables/useDrawLineString/index.d.ts +10 -6
  52. package/lib/composables/useDrawLineString/index.js +1 -1
  53. package/lib/composables/useDrawPolygon/index.d.ts +10 -6
  54. package/lib/composables/useDrawPolygon/index.js +1 -1
  55. package/lib/composables/useGraticule/index.d.ts +5 -5
  56. package/lib/composables/useGraticule/index.js +1 -1
  57. package/lib/composables/useSwitchBaseLayer/index.d.ts +2 -2
  58. package/lib/composables/useSwitchBaseLayer/index.js +1 -1
  59. package/lib/index.js +1 -1
  60. package/lib/utils/calculate/index.d.ts +10 -8
  61. package/lib/utils/calculate/index.js +1 -1
  62. package/lib/utils/distance/index.d.ts +2 -2
  63. package/lib/utils/distance/index.js +1 -1
  64. package/lib/utils/feature/index.d.ts +21 -21
  65. package/lib/utils/feature/index.js +1 -1
  66. package/lib/utils/format/index.d.ts +2 -2
  67. package/lib/utils/format/index.js +1 -1
  68. package/lib/utils/index.d.ts +2 -2
  69. package/lib/utils/layer/index.d.ts +14 -14
  70. package/lib/utils/layer/index.js +1 -1
  71. package/lib/utils/projection/index.d.ts +8 -8
  72. package/lib/utils/projection/index.js +1 -1
  73. package/lib/utils/realCircle/index.d.ts +2 -2
  74. package/lib/utils/realCircle/index.js +1 -1
  75. package/lib/utils/style/index.d.ts +4 -4
  76. package/lib/utils/style/index.js +1 -1
  77. package/package.json +20 -19
  78. package/es/components/common/render-v-node.vue.d.ts +0 -17
  79. package/es/components/common/render-v-node.vue.mjs +0 -22
  80. package/es/components/common/render-v-node.vue2.mjs +0 -4
  81. package/lib/components/common/render-v-node.vue.d.ts +0 -17
  82. package/lib/components/common/render-v-node.vue.js +0 -1
  83. 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
- const h = (e) => {
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 const useSwitchBaseLayer: (data: {
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 l, watch as m } from "vue";
2
- const y = (e) => {
3
- const r = l(e.defaultLayerName || Object.keys(e.layers)[0]);
4
- return Object.values(e.layers).map((s) => {
5
- s.map((a) => {
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
- }), m(
8
+ }), o(
9
9
  r,
10
10
  () => {
11
- Object.entries(e.layers).map(([s, a]) => {
12
- const t = s === r.value;
13
- a.map((i) => {
14
- i.setVisible(t);
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
- y as useSwitchBaseLayer
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-map/index.vue.mjs";
3
- import { olMapInjectionKey as i } from "./components/ol-map/props.mjs";
4
- import { default as l } from "./components/n-ol-pointermove/index.vue.mjs";
5
- import { useGraticule as u } from "./composables/useGraticule/index.mjs";
6
- import { useSwitchBaseLayer as m } from "./composables/useSwitchBaseLayer/index.mjs";
7
- import { useDrawLineString as f } from "./composables/useDrawLineString/index.mjs";
8
- import { useDrawPolygon as p } from "./composables/useDrawPolygon/index.mjs";
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 { createVectorLayer as C, getBingLayer as F, getOSMLayer as O, getTianDiTuLayer as w, getTianDiTuUrl as D } from "./utils/layer/index.mjs";
12
- import { getAngle as d, getArea as A, getCenter as W, getDestinationPoint as j, getExtentCenter as h, getLineLength as B } from "./utils/calculate/index.mjs";
13
- import { kmToNauticalMiles as b, nauticalMilesToKm as k } from "./utils/distance/index.mjs";
14
- import { toOlAngle as I, toTurfAngle as R } from "./utils/format/index.mjs";
15
- import { EPSG_3857ExtentToEPSG_4326 as V, EPSG_3857ToEPSG_4326 as q, EPSG_4326ExtentToEPSG_3857 as z, EPSG_4326ToEPSG_3857 as H, mercatorExtentToWgs84 as J, mercatorToWgs84 as Q, wgs84ExtentToMercator as X, wgs84ToMercator as Y } from "./utils/projection/index.mjs";
16
- import { getRealCircleCoordinates as $ } from "./utils/realCircle/index.mjs";
17
- import { createCircleStyle as te, createStyle as re, createTextStyle as oe } from "./utils/style/index.mjs";
18
- import { createCircle as ne, createCircleFeature as ie, createFeature as ce, createLineString as le, createLineStringFeature as ge, createMultiLineString as ue, createMultiLineStringFeature as xe, createMultiPoint as me, createMultiPointFeature as Pe, createMultiPolygon as fe, createMultiPolygonFeature as Se, createPoint as pe, createPointFeature as se, createPolygon as Ee, createPolygonFeature as Te } from "./utils/feature/index.mjs";
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
- V as EPSG_3857ExtentToEPSG_4326,
22
- q as EPSG_3857ToEPSG_4326,
21
+ ie as EPSG_3857ExtentToEPSG_4326,
22
+ ce as EPSG_3857ToEPSG_4326,
23
23
  y as EPSG_4326,
24
- z as EPSG_4326ExtentToEPSG_3857,
25
- H as EPSG_4326ToEPSG_3857,
24
+ le as EPSG_4326ExtentToEPSG_3857,
25
+ ge as EPSG_4326ToEPSG_3857,
26
26
  r as NOlContextmenu,
27
- l as NOlPointermove,
27
+ a as NOlPointermove,
28
28
  E as ONE_NM,
29
- a as OlMap,
29
+ i as OlMap,
30
30
  G as WGS84Projection,
31
31
  L as WebMercatorProjection,
32
- ne as createCircle,
33
- ie as createCircleFeature,
34
- te as createCircleStyle,
35
- ce as createFeature,
36
- le as createLineString,
37
- ge as createLineStringFeature,
38
- ue as createMultiLineString,
39
- xe as createMultiLineStringFeature,
40
- me as createMultiPoint,
41
- Pe as createMultiPointFeature,
42
- fe as createMultiPolygon,
43
- Se as createMultiPolygonFeature,
44
- pe as createPoint,
45
- se as createPointFeature,
46
- Ee as createPolygon,
47
- Te as createPolygonFeature,
48
- re as createStyle,
49
- oe as createTextStyle,
50
- C as createVectorLayer,
51
- d as getAngle,
52
- A as getArea,
53
- F as getBingLayer,
54
- W as getCenter,
55
- j as getDestinationPoint,
56
- h as getExtentCenter,
57
- B as getLineLength,
58
- O as getOSMLayer,
59
- $ as getRealCircleCoordinates,
60
- w as getTianDiTuLayer,
61
- D as getTianDiTuUrl,
62
- b as kmToNauticalMiles,
63
- J as mercatorExtentToWgs84,
64
- Q as mercatorToWgs84,
65
- k as nauticalMilesToKm,
66
- i as olMapInjectionKey,
67
- I as toOlAngle,
68
- R as toTurfAngle,
69
- f as useDrawLineString,
70
- p as useDrawPolygon,
71
- u as useGraticule,
72
- m as useSwitchBaseLayer,
73
- X as wgs84ExtentToMercator,
74
- Y as wgs84ToMercator
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 const getDestinationPoint: (coordinates: Coordinate, distance: number, azimuth: number) => Coordinate;
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 const getLineLength: (coordinates: Coordinate[]) => number;
16
+ export declare function getLineLength(coordinates: Coordinate[]): number;
15
17
  /** 计算面积 */
16
- export declare const getArea: (coordinates: Coordinate[][]) => number;
18
+ export declare function getArea(coordinates: Coordinate[][]): number;
17
19
  /** 计算2点之间的角度 */
18
- export declare const getAngle: (start: Coordinate, end: Coordinate) => number;
20
+ export declare function getAngle(start: Coordinate, end: Coordinate): number;
19
21
  /** 计算2点的中心点 */
20
- export declare const getCenter: (start: Coordinate, end: Coordinate) => Coordinate;
22
+ export declare function getCenter(start: Coordinate, end: Coordinate): Coordinate;
21
23
  /** 计算Extent中心点 */
22
- export declare const getExtentCenter: (extent: Extent) => Coordinate;
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 s, bearing as u, midpoint as c } from "@turf/turf";
2
- import { toTurfAngle as m, toOlAngle as a } from "../format/index.mjs";
3
- const f = (t, e, n) => r(t, e, m(n), { units: "meters" }).geometry.coordinates, A = (t) => {
4
- const e = o(t);
5
- return i(e, { units: "meters" });
6
- }, y = (t) => g(s(t)), L = (t, e) => a(u(t, e)), l = (t, e) => c(t, e).geometry.coordinates, h = (t) => l([t[0], t[1]], [t[2], t[3]]);
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
- l as getCenter,
11
- f as getDestinationPoint,
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 const kmToNauticalMiles: (km: number) => number;
2
+ export declare function kmToNauticalMiles(km: number): number;
3
3
  /** 海里转公里 */
4
- export declare const nauticalMilesToKm: (nauticalMiles: number) => number;
4
+ export declare function nauticalMilesToKm(nauticalMiles: number): number;
@@ -1,6 +1,11 @@
1
1
  import { ONE_NM as e } from "../../constants/distance.mjs";
2
- const r = (t) => t * 1e3 / e, i = (t) => t * e / 1e3;
2
+ function n(t) {
3
+ return t * 1e3 / e;
4
+ }
5
+ function o(t) {
6
+ return t * e / 1e3;
7
+ }
3
8
  export {
4
- r as kmToNauticalMiles,
5
- i as nauticalMilesToKm
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
- export type FeatureOptions = {
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 const createPoint: (coordinates: Coordinate) => Point;
13
- export declare const createLineString: (coordinates: Coordinate[]) => LineString;
14
- export declare const createPolygon: (coordinates: Coordinate[][]) => Polygon;
15
- export declare const createCircle: (center: Coordinate, radius: number) => Circle;
16
- export declare const createMultiPoint: (coordinates: Coordinate[]) => MultiPoint;
17
- export declare const createMultiLineString: (coordinates: Coordinate[][]) => MultiLineString;
18
- export declare const createMultiPolygon: (coordinates: Coordinate[][][]) => MultiPolygon;
19
- export declare const createFeature: (options?: FeatureOptions) => Feature<Geometry>;
20
- export declare const createPointFeature: (coordinates: Coordinate, options?: FeatureOptions) => Feature<Point>;
21
- export declare const createLineStringFeature: (coordinates: Coordinate[], options?: FeatureOptions) => Feature<LineString>;
22
- export declare const createPolygonFeature: (coordinates: Coordinate[][], options?: FeatureOptions) => Feature<Polygon>;
23
- export declare const createCircleFeature: (center: Coordinate, radius: number, options?: FeatureOptions) => Feature<Circle>;
24
- export declare const createMultiPointFeature: (coordinates: Coordinate[], options?: FeatureOptions) => Feature<MultiPoint>;
25
- export declare const createMultiLineStringFeature: (coordinates: Coordinate[][], options?: FeatureOptions) => Feature<MultiLineString>;
26
- export declare const createMultiPolygonFeature: (coordinates: Coordinate[][][], options?: FeatureOptions) => Feature<MultiPolygon>;
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 c } from "ol";
2
- import { Point as i, LineString as u, Polygon as s, Circle as a, MultiPoint as l, MultiLineString as g, MultiPolygon as y } from "ol/geom";
3
- import { createStyle as m } from "../style/index.mjs";
4
- const P = (e) => new i(e), F = (e) => new u(e), M = (e) => new s(e), w = (e, t) => new a(e, t), S = (e) => new l(e), p = (e) => new g(e), L = (e) => new y(e), n = (e) => {
5
- const { styleOptions: t, ...r } = e ?? {}, o = t ? m(t) : r.style;
6
- return new c({
7
- ...r,
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
- }, b = (e, t) => {
11
- const r = P(e);
12
- return n({
31
+ }
32
+ function b(e, t) {
33
+ const n = m(e);
34
+ return r({
13
35
  ...t,
14
- geometry: r
36
+ geometry: n
15
37
  });
16
- }, d = (e, t) => {
17
- const r = F(e);
18
- return n({
38
+ }
39
+ function d(e, t) {
40
+ const n = P(e);
41
+ return r({
19
42
  ...t,
20
- geometry: r
43
+ geometry: n
21
44
  });
22
- }, h = (e, t) => {
23
- const r = M(e);
24
- return n({
45
+ }
46
+ function h(e, t) {
47
+ const n = F(e);
48
+ return r({
25
49
  ...t,
26
- geometry: r
50
+ geometry: n
27
51
  });
28
- }, j = (e, t, r) => {
29
- const o = w(e, t);
30
- return n({
31
- ...r,
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
- }, k = (e, t) => {
35
- const r = S(e);
36
- return n({
59
+ }
60
+ function k(e, t) {
61
+ const n = w(e);
62
+ return r({
37
63
  ...t,
38
- geometry: r
64
+ geometry: n
39
65
  });
40
- }, q = (e, t) => {
41
- const r = p(e);
42
- return n({
66
+ }
67
+ function q(e, t) {
68
+ const n = S(e);
69
+ return r({
43
70
  ...t,
44
- geometry: r
71
+ geometry: n
45
72
  });
46
- }, v = (e, t) => {
47
- const r = L(e);
48
- return n({
73
+ }
74
+ function v(e, t) {
75
+ const n = p(e);
76
+ return r({
49
77
  ...t,
50
- geometry: r
78
+ geometry: n
51
79
  });
52
- };
80
+ }
53
81
  export {
54
- w as createCircle,
82
+ M as createCircle,
55
83
  j as createCircleFeature,
56
- n as createFeature,
57
- F as createLineString,
84
+ r as createFeature,
85
+ P as createLineString,
58
86
  d as createLineStringFeature,
59
- p as createMultiLineString,
87
+ S as createMultiLineString,
60
88
  q as createMultiLineStringFeature,
61
- S as createMultiPoint,
89
+ w as createMultiPoint,
62
90
  k as createMultiPointFeature,
63
- L as createMultiPolygon,
91
+ p as createMultiPolygon,
64
92
  v as createMultiPolygonFeature,
65
- P as createPoint,
93
+ m as createPoint,
66
94
  b as createPointFeature,
67
- M as createPolygon,
95
+ F as createPolygon,
68
96
  h as createPolygonFeature
69
97
  };
@@ -1,4 +1,4 @@
1
1
  /** 任意角度转换为 0-360 */
2
- export declare const toOlAngle: (angle: number) => number;
2
+ export declare function toOlAngle(angle: number): number;
3
3
  /** 任意角度转换为 -180-180 */
4
- export declare const toTurfAngle: (angle: number) => number;
4
+ export declare function toTurfAngle(angle: number): number;
@@ -1,4 +1,9 @@
1
- const t = (r) => r < 0 ? t(r + 360) : r > 360 ? t(r - 360) : r, u = (r) => r < -180 ? u(r + 360) : r > 180 ? u(r - 360) : r;
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
@@ -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 { Tile as TileLayer } from 'ol/layer';
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 const getTianDiTuUrl: (data: {
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
- }) => string;
26
- export declare const getTianDiTuLayer: (data: {
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
- }) => TileLayer<XYZ>;
34
- export declare const getBingLayer: ({ name, zIndex, key, className, }: {
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
- }) => TileLayer<BingMaps>;
40
- export declare const getOSMLayer: (data?: {
39
+ }): TileLayer<BingMaps>;
40
+ export declare function getOSMLayer(data?: {
41
41
  zIndex?: number;
42
42
  className?: string;
43
- }) => TileLayer<OSM>;
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 const createVectorLayer: <T extends Geometry = Geometry>(options?: VectorLayerOptions) => {
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
  };