@summeruse/ol 0.1.1-beta.1 → 0.1.1

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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @summeruse/ol
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - c26ae5a: 重构 useGraticule 以支持更灵活的样式配置
8
+ - e651b52: 添加经纬度标签样式支持
9
+ - b0985c6: 添加 useOlMap 函数以简化地图实例的注入
10
+ - 9b9aeed: 移除`T_MAP_TYPE`类型的定义,改为从`@summeruse/common`导入
11
+ - Updated dependencies [8619680]
12
+ - @summeruse/common@0.0.1
13
+
14
+ ## 0.1.1-beta.2
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [8619680]
19
+ - @summeruse/common@0.0.1-beta.0
20
+ - b0985c6: 添加 useOlMap 函数以简化地图实例的注入
21
+ - 9b9aeed: 移除`T_MAP_TYPE`类型的定义,改为从`@summeruse/common`导入
22
+
3
23
  ## 0.1.1-beta.1
4
24
 
5
25
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { defineComponent as U, ref as g, onMounted as N, createBlock as pe, openBlock as H, unref as Z, shallowRef as Ce, withCtx as ke, createVNode as Fe, watch as d, provide as Me, createElementBlock as Te, renderSlot as Ae, computed as Se, render as z, onUnmounted as he, toValue as _e } from "vue";
2
- import { NDropdown as Re, NPopover as Ze } from "naive-ui";
3
- import { RenderVNode as ze } from "@summeruse/common";
4
- import { Map as Ge, View as Be, Feature as Q, Overlay as G } from "ol";
1
+ import { defineComponent as U, ref as g, onMounted as j, createBlock as pe, openBlock as H, unref as Z, shallowRef as Me, withCtx as ke, createVNode as Fe, inject as Te, watch as d, provide as Ae, createElementBlock as _e, renderSlot as Re, computed as Se, render as z, onUnmounted as he, toValue as Ze } from "vue";
2
+ import { NDropdown as ze, NPopover as Ge } from "naive-ui";
3
+ import { RenderVNode as Be } from "@summeruse/common";
4
+ import { Map as De, View as je, Feature as Q, Overlay as G } from "ol";
5
5
  import { Zoom as oe, Attribution as re, Rotate as ie, FullScreen as ae, OverviewMap as ce, ScaleLine as le } from "ol/control";
6
6
  import { DragPan as se, MouseWheelZoom as ue, DoubleClickZoom as fe, PinchRotate as de, PinchZoom as me, DragRotate as ye, KeyboardPan as ve, KeyboardZoom as we, Draw as Oe, Modify as Ee } from "ol/interaction";
7
- import { Point as De, LineString as $, Polygon as K, Circle as Ne, MultiPoint as je, MultiLineString as Ve, MultiPolygon as We } from "ol/geom";
7
+ import { Point as Ne, LineString as $, Polygon as K, Circle as Ve, MultiPoint as We, MultiLineString as $e, MultiPolygon as Ke } from "ol/geom";
8
8
  import q from "ol/layer/Vector";
9
9
  import J from "ol/source/Vector";
10
- import { destination as $e, lineString as Ke, length as Xe, area as Ye, polygon as Ue, bearing as He, midpoint as Qe } from "@turf/turf";
11
- import { Circle as qe, Stroke as T, Fill as B, Text as Je, Icon as et, Style as tt } from "ol/style";
12
- import { Tile as ee, Graticule as nt } from "ol/layer";
13
- import { XYZ as ot, BingMaps as rt, OSM as it } from "ol/source";
10
+ import { destination as Xe, lineString as Ye, length as Ue, area as He, polygon as Qe, bearing as qe, midpoint as Je } from "@turf/turf";
11
+ import { Circle as et, Stroke as T, Fill as B, Text as tt, Icon as nt, Style as ot } from "ol/style";
12
+ import { Tile as ee, Graticule as rt } from "ol/layer";
13
+ import { XYZ as it, BingMaps as at, OSM as ct } from "ol/source";
14
14
  import { transform as be, transformExtent as xe } from "ol/proj";
15
- const Rt = /* @__PURE__ */ U({
15
+ const Zt = /* @__PURE__ */ U({
16
16
  __name: "index",
17
17
  props: {
18
18
  olMap: {},
@@ -28,7 +28,7 @@ const Rt = /* @__PURE__ */ U({
28
28
  a.value.visible = !1;
29
29
  }
30
30
  const i = g();
31
- N(() => {
31
+ j(() => {
32
32
  const f = n.getViewport();
33
33
  f && (f.oncontextmenu = (s) => {
34
34
  s.preventDefault();
@@ -44,7 +44,7 @@ const Rt = /* @__PURE__ */ U({
44
44
  const { onClick: l } = s;
45
45
  l && l(), a.value.visible = !1;
46
46
  }
47
- return (f, s) => (H(), pe(Z(Re), {
47
+ return (f, s) => (H(), pe(Z(ze), {
48
48
  placement: "bottom-start",
49
49
  trigger: "manual",
50
50
  show: i.value && i.value.length > 0 && a.value.visible,
@@ -55,7 +55,7 @@ const Rt = /* @__PURE__ */ U({
55
55
  onSelect: c
56
56
  }, null, 8, ["show", "x", "y", "options"]));
57
57
  }
58
- }), Zt = /* @__PURE__ */ U({
58
+ }), zt = /* @__PURE__ */ U({
59
59
  __name: "index",
60
60
  props: {
61
61
  olMap: {},
@@ -66,8 +66,8 @@ const Rt = /* @__PURE__ */ U({
66
66
  visible: !1,
67
67
  x: 0,
68
68
  y: 0
69
- }), a = Ce(), r = g("bottom-start"), i = g(!1), c = g(!1);
70
- return N(() => {
69
+ }), a = Me(), r = g("bottom-start"), i = g(!1), c = g(!1);
70
+ return j(() => {
71
71
  var f;
72
72
  (f = e.olMap) == null || f.on("pointermove", (s) => {
73
73
  const l = e.olMap.getFeaturesAtPixel(s.pixel), { clientX: w, clientY: y } = s.originalEvent;
@@ -79,7 +79,7 @@ const Rt = /* @__PURE__ */ U({
79
79
  });
80
80
  m && (a.value = m.content, r.value = m.placement || "bottom-start", c.value = m.showArrow || !1, i.value = m.raw || !1, n.value.visible = !0, n.value.x = w, n.value.y = y);
81
81
  });
82
- }), (f, s) => (H(), pe(Z(Ze), {
82
+ }), (f, s) => (H(), pe(Z(Ge), {
83
83
  "show-arrow": c.value,
84
84
  raw: i.value,
85
85
  placement: r.value,
@@ -93,15 +93,19 @@ const Rt = /* @__PURE__ */ U({
93
93
  }
94
94
  }, {
95
95
  default: ke(() => [
96
- Fe(Z(ze), { "dynamic-v-node": a.value }, null, 8, ["dynamic-v-node"])
96
+ Fe(Z(Be), { "dynamic-v-node": a.value }, null, 8, ["dynamic-v-node"])
97
97
  ]),
98
98
  _: 1
99
99
  }, 8, ["show-arrow", "raw", "placement", "show", "x", "y"]));
100
100
  }
101
- }), at = Symbol("olMapInjectionKey"), zt = /* @__PURE__ */ U({
101
+ }), Le = Symbol("olMapInjectionKey");
102
+ function Gt() {
103
+ return Te(Le);
104
+ }
105
+ const Bt = /* @__PURE__ */ U({
102
106
  __name: "index",
103
107
  props: {
104
- olMap: { default: () => new Ge() },
108
+ olMap: { default: () => new De() },
105
109
  center: { default: () => [0, 0] },
106
110
  zoom: { default: 2 },
107
111
  minZoom: { default: 2 },
@@ -123,7 +127,7 @@ const Rt = /* @__PURE__ */ U({
123
127
  altShiftDragRotate: { type: Boolean }
124
128
  },
125
129
  setup(t, { expose: e }) {
126
- const n = t, a = g(), r = n.olMap, i = new Be({
130
+ const n = t, a = g(), r = n.olMap, i = new je({
127
131
  projection: n.projection,
128
132
  extent: n.extent
129
133
  });
@@ -151,7 +155,7 @@ const Rt = /* @__PURE__ */ U({
151
155
  o && r.setTarget(o);
152
156
  }), e({
153
157
  olMap: r
154
- }), Me(at, r);
158
+ }), Ae(Le, r);
155
159
  const c = r.getControls().getArray(), f = c.find((o) => o instanceof oe) || new oe(), s = c.find((o) => o instanceof re) || new re(), l = c.find((o) => o instanceof ie) || new ie(), w = c.find((o) => o instanceof ae) || new ae(), y = c.find((o) => o instanceof ce) || new ce(), m = c.find((o) => o instanceof le) || new le();
156
160
  d(() => n.showZoom, (o) => {
157
161
  f.setMap(o ? r : null);
@@ -203,11 +207,11 @@ const Rt = /* @__PURE__ */ U({
203
207
  I.setActive(o);
204
208
  }, {
205
209
  immediate: !0
206
- }), (o, O) => (H(), Te("div", {
210
+ }), (o, O) => (H(), _e("div", {
207
211
  ref_key: "mapRef",
208
212
  ref: a
209
213
  }, [
210
- Ae(o.$slots, "default", {
214
+ Re(o.$slots, "default", {
211
215
  olMap: Z(r),
212
216
  mapRef: a.value
213
217
  })
@@ -220,35 +224,35 @@ function X(t) {
220
224
  function Y(t) {
221
225
  return t < -180 ? Y(t + 360) : t > 180 ? Y(t - 360) : t;
222
226
  }
223
- function ct(t, e, n) {
224
- return $e(t, e, Y(n), { units: "meters" }).geometry.coordinates;
227
+ function lt(t, e, n) {
228
+ return Xe(t, e, Y(n), { units: "meters" }).geometry.coordinates;
225
229
  }
226
- function Gt(t) {
227
- const e = Ke(t);
228
- return Xe(e, { units: "meters" });
230
+ function Dt(t) {
231
+ const e = Ye(t);
232
+ return Ue(e, { units: "meters" });
229
233
  }
230
- function Bt(t) {
231
- return Ye(Ue(t));
234
+ function jt(t) {
235
+ return He(Qe(t));
232
236
  }
233
- function Dt(t, e) {
234
- return X(He(t, e));
237
+ function Nt(t, e) {
238
+ return X(qe(t, e));
235
239
  }
236
- function lt(t, e) {
237
- return Qe(t, e).geometry.coordinates;
240
+ function st(t, e) {
241
+ return Je(t, e).geometry.coordinates;
238
242
  }
239
- function Le(t) {
240
- return lt([t[0], t[1]], [t[2], t[3]]);
243
+ function Pe(t) {
244
+ return st([t[0], t[1]], [t[2], t[3]]);
241
245
  }
242
- const Pe = 1852, A = "EPSG:3857", _ = "EPSG:4326", ge = A, st = _;
243
- function Nt(t) {
244
- return t * 1e3 / Pe;
246
+ const Ie = 1852, A = "EPSG:3857", _ = "EPSG:4326", ge = A, ut = _;
247
+ function Vt(t) {
248
+ return t * 1e3 / Ie;
245
249
  }
246
- function jt(t) {
247
- return t * Pe / 1e3;
250
+ function Wt(t) {
251
+ return t * Ie / 1e3;
248
252
  }
249
- function ut(t) {
253
+ function ft(t) {
250
254
  const { fillOptions: e, strokeOptions: n, ...a } = t;
251
- return new qe({
255
+ return new et({
252
256
  ...a,
253
257
  fill: e ? new B(e) : void 0,
254
258
  stroke: n ? new T(n) : void 0
@@ -256,7 +260,7 @@ function ut(t) {
256
260
  }
257
261
  function R(t) {
258
262
  const { fillOptions: e, strokeOptions: n, backgroundFillOptions: a, backgroundStrokeOptions: r, ...i } = t;
259
- return new Je({
263
+ return new tt({
260
264
  ...i,
261
265
  fill: e ? new B(e) : void 0,
262
266
  stroke: n ? new T(n) : void 0,
@@ -265,8 +269,8 @@ function R(t) {
265
269
  });
266
270
  }
267
271
  function P(t) {
268
- const { fillOptions: e, strokeOptions: n, iconOptions: a, circleOptions: r, textOptions: i, ...c } = t, f = e ? new B(e) : void 0, s = n ? new T(n) : void 0, l = a ? new et(a) : void 0, w = r ? ut(r) : void 0, y = i ? R(i) : void 0;
269
- return new tt({
272
+ const { fillOptions: e, strokeOptions: n, iconOptions: a, circleOptions: r, textOptions: i, ...c } = t, f = e ? new B(e) : void 0, s = n ? new T(n) : void 0, l = a ? new nt(a) : void 0, w = r ? ft(r) : void 0, y = i ? R(i) : void 0;
273
+ return new ot({
270
274
  ...c,
271
275
  fill: f,
272
276
  stroke: s,
@@ -274,100 +278,100 @@ function P(t) {
274
278
  text: y
275
279
  });
276
280
  }
277
- function ft(t) {
278
- return new De(t);
279
- }
280
281
  function dt(t) {
281
- return new $(t);
282
+ return new Ne(t);
282
283
  }
283
284
  function mt(t) {
284
- return new K(t);
285
+ return new $(t);
285
286
  }
286
- function yt(t, e) {
287
- return new Ne(t, e);
287
+ function yt(t) {
288
+ return new K(t);
288
289
  }
289
- function vt(t) {
290
- return new je(t);
290
+ function vt(t, e) {
291
+ return new Ve(t, e);
291
292
  }
292
293
  function wt(t) {
293
- return new Ve(t);
294
+ return new We(t);
294
295
  }
295
296
  function gt(t) {
296
- return new We(t);
297
+ return new $e(t);
298
+ }
299
+ function pt(t) {
300
+ return new Ke(t);
297
301
  }
298
- function k(t) {
302
+ function M(t) {
299
303
  const { styleOptions: e, ...n } = t ?? {}, a = e ? P(e) : n.style;
300
304
  return new Q({
301
305
  ...n,
302
306
  style: a
303
307
  });
304
308
  }
305
- function Vt(t, e) {
306
- const n = ft(t);
307
- return k({
309
+ function $t(t, e) {
310
+ const n = dt(t);
311
+ return M({
308
312
  ...e,
309
313
  geometry: n
310
314
  });
311
315
  }
312
- function Wt(t, e) {
313
- const n = dt(t);
314
- return k({
316
+ function Kt(t, e) {
317
+ const n = mt(t);
318
+ return M({
315
319
  ...e,
316
320
  geometry: n
317
321
  });
318
322
  }
319
- function $t(t, e) {
320
- const n = mt(t);
321
- return k({
323
+ function Xt(t, e) {
324
+ const n = yt(t);
325
+ return M({
322
326
  ...e,
323
327
  geometry: n
324
328
  });
325
329
  }
326
- function Kt(t, e, n) {
327
- const a = yt(t, e);
328
- return k({
330
+ function Yt(t, e, n) {
331
+ const a = vt(t, e);
332
+ return M({
329
333
  ...n,
330
334
  geometry: a
331
335
  });
332
336
  }
333
- function Xt(t, e) {
334
- const n = vt(t);
335
- return k({
337
+ function Ut(t, e) {
338
+ const n = wt(t);
339
+ return M({
336
340
  ...e,
337
341
  geometry: n
338
342
  });
339
343
  }
340
- function Yt(t, e) {
341
- const n = wt(t);
342
- return k({
344
+ function Ht(t, e) {
345
+ const n = gt(t);
346
+ return M({
343
347
  ...e,
344
348
  geometry: n
345
349
  });
346
350
  }
347
- function Ut(t, e) {
348
- const n = gt(t);
349
- return k({
351
+ function Qt(t, e) {
352
+ const n = pt(t);
353
+ return M({
350
354
  ...e,
351
355
  geometry: n
352
356
  });
353
357
  }
354
- function pt(t) {
358
+ function St(t) {
355
359
  const { type: e = "img", projection: n = ge, key: a } = t, r = t.url || "https://t{0-4}.tianditu.gov.cn", i = `&tk=${a}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}`;
356
- return `${r}/${e}_${n === st ? "c" : n === ge ? "w" : "c"}/wmts?LAYER=${e}${i}`;
360
+ return `${r}/${e}_${n === ut ? "c" : n === ge ? "w" : "c"}/wmts?LAYER=${e}${i}`;
357
361
  }
358
- function Ht(t) {
362
+ function qt(t) {
359
363
  const { zIndex: e, projection: n, className: a } = t;
360
364
  return new ee({
361
365
  className: a,
362
- source: new ot({
363
- url: pt(t),
366
+ source: new it({
367
+ url: St(t),
364
368
  projection: n,
365
369
  crossOrigin: "Anonymous"
366
370
  }),
367
371
  zIndex: e
368
372
  });
369
373
  }
370
- function Qt({
374
+ function Jt({
371
375
  name: t,
372
376
  zIndex: e,
373
377
  key: n,
@@ -375,7 +379,7 @@ function Qt({
375
379
  }) {
376
380
  return new ee({
377
381
  className: a,
378
- source: new rt({
382
+ source: new at({
379
383
  key: n,
380
384
  imagerySet: t,
381
385
  placeholderTiles: !1
@@ -383,16 +387,16 @@ function Qt({
383
387
  zIndex: e
384
388
  });
385
389
  }
386
- function qt(t) {
390
+ function en(t) {
387
391
  return new ee({
388
392
  className: t == null ? void 0 : t.className,
389
- source: new it({
393
+ source: new ct({
390
394
  crossOrigin: "Anonymous"
391
395
  }),
392
396
  zIndex: t == null ? void 0 : t.zIndex
393
397
  });
394
398
  }
395
- function Jt(t) {
399
+ function tn(t) {
396
400
  const { styleOptions: e, ...n } = t || {}, a = e ? P(e) : void 0, r = new J(), i = new q({
397
401
  source: r,
398
402
  ...n,
@@ -406,30 +410,30 @@ function Jt(t) {
406
410
  function te(t) {
407
411
  return be(t, _, A);
408
412
  }
409
- const en = te;
410
- function St(t) {
413
+ const nn = te;
414
+ function ht(t) {
411
415
  return be(t, A, _);
412
416
  }
413
- const tn = St;
414
- function ht(t) {
417
+ const on = ht;
418
+ function Ot(t) {
415
419
  return xe(t, _, A);
416
420
  }
417
- const nn = ht;
421
+ const rn = Ot;
418
422
  function ne(t) {
419
423
  return xe(t, A, _);
420
424
  }
421
- const on = ne;
422
- function rn(t, e, n = 60) {
425
+ const an = ne;
426
+ function cn(t, e, n = 60) {
423
427
  const a = [], r = 360 / n;
424
428
  for (let i = -180; i < 180; i = i + r)
425
- a.push(ct(t, e, i));
429
+ a.push(lt(t, e, i));
426
430
  return [a];
427
431
  }
428
432
  function D(t) {
429
433
  const e = document.createElement("div");
430
434
  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;
431
435
  }
432
- function an(t, e) {
436
+ function ln(t, e) {
433
437
  const n = g(!0), a = g([]), r = Se(() => a.value.map((u) => u.getGeometry().getCoordinates())), i = new J(), c = e.styleOptions ? P(e.styleOptions) : e == null ? void 0 : e.style, f = new q({
434
438
  source: i,
435
439
  style: c,
@@ -446,7 +450,7 @@ function an(t, e) {
446
450
  source: i,
447
451
  style: w || c
448
452
  }), m = /* @__PURE__ */ new Set();
449
- t.addInteraction(l), N(() => {
453
+ t.addInteraction(l), j(() => {
450
454
  t.addInteraction(y);
451
455
  }), i.on("addfeature", () => {
452
456
  e.size && i.getFeatures().length >= e.size && l.setActive(!1);
@@ -460,30 +464,30 @@ function an(t, e) {
460
464
  };
461
465
  i.on("change", () => {
462
466
  v(), i.getFeatures().forEach((u) => {
463
- const h = u.getGeometry(), o = Le(ne(h.getExtent()));
467
+ const h = u.getGeometry(), o = Pe(ne(h.getExtent()));
464
468
  let O = document.createElement("div");
465
469
  e.deleteFeatureLabel ? z(e.deleteFeatureLabel, O) : O = D("删除线"), O.addEventListener("click", () => {
466
470
  i.removeFeature(u);
467
471
  });
468
- const F = new G({
472
+ const k = new G({
469
473
  position: te(o),
470
474
  positioning: "center-center",
471
475
  element: O
472
476
  });
473
- m.add(F), t.addOverlay(F);
477
+ m.add(k), t.addOverlay(k);
474
478
  const C = h.getCoordinates();
475
- C.length < 3 || C.forEach((j, V) => {
479
+ C.length < 3 || C.forEach((N, V) => {
476
480
  let L = document.createElement("div");
477
481
  e.deletePointLabel ? z(e.deletePointLabel, L) : L = D("删除点"), L.addEventListener("click", () => {
478
- u.setGeometry(new $(C.filter((Ie, W) => W !== V)));
482
+ u.setGeometry(new $(C.filter((Ce, W) => W !== V)));
479
483
  });
480
- const M = new G({
481
- position: j,
484
+ const F = new G({
485
+ position: N,
482
486
  positioning: "top-center",
483
487
  offset: [0, -30],
484
488
  element: L
485
489
  });
486
- m.add(M), t.addOverlay(M);
490
+ m.add(F), t.addOverlay(F);
487
491
  });
488
492
  });
489
493
  }), l.on("change:active", () => {
@@ -527,7 +531,7 @@ function an(t, e) {
527
531
  destroy: p
528
532
  };
529
533
  }
530
- function cn(t, e) {
534
+ function sn(t, e) {
531
535
  const n = g(!0), a = g([]), r = Se(() => a.value.map((u) => u.getGeometry().getCoordinates())), i = e.styleOptions ? P(e.styleOptions) : e == null ? void 0 : e.style, c = new J(), f = new q({
532
536
  source: c,
533
537
  style: i,
@@ -544,7 +548,7 @@ function cn(t, e) {
544
548
  source: c,
545
549
  style: w || i
546
550
  }), m = /* @__PURE__ */ new Set();
547
- t.addInteraction(l), N(() => {
551
+ t.addInteraction(l), j(() => {
548
552
  t.addInteraction(y);
549
553
  }), c.on("addfeature", () => {
550
554
  e.size && c.getFeatures().length >= e.size && l.setActive(!1);
@@ -558,30 +562,30 @@ function cn(t, e) {
558
562
  };
559
563
  c.on("change", () => {
560
564
  v(), c.getFeatures().forEach((u) => {
561
- const h = u.getGeometry(), o = Le(ne(h.getExtent()));
565
+ const h = u.getGeometry(), o = Pe(ne(h.getExtent()));
562
566
  let O = document.createElement("div");
563
567
  e.deleteFeatureLabel ? z(e.deleteFeatureLabel, O) : O = D("删除区域"), O.addEventListener("click", () => {
564
568
  c.removeFeature(u);
565
569
  });
566
- const F = new G({
570
+ const k = new G({
567
571
  position: te(o),
568
572
  positioning: "center-center",
569
573
  element: O
570
574
  });
571
- m.add(F), t.addOverlay(F);
575
+ m.add(k), t.addOverlay(k);
572
576
  const C = h.getCoordinates()[0];
573
- C.length < 3 || C.forEach((j, V) => {
577
+ C.length < 3 || C.forEach((N, V) => {
574
578
  let L = document.createElement("div");
575
579
  e.deletePointLabel ? z(e.deletePointLabel, L) : L = D("删除点"), L.addEventListener("click", () => {
576
- u.setGeometry(new K([C.filter((Ie, W) => W !== V)]));
580
+ u.setGeometry(new K([C.filter((Ce, W) => W !== V)]));
577
581
  });
578
- const M = new G({
579
- position: j,
582
+ const F = new G({
583
+ position: N,
580
584
  positioning: "top-center",
581
585
  offset: [0, -30],
582
586
  element: L
583
587
  });
584
- m.add(M), t.addOverlay(M);
588
+ m.add(F), t.addOverlay(F);
585
589
  });
586
590
  });
587
591
  }), l.on("change:active", () => {
@@ -628,8 +632,8 @@ function cn(t, e) {
628
632
  destroy: p
629
633
  };
630
634
  }
631
- function ln(t) {
632
- const e = g(t.defaultShow || !1), { strokeStyleOption: n, strokeStyle: a, labelStyleOption: r, latLabelStyleOption: i, lonLabelStyleOption: c, latLabelStyle: f, lonLabelStyle: s, ...l } = t.graticuleOptions || {}, w = n ? new T(n) : a, y = r ? R(r) : void 0, m = (i ? R(i) : f) || y, v = (c ? R(c) : s) || y, p = new nt({
635
+ function un(t) {
636
+ const e = g(t.defaultShow || !1), { strokeStyleOption: n, strokeStyle: a, labelStyleOption: r, latLabelStyleOption: i, lonLabelStyleOption: c, latLabelStyle: f, lonLabelStyle: s, ...l } = t.graticuleOptions || {}, w = n ? new T(n) : a, y = r ? R(r) : void 0, m = (i ? R(i) : f) || y, v = (c ? R(c) : s) || y, p = new rt({
633
637
  ...l,
634
638
  strokeStyle: w,
635
639
  latLabelStyle: m,
@@ -639,7 +643,7 @@ function ln(t) {
639
643
  e,
640
644
  (E) => {
641
645
  if (p.setMap(null), E) {
642
- const S = _e(t.olMap);
646
+ const S = Ze(t.olMap);
643
647
  S && p.setMap(S);
644
648
  }
645
649
  },
@@ -651,7 +655,7 @@ function ln(t) {
651
655
  showGraticule: e
652
656
  };
653
657
  }
654
- function sn(t) {
658
+ function fn(t) {
655
659
  const e = g(t.defaultLayerName || Object.keys(t.layers)[0]);
656
660
  return Object.values(t.layers).forEach((n) => {
657
661
  n.forEach((a) => {
@@ -674,58 +678,59 @@ function sn(t) {
674
678
  }
675
679
  export {
676
680
  A as EPSG_3857,
677
- on as EPSG_3857ExtentToEPSG_4326,
678
- tn as EPSG_3857ToEPSG_4326,
681
+ an as EPSG_3857ExtentToEPSG_4326,
682
+ on as EPSG_3857ToEPSG_4326,
679
683
  _ as EPSG_4326,
680
- nn as EPSG_4326ExtentToEPSG_3857,
681
- en as EPSG_4326ToEPSG_3857,
682
- Rt as NOlContextmenu,
683
- Zt as NOlPointermove,
684
- Pe as ONE_NM,
685
- zt as OlMap,
686
- st as WGS84Projection,
684
+ rn as EPSG_4326ExtentToEPSG_3857,
685
+ nn as EPSG_4326ToEPSG_3857,
686
+ Zt as NOlContextmenu,
687
+ zt as NOlPointermove,
688
+ Ie as ONE_NM,
689
+ Bt as OlMap,
690
+ ut as WGS84Projection,
687
691
  ge as WebMercatorProjection,
688
- yt as createCircle,
689
- Kt as createCircleFeature,
690
- ut as createCircleStyle,
691
- k as createFeature,
692
- dt as createLineString,
693
- Wt as createLineStringFeature,
694
- wt as createMultiLineString,
695
- Yt as createMultiLineStringFeature,
696
- vt as createMultiPoint,
697
- Xt as createMultiPointFeature,
698
- gt as createMultiPolygon,
699
- Ut as createMultiPolygonFeature,
700
- ft as createPoint,
701
- Vt as createPointFeature,
702
- mt as createPolygon,
703
- $t as createPolygonFeature,
692
+ vt as createCircle,
693
+ Yt as createCircleFeature,
694
+ ft as createCircleStyle,
695
+ M as createFeature,
696
+ mt as createLineString,
697
+ Kt as createLineStringFeature,
698
+ gt as createMultiLineString,
699
+ Ht as createMultiLineStringFeature,
700
+ wt as createMultiPoint,
701
+ Ut as createMultiPointFeature,
702
+ pt as createMultiPolygon,
703
+ Qt as createMultiPolygonFeature,
704
+ dt as createPoint,
705
+ $t as createPointFeature,
706
+ yt as createPolygon,
707
+ Xt as createPolygonFeature,
704
708
  P as createStyle,
705
709
  R as createTextStyle,
706
- Jt as createVectorLayer,
707
- Dt as getAngle,
708
- Bt as getArea,
709
- Qt as getBingLayer,
710
- lt as getCenter,
711
- ct as getDestinationPoint,
712
- Le as getExtentCenter,
713
- Gt as getLineLength,
714
- qt as getOSMLayer,
715
- rn as getRealCircleCoordinates,
716
- Ht as getTianDiTuLayer,
717
- pt as getTianDiTuUrl,
718
- Nt as kmToNauticalMiles,
710
+ tn as createVectorLayer,
711
+ Nt as getAngle,
712
+ jt as getArea,
713
+ Jt as getBingLayer,
714
+ st as getCenter,
715
+ lt as getDestinationPoint,
716
+ Pe as getExtentCenter,
717
+ Dt as getLineLength,
718
+ en as getOSMLayer,
719
+ cn as getRealCircleCoordinates,
720
+ qt as getTianDiTuLayer,
721
+ St as getTianDiTuUrl,
722
+ Vt as kmToNauticalMiles,
719
723
  ne as mercatorExtentToWgs84,
720
- St as mercatorToWgs84,
721
- jt as nauticalMilesToKm,
722
- at as olMapInjectionKey,
724
+ ht as mercatorToWgs84,
725
+ Wt as nauticalMilesToKm,
726
+ Le as olMapInjectionKey,
723
727
  X as toOlAngle,
724
728
  Y as toTurfAngle,
725
- an as useDrawLineString,
726
- cn as useDrawPolygon,
727
- ln as useGraticule,
728
- sn as useSwitchBaseLayer,
729
- ht as wgs84ExtentToMercator,
729
+ ln as useDrawLineString,
730
+ sn as useDrawPolygon,
731
+ un as useGraticule,
732
+ Gt as useOlMap,
733
+ fn as useSwitchBaseLayer,
734
+ Ot as wgs84ExtentToMercator,
730
735
  te as wgs84ToMercator
731
736
  };
@@ -26,3 +26,4 @@ export interface OlMapProps {
26
26
  altShiftDragRotate?: boolean;
27
27
  }
28
28
  export declare const olMapInjectionKey: InjectionKey<OLMap>;
29
+ export declare function useOlMap(): OLMap | undefined;
@@ -1,4 +1,9 @@
1
- const o = Symbol("olMapInjectionKey");
1
+ import { inject as o } from "vue";
2
+ const n = Symbol("olMapInjectionKey");
3
+ function t() {
4
+ return o(n);
5
+ }
2
6
  export {
3
- o as olMapInjectionKey
7
+ n as olMapInjectionKey,
8
+ t as useOlMap
4
9
  };
package/es/index.mjs CHANGED
@@ -1,75 +1,76 @@
1
1
  import { default as r } from "./components/n-ol-contextmenu/index.vue.mjs";
2
2
  import { default as a } from "./components/n-ol-pointermove/index.vue.mjs";
3
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
- import { ONE_NM as E } from "./constants/distance.mjs";
10
- import { EPSG_3857 as M, EPSG_4326 as y, WGS84Projection as G, WebMercatorProjection as L } from "./constants/projection.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";
4
+ import { olMapInjectionKey as c, useOlMap as g } from "./components/ol-map/props.mjs";
5
+ import { useDrawLineString as x } from "./composables/useDrawLineString/index.mjs";
6
+ import { useDrawPolygon as P } from "./composables/useDrawPolygon/index.mjs";
7
+ import { useGraticule as p } from "./composables/useGraticule/index.mjs";
8
+ import { useSwitchBaseLayer as s } from "./composables/useSwitchBaseLayer/index.mjs";
9
+ import { ONE_NM as M } from "./constants/distance.mjs";
10
+ import { EPSG_3857 as y, EPSG_4326 as G, WGS84Projection as L, WebMercatorProjection as _ } from "./constants/projection.mjs";
11
+ import { getAngle as F, getArea as O, getCenter as w, getDestinationPoint as D, getExtentCenter as N, getLineLength as d } from "./utils/calculate/index.mjs";
12
+ import { kmToNauticalMiles as W, nauticalMilesToKm as j } from "./utils/distance/index.mjs";
13
+ import { createCircle as B, createCircleFeature as K, createFeature as b, createLineString as k, createLineStringFeature as v, createMultiLineString as I, createMultiLineStringFeature as R, createMultiPoint as U, createMultiPointFeature as V, createMultiPolygon as q, createMultiPolygonFeature as z, createPoint as H, createPointFeature as J, createPolygon as Q, createPolygonFeature as X } from "./utils/feature/index.mjs";
14
+ import { toOlAngle as Z, toTurfAngle as $ } from "./utils/format/index.mjs";
15
+ import { createVectorLayer as te, getBingLayer as re, getOSMLayer as oe, getTianDiTuLayer as ae, getTianDiTuUrl as ne } from "./utils/layer/index.mjs";
16
+ import { EPSG_3857ExtentToEPSG_4326 as le, EPSG_3857ToEPSG_4326 as ce, EPSG_4326ExtentToEPSG_3857 as ge, EPSG_4326ToEPSG_3857 as ue, mercatorExtentToWgs84 as xe, mercatorToWgs84 as me, wgs84ExtentToMercator as Pe, wgs84ToMercator as fe } from "./utils/projection/index.mjs";
17
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";
18
+ import { createCircleStyle as Ee, createStyle as Me, createTextStyle as Te } from "./utils/style/index.mjs";
19
19
  export {
20
- M as EPSG_3857,
21
- ie as EPSG_3857ExtentToEPSG_4326,
20
+ y as EPSG_3857,
21
+ le as EPSG_3857ExtentToEPSG_4326,
22
22
  ce as EPSG_3857ToEPSG_4326,
23
- y as EPSG_4326,
24
- le as EPSG_4326ExtentToEPSG_3857,
25
- ge as EPSG_4326ToEPSG_3857,
23
+ G as EPSG_4326,
24
+ ge as EPSG_4326ExtentToEPSG_3857,
25
+ ue as EPSG_4326ToEPSG_3857,
26
26
  r as NOlContextmenu,
27
27
  a as NOlPointermove,
28
- E as ONE_NM,
28
+ M as ONE_NM,
29
29
  i as OlMap,
30
- G as WGS84Projection,
31
- L as WebMercatorProjection,
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,
30
+ L as WGS84Projection,
31
+ _ as WebMercatorProjection,
32
+ B as createCircle,
33
+ K as createCircleFeature,
34
+ Ee as createCircleStyle,
35
+ b as createFeature,
36
+ k as createLineString,
37
+ v as createLineStringFeature,
38
+ I as createMultiLineString,
39
+ R as createMultiLineStringFeature,
40
+ U as createMultiPoint,
41
+ V as createMultiPointFeature,
42
+ q as createMultiPolygon,
43
+ z as createMultiPolygonFeature,
44
+ H as createPoint,
45
+ J as createPointFeature,
46
+ Q as createPolygon,
47
+ X as createPolygonFeature,
48
+ Me as createStyle,
49
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,
50
+ te as createVectorLayer,
51
+ F as getAngle,
52
+ O as getArea,
53
+ re as getBingLayer,
54
+ w as getCenter,
55
+ D as getDestinationPoint,
56
+ N as getExtentCenter,
57
+ d as getLineLength,
58
+ oe as getOSMLayer,
59
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
60
+ ae as getTianDiTuLayer,
61
+ ne as getTianDiTuUrl,
62
+ W as kmToNauticalMiles,
63
+ xe as mercatorExtentToWgs84,
64
+ me as mercatorToWgs84,
65
+ j as nauticalMilesToKm,
66
+ c as olMapInjectionKey,
67
+ Z as toOlAngle,
68
+ $ as toTurfAngle,
69
+ x as useDrawLineString,
70
+ P as useDrawPolygon,
71
+ p as useGraticule,
72
+ g as useOlMap,
73
+ s as useSwitchBaseLayer,
74
+ Pe as wgs84ExtentToMercator,
75
+ fe as wgs84ToMercator
75
76
  };
@@ -1,3 +1,4 @@
1
+ import { T_MAP_TYPE } from '@summeruse/common';
1
2
  import { Feature } from 'ol';
2
3
  import { Geometry } from 'ol/geom';
3
4
  import { ProjectionLike } from 'ol/proj';
@@ -6,17 +7,6 @@ import { Tile as TileLayer } from 'ol/layer';
6
7
  import { default as VectorLayer } from 'ol/layer/Vector';
7
8
  import { BingMaps, OSM, XYZ } from 'ol/source';
8
9
  import { default as VectorSource } from 'ol/source/Vector';
9
- /**
10
- * 天地图类型
11
- * vec: 矢量底图
12
- * cva: 矢量注记
13
- * img: 影像底图
14
- * cia: 影像注记
15
- * ter: 地形晕渲
16
- * cta: 地形注记
17
- * ibo: 全球境界
18
- */
19
- export type T_MAP_TYPE = 'vec' | 'cva' | 'img' | 'cia' | 'ter' | 'cta' | 'ibo';
20
10
  export declare function getTianDiTuUrl(data: {
21
11
  url?: string;
22
12
  type: T_MAP_TYPE;
@@ -26,3 +26,4 @@ export interface OlMapProps {
26
26
  altShiftDragRotate?: boolean;
27
27
  }
28
28
  export declare const olMapInjectionKey: InjectionKey<OLMap>;
29
+ export declare function useOlMap(): OLMap | undefined;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Symbol("olMapInjectionKey");exports.olMapInjectionKey=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),e=Symbol("olMapInjectionKey");function o(){return n.inject(e)}exports.olMapInjectionKey=e;exports.useOlMap=o;
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/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
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./components/n-ol-contextmenu/index.vue.js"),g=require("./components/n-ol-pointermove/index.vue.js"),s=require("./components/ol-map/index.vue.js"),o=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"),c=require("./utils/distance/index.js"),e=require("./utils/feature/index.js"),u=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=l.default;exports.NOlPointermove=g.default;exports.OlMap=s.default;exports.olMapInjectionKey=o.olMapInjectionKey;exports.useOlMap=o.useOlMap;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=c.kmToNauticalMiles;exports.nauticalMilesToKm=c.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=u.toOlAngle;exports.toTurfAngle=u.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,3 +1,4 @@
1
+ import { T_MAP_TYPE } from '@summeruse/common';
1
2
  import { Feature } from 'ol';
2
3
  import { Geometry } from 'ol/geom';
3
4
  import { ProjectionLike } from 'ol/proj';
@@ -6,17 +7,6 @@ import { Tile as TileLayer } from 'ol/layer';
6
7
  import { default as VectorLayer } from 'ol/layer/Vector';
7
8
  import { BingMaps, OSM, XYZ } from 'ol/source';
8
9
  import { default as VectorSource } from 'ol/source/Vector';
9
- /**
10
- * 天地图类型
11
- * vec: 矢量底图
12
- * cva: 矢量注记
13
- * img: 影像底图
14
- * cia: 影像注记
15
- * ter: 地形晕渲
16
- * cta: 地形注记
17
- * ibo: 全球境界
18
- */
19
- export type T_MAP_TYPE = 'vec' | 'cva' | 'img' | 'cia' | 'ter' | 'cta' | 'ibo';
20
10
  export declare function getTianDiTuUrl(data: {
21
11
  url?: string;
22
12
  type: T_MAP_TYPE;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@summeruse/ol",
3
3
  "type": "module",
4
- "version": "0.1.1-beta.1",
4
+ "version": "0.1.1",
5
5
  "description": "",
6
6
  "author": "finalsummer",
7
7
  "license": "ISC",
@@ -29,11 +29,11 @@
29
29
  "peerDependencies": {
30
30
  "@turf/turf": "7.2.0",
31
31
  "naive-ui": "^2.41.0",
32
- "ol": "10.5.0"
32
+ "ol": "10.5.0",
33
+ "vue": "^3.5.13"
33
34
  },
34
35
  "dependencies": {
35
- "vue": "^3.5.13",
36
- "@summeruse/common": "0.0.0"
36
+ "@summeruse/common": "0.0.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@turf/turf": "7.2.0",