@shjjs/visual-ui 3.0.7 → 3.0.8

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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as N, computed as ie, watch as u, createElementBlock as S, openBlock as L, createElementVNode as E, createCommentVNode as D, normalizeClass as ne, unref as w, toDisplayString as ce, shallowRef as J, ref as h, onMounted as me, onUnmounted as de } from "vue";
2
- import ue from "@amap/amap-jsapi-loader";
3
- import ye from "axios";
4
- import { nanoid as pe } from "nanoid";
5
- import { debounce as M } from "lodash";
1
+ import { defineComponent as F, computed as ue, watch as y, createElementBlock as E, openBlock as A, createElementVNode as I, createCommentVNode as T, normalizeClass as me, unref as x, toDisplayString as de, shallowRef as N, ref as p, onMounted as ye, onUnmounted as pe } from "vue";
2
+ import ge from "@amap/amap-jsapi-loader";
3
+ import ve from "axios";
4
+ import { nanoid as fe } from "nanoid";
5
+ import { debounce as O } from "lodash";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  import "../../../Interaction/components/Tabs/index.mjs";
@@ -158,18 +158,18 @@ import "../UnityIframe/index.mjs";
158
158
  import "../UnityWebgl/index.mjs";
159
159
  import "../Vr/index.mjs";
160
160
  import "../Earth/index.mjs";
161
- import { SHJDatasourceV2 as ge } from "../../../../commons/plugins/datasource/index.mjs";
162
- import { SHJParseEvent as p } from "../../../../commons/plugins/event/index.mjs";
163
- import { upgradeAmap3d as fe } from "./version.mjs";
164
- const ve = { class: "relative w-full h-full" }, he = {
161
+ import { SHJDatasourceV2 as he } from "../../../../commons/plugins/datasource/index.mjs";
162
+ import { SHJParseEvent as f } from "../../../../commons/plugins/event/index.mjs";
163
+ import { upgradeAmap3d as ke } from "./version.mjs";
164
+ const be = { class: "relative w-full h-full" }, ze = {
165
165
  key: 0,
166
166
  class: "empty-wrap"
167
- }, ke = {
167
+ }, we = {
168
168
  key: 0,
169
169
  class: "iconfont shj-gaodeditu",
170
170
  style: { "font-size": "48px" }
171
- }, be = { class: "text-gray-500" }, ze = N({ name: "ShjAmap3d" }), xr = /* @__PURE__ */ N({
172
- ...ze,
171
+ }, xe = { class: "text-gray-500" }, Ce = F({ name: "ShjAmap3d" }), Lr = /* @__PURE__ */ F({
172
+ ...Ce,
173
173
  props: {
174
174
  option: {},
175
175
  sources: {},
@@ -185,12 +185,16 @@ const ve = { class: "relative w-full h-full" }, he = {
185
185
  "amap3d-scene-dragend",
186
186
  "amap3d-scene-pulseLinkLayer"
187
187
  ],
188
- setup(m, { expose: T, emit: F }) {
189
- const o = ie(() => fe(m.option)), y = F, G = () => {
190
- const s = J(), c = J(), x = h(!1), k = h(), b = h(), z = h(), d = h(), C = h(""), B = (t) => {
191
- $(), window._AMapSecurityConfig = {
188
+ setup(u, { expose: H, emit: G }) {
189
+ const s = ue(() => ke(u.option)), g = G, Z = () => {
190
+ const l = N(), c = N(), C = p(!1), S = p(!1);
191
+ let L = 0;
192
+ const b = p(), z = p(), w = p(), d = p(), M = p(""), v = p(null), $ = (t) => {
193
+ L += 1;
194
+ const e = L;
195
+ S.value = !1, J(), window._AMapSecurityConfig = {
192
196
  securityJsCode: t.basic.securityJsCode
193
- }, ue.load({
197
+ }, ge.load({
194
198
  key: t.basic.key,
195
199
  // 申请好的Web端开发者Key,首次调用 load 时必填
196
200
  version: "2.0",
@@ -207,9 +211,10 @@ const ve = { class: "relative w-full h-full" }, he = {
207
211
  "AMap.ImageLayer",
208
212
  "AMap.TileLayer"
209
213
  ]
210
- }).then((e) => {
211
- d.value = e;
212
- const a = new d.value.createDefaultLayer({
214
+ }).then((a) => {
215
+ if (S.value || e !== L) return;
216
+ d.value = a;
217
+ const o = new d.value.createDefaultLayer({
213
218
  visible: !0,
214
219
  // 是否可见
215
220
  opacity: 1,
@@ -217,7 +222,7 @@ const ve = { class: "relative w-full h-full" }, he = {
217
222
  zIndex: 0
218
223
  // 叠加层级
219
224
  });
220
- s.value = new e.Map("zerov-amap-3d", {
225
+ l.value = new a.Map("zerov-amap-3d", {
221
226
  rotateEnable: t.config.rotateEnable,
222
227
  // 是否开启地图旋转交互 鼠标右键 + 鼠标画圈移动 或 键盘Ctrl + 鼠标画圈移动
223
228
  pitchEnable: t.config.pitchEnable,
@@ -242,129 +247,126 @@ const ve = { class: "relative w-full h-full" }, he = {
242
247
  wallColor: t.config.floors.wallColor,
243
248
  roofColor: t.config.floors.roofColor,
244
249
  skyColor: t.config.skyColor,
245
- layers: [a]
250
+ layers: [o]
246
251
  }), c.value = new window.Loca.Container({
247
- map: s.value
248
- }), z.value = new d.value.Scale({
252
+ map: l.value
253
+ }), w.value = new d.value.Scale({
249
254
  visible: t.config.plugin.scale.visible,
250
255
  position: {
251
256
  left: t.config.plugin.scale.position.left + "px",
252
257
  bottom: t.config.plugin.scale.position.bottom + "px"
253
258
  }
254
- }), s.value.addControl(z.value), k.value = new e.ControlBar({
259
+ }), l.value.addControl(w.value), b.value = new a.ControlBar({
255
260
  visible: t.config.plugin.controlBar.visible,
256
261
  showControlButton: t.config.plugin.controlBar.showControlButton,
257
262
  position: {
258
263
  right: t.config.plugin.controlBar.position.right + "px",
259
264
  top: t.config.plugin.controlBar.position.top + "px"
260
265
  }
261
- }), s.value.addControl(k.value), b.value = new e.ToolBar({
266
+ }), l.value.addControl(b.value), z.value = new a.ToolBar({
262
267
  visible: t.config.plugin.toolBar.visible,
263
268
  position: {
264
269
  left: t.config.plugin.toolBar.position.left + "px",
265
270
  top: t.config.plugin.toolBar.position.top + "px"
266
271
  }
267
- }), s.value.addControl(b.value), W(e), s.value.on("complete", () => {
272
+ }), l.value.addControl(z.value), D(a), l.value.on("complete", () => {
268
273
  setTimeout(() => {
269
- x.value = !0, y("amap3d-scene-success"), p.parseEvents(m.useEvents, "amap3d-scene-success", null), C.value = "";
274
+ C.value = !0, g("amap3d-scene-success"), f.parseEvents(u.useEvents, "amap3d-scene-success", null), M.value = "";
270
275
  }, 666);
271
- }), s.value.on("zoomstart", () => {
272
- y("amap3d-scene-zoomstart"), p.parseEvents(m.useEvents, "amap3d-scene-zoomstart", null);
273
- }), s.value.on("zoomend", () => {
274
- y("amap3d-scene-zoomend"), p.parseEvents(m.useEvents, "amap3d-scene-zoomend", null);
275
- }), s.value.on("click", (r) => {
276
- y("amap3d-scene-mapclick", r.lnglat), p.parseEvents(
277
- m.useEvents,
276
+ }), l.value.on("zoomstart", () => {
277
+ g("amap3d-scene-zoomstart"), f.parseEvents(u.useEvents, "amap3d-scene-zoomstart", null);
278
+ }), l.value.on("zoomend", () => {
279
+ g("amap3d-scene-zoomend"), f.parseEvents(u.useEvents, "amap3d-scene-zoomend", null);
280
+ }), l.value.on("click", (r) => {
281
+ g("amap3d-scene-mapclick", r.lnglat), f.parseEvents(
282
+ u.useEvents,
278
283
  "amap3d-scene-mapclick",
279
284
  r.lnglat
280
285
  );
281
- }), s.value.on("dragstart", (r) => {
282
- y("amap3d-scene-dragstart", r.lnglat), p.parseEvents(
283
- m.useEvents,
286
+ }), l.value.on("dragstart", (r) => {
287
+ g("amap3d-scene-dragstart", r.lnglat), f.parseEvents(
288
+ u.useEvents,
284
289
  "amap3d-scene-dragstart",
285
290
  r.lnglat
286
291
  );
287
- }), s.value.on("dragend", (r) => {
288
- y("amap3d-scene-dragend", r.lnglat), p.parseEvents(
289
- m.useEvents,
292
+ }), l.value.on("dragend", (r) => {
293
+ g("amap3d-scene-dragend", r.lnglat), f.parseEvents(
294
+ u.useEvents,
290
295
  "amap3d-scene-dragend",
291
296
  r.lnglat
292
297
  );
293
298
  });
294
- }).catch((e) => {
295
- x.value = !1, C.value = "缺少必要的Key和密钥,请先在右侧配置面板中进行配置";
299
+ }).catch((a) => {
300
+ C.value = !1, M.value = "缺少必要的Key和密钥,请先在右侧配置面板中进行配置";
296
301
  });
297
- }, W = M((t) => {
298
- m.sources && m.sources.length > 0 ? o.value.widgets.forEach((a, r) => {
299
- ge.parse({
300
- sources: [m.sources[r]],
301
- callback: (l) => {
302
+ }, D = O((t) => {
303
+ u.sources && u.sources.length > 0 && s.value.widgets.forEach((a, o) => {
304
+ a && a.type === "boundary" || he.parse({
305
+ sources: [u.sources[o]],
306
+ callback: (r) => {
302
307
  try {
303
- a && a.type === "heatmap" && K(
308
+ a && a.type === "heatmap" && X(
304
309
  window.Loca,
305
310
  a,
306
- f(l.data[0].data, "Point")
307
- ), a && a.type === "dotlayers" && Q(
311
+ k(r.data[0].data, "Point")
312
+ ), a && a.type === "dotlayers" && _(
308
313
  window.Loca,
309
314
  a,
310
- f(l.data[0].data, "Point")
311
- ), a && a.type === "scatter" && X(
315
+ k(r.data[0].data, "Point")
316
+ ), a && a.type === "scatter" && ee(
312
317
  window.Loca,
313
318
  a,
314
- f(l.data[0].data, "Point")
315
- ), a && a.type === "labelsLayer" && Y(
319
+ k(r.data[0].data, "Point")
320
+ ), a && a.type === "labelsLayer" && te(
316
321
  window.Loca,
317
322
  a,
318
- f(l.data[0].data, "Point")
319
- ), a && a.type === "signagePoints" && _(
323
+ k(r.data[0].data, "Point")
324
+ ), a && a.type === "signagePoints" && ae(
320
325
  window.Loca,
321
326
  a,
322
- f(l.data[0].data, "Point")
323
- ), a && a.type === "pulseLinkLayer" && ee(
327
+ k(r.data[0].data, "Point")
328
+ ), a && a.type === "pulseLinkLayer" && re(
324
329
  window.Loca,
325
330
  a,
326
- f(l.data[0].data, "LineString")
331
+ k(r.data[0].data, "LineString")
327
332
  );
328
333
  } catch {
329
334
  }
330
- o.value.widgets.filter((i) => i.type === "boundary").forEach((i) => {
331
- P(t, i);
332
- });
333
335
  }
334
336
  });
335
- }) : o.value.widgets.filter((a) => a.type === "boundary").forEach((a) => {
336
- P(t, a);
337
+ }), s.value.widgets.filter((a) => a.type === "boundary").forEach((a) => {
338
+ Y(t, a);
337
339
  });
338
- const e = s.value.getLayers();
340
+ const e = l.value.getLayers();
339
341
  for (let a = 0; a < e.length; a++)
340
- (e[a].type === "sketchTileLayer" || e[a]._opts.type === "sketchImageLayer") && s.value.removeLayer(e[a]);
341
- o.value.widgets.filter((a) => a.type === "sketchTile").forEach((a) => {
342
- const r = U(a);
343
- r && s.value.addLayer(r);
344
- }), o.value.widgets.filter((a) => a.type === "sketchImage").forEach((a) => {
345
- const r = q(a);
346
- s.value.addLayer(r);
342
+ (e[a].type === "sketchTileLayer" || e[a]._opts.type === "sketchImageLayer") && l.value.removeLayer(e[a]);
343
+ s.value.widgets.filter((a) => a.type === "sketchTile").forEach((a) => {
344
+ const o = K(a);
345
+ o && l.value.addLayer(o);
346
+ }), s.value.widgets.filter((a) => a.type === "sketchImage").forEach((a) => {
347
+ const o = Q(a);
348
+ l.value.addLayer(o);
347
349
  });
348
- }, 200), V = (t) => {
350
+ }, 200), q = (t) => {
349
351
  const a = t.slice(
350
352
  t.indexOf("(") + 1,
351
353
  t.lastIndexOf(")")
352
- ).split(",").map((l) => l.trim()), r = {};
353
- for (let l = 1; l < a.length; l++) {
354
- const i = a[l].split(" "), n = i[0], v = parseFloat(i[1]) / 100, oe = Math.round(v * 100) / 100;
355
- r[oe] = n;
354
+ ).split(",").map((r) => r.trim()), o = {};
355
+ for (let r = 1; r < a.length; r++) {
356
+ const i = a[r].split(" "), n = i[0], m = parseFloat(i[1]) / 100, ce = Math.round(m * 100) / 100;
357
+ o[ce] = n;
356
358
  }
357
- return r;
358
- }, U = (t) => {
359
+ return o;
360
+ }, K = (t) => {
359
361
  try {
360
362
  return new d.value.TileLayer({
361
363
  bounds: new d.value.Bounds(
362
364
  t.bounds[0],
363
365
  t.bounds[1]
364
366
  ),
365
- getTileUrl: function(a, r, l) {
367
+ getTileUrl: function(a, o, r) {
366
368
  try {
367
- return t.url.replace("{z}", l).replace("{x}", a).replace("{y}", r);
369
+ return t.url.replace("{z}", r).replace("{x}", a).replace("{y}", o);
368
370
  } catch {
369
371
  }
370
372
  },
@@ -377,7 +379,7 @@ const ve = { class: "relative w-full h-full" }, he = {
377
379
  } catch {
378
380
  }
379
381
  return null;
380
- }, q = (t) => {
382
+ }, Q = (t) => {
381
383
  try {
382
384
  return new d.value.ImageLayer({
383
385
  bounds: new d.value.Bounds(
@@ -396,22 +398,22 @@ const ve = { class: "relative w-full h-full" }, he = {
396
398
  } catch {
397
399
  }
398
400
  return null;
399
- }, K = (t, e, a) => {
401
+ }, X = (t, e, a) => {
400
402
  try {
401
- const r = new t.HeatMapLayer({
403
+ const o = new t.HeatMapLayer({
402
404
  zIndex: 10,
403
405
  opacity: e.opacity,
404
406
  visible: !0,
405
407
  zooms: [2, 22]
406
- }), l = new t.GeoJSONSource({
408
+ }), r = new t.GeoJSONSource({
407
409
  data: a
408
410
  });
409
- r.setSource(l, {
411
+ o.setSource(r, {
410
412
  radius: e.style.radius,
411
413
  unit: e.style.unit,
412
414
  height: e.style.height,
413
415
  opacity: e.style.opacity,
414
- gradient: V(e.style.gradient),
416
+ gradient: q(e.style.gradient),
415
417
  value: function(i, n) {
416
418
  return n.coordinates[2] || 0;
417
419
  },
@@ -419,16 +421,16 @@ const ve = { class: "relative w-full h-full" }, he = {
419
421
  max: e.style.max,
420
422
  // 4.6
421
423
  heightBezier: [0, 0.53, 0.37, 0.98]
422
- }), c.value.add(r);
424
+ }), c.value.add(o);
423
425
  } catch {
424
426
  }
425
- }, P = async (t, e) => {
427
+ }, Y = async (t, e) => {
426
428
  try {
427
- const a = await ye.get(e.geojson);
429
+ const a = await ve.get(e.geojson);
428
430
  if (a.status === 200) {
429
- const r = new t.GeoJSON({
431
+ const o = new t.GeoJSON({
430
432
  geoJSON: a.data,
431
- getPolygon: function(l, i) {
433
+ getPolygon: function(r, i) {
432
434
  const n = new t.Polygon({
433
435
  path: i,
434
436
  zIndex: e.zIndex,
@@ -472,15 +474,15 @@ const ve = { class: "relative w-full h-full" }, he = {
472
474
  }), n;
473
475
  }
474
476
  });
475
- s.value.add(r);
477
+ l.value.add(o);
476
478
  }
477
479
  } catch {
478
480
  }
479
- }, Q = (t, e, a) => {
481
+ }, _ = (t, e, a) => {
480
482
  try {
481
- const r = new t.GeoJSONSource({
483
+ const o = new t.GeoJSONSource({
482
484
  data: a
483
- }), l = new t.PointLayer({
485
+ }), r = new t.PointLayer({
484
486
  zIndex: e.zIndex,
485
487
  blend: e.blend,
486
488
  visible: e.visible,
@@ -493,7 +495,7 @@ const ve = { class: "relative w-full h-full" }, he = {
493
495
  blurWidth: e.style.blurWidth,
494
496
  borderColor: e.style.borderColor
495
497
  };
496
- l.setSource(r), l.setStyle(i), c.value.add(l), l.addAnimate({
498
+ r.setSource(o), r.setStyle(i), c.value.add(r), r.addAnimate({
497
499
  key: e.animate.key,
498
500
  value: e.animate.value,
499
501
  duration: e.animate.duration,
@@ -506,18 +508,18 @@ const ve = { class: "relative w-full h-full" }, he = {
506
508
  });
507
509
  } catch {
508
510
  }
509
- }, X = (t, e, a) => {
511
+ }, ee = (t, e, a) => {
510
512
  try {
511
- const r = new t.GeoJSONSource({
513
+ const o = new t.GeoJSONSource({
512
514
  data: a
513
- }), l = new t.ScatterLayer({
515
+ }), r = new t.ScatterLayer({
514
516
  loca: c.value,
515
517
  zIndex: e.zIndex,
516
518
  opacity: e.opacity,
517
519
  visible: e.visible,
518
520
  zooms: e.zooms
519
521
  });
520
- l.setSource(r), l.setStyle({
522
+ r.setSource(o), r.setStyle({
521
523
  unit: e.style.unit,
522
524
  size: e.style.size,
523
525
  borderWidth: e.style.borderWidth,
@@ -527,11 +529,11 @@ const ve = { class: "relative w-full h-full" }, he = {
527
529
  }), c.value.animate.start();
528
530
  } catch {
529
531
  }
530
- }, Y = (t, e, a) => {
532
+ }, te = (t, e, a) => {
531
533
  try {
532
- const r = new t.GeoJSONSource({
534
+ const o = new t.GeoJSONSource({
533
535
  data: a
534
- }), l = new t.LabelsLayer({
536
+ }), r = new t.LabelsLayer({
535
537
  eventSupport: !0,
536
538
  visible: e.visible,
537
539
  zooms: e.zooms,
@@ -540,7 +542,7 @@ const ve = { class: "relative w-full h-full" }, he = {
540
542
  allowCollision: e.allowCollision,
541
543
  zIndex: e.zIndex
542
544
  });
543
- l.setSource(r), l.setStyle({
545
+ r.setSource(o), r.setStyle({
544
546
  icon: {
545
547
  image: e.icon.image,
546
548
  size: e.icon.size,
@@ -567,29 +569,29 @@ const ve = { class: "relative w-full h-full" }, he = {
567
569
  fontWeight: e.text.style.fontWeight
568
570
  }
569
571
  }
570
- }), l.on("complete", () => {
571
- const i = l.getLabelsLayer().getAllOverlays();
572
+ }), r.on("complete", () => {
573
+ const i = r.getLabelsLayer().getAllOverlays();
572
574
  for (const n of i)
573
- n.on("click", (v) => {
574
- }), n.on("mouseover", (v) => {
575
- }), n.on("mouseout", (v) => {
575
+ n.on("click", (m) => {
576
+ }), n.on("mouseover", (m) => {
577
+ }), n.on("mouseout", (m) => {
576
578
  });
577
- }), c.value.add(l);
579
+ }), c.value.add(r);
578
580
  } catch {
579
581
  }
580
- }, _ = (t, e, a) => {
582
+ }, ae = (t, e, a) => {
581
583
  try {
582
- const r = new t.GeoJSONSource({
584
+ const o = new t.GeoJSONSource({
583
585
  data: a
584
- }), l = new t.ZMarkerLayer({
586
+ }), r = new t.ZMarkerLayer({
585
587
  zIndex: e.signs.zIndex,
586
588
  visible: e.signs.visible,
587
589
  zooms: e.signs.zooms,
588
590
  opacity: e.signs.opacity,
589
591
  depth: !1
590
592
  });
591
- l.setSource(r), l.setStyle({
592
- content: (n, v) => `<div style="
593
+ r.setSource(o), r.setStyle({
594
+ content: (n, m) => `<div style="
593
595
  width: ${e.signs.style.width}px;
594
596
  height: ${e.signs.style.height + 148}px;
595
597
  ">
@@ -605,7 +607,7 @@ const ve = { class: "relative w-full h-full" }, he = {
605
607
  color:${e.signs.style.fillColor};
606
608
  margin:0;
607
609
  ">
608
- ${v.properties.name}
610
+ ${m.properties.name}
609
611
  </p>
610
612
  </div>`,
611
613
  unit: e.signs.style.unit,
@@ -613,7 +615,7 @@ const ve = { class: "relative w-full h-full" }, he = {
613
615
  alwaysFront: e.signs.style.alwaysFront,
614
616
  size: [e.signs.style.width, e.signs.style.height + 148],
615
617
  altitude: e.signs.style.altitude
616
- }), c.value.add(l);
618
+ }), c.value.add(r);
617
619
  const i = new t.ZMarkerLayer({
618
620
  zIndex: e.landmark.zIndex,
619
621
  visible: e.landmark.visible,
@@ -621,7 +623,7 @@ const ve = { class: "relative w-full h-full" }, he = {
621
623
  opacity: e.landmark.opacity,
622
624
  depth: !1
623
625
  });
624
- i.setSource(r), i.setStyle({
626
+ i.setSource(o), i.setStyle({
625
627
  content: () => `<div style="
626
628
  width: ${e.landmark.style.size[0]}px;
627
629
  height: ${e.landmark.style.size[1]}px;
@@ -646,17 +648,17 @@ const ve = { class: "relative w-full h-full" }, he = {
646
648
  }), c.value.add(i), c.value.animate.start();
647
649
  } catch {
648
650
  }
649
- }, ee = (t, e, a) => {
650
- const r = new t.PulseLinkLayer({
651
+ }, re = (t, e, a) => {
652
+ const o = new t.PulseLinkLayer({
651
653
  zIndex: e.zIndex,
652
654
  opacity: e.opacity,
653
655
  visible: e.visible,
654
656
  zooms: e.zooms,
655
657
  depth: e.depth
656
- }), l = new t.GeoJSONSource({
658
+ }), r = new t.GeoJSONSource({
657
659
  data: a
658
660
  });
659
- r.setSource(l), r.setStyle({
661
+ if (o.setSource(r), o.setStyle({
660
662
  unit: e.style.unit,
661
663
  dash: [4e4, 0, 4e4, 0],
662
664
  lineWidth: e.style.lineWidth,
@@ -674,152 +676,158 @@ const ve = { class: "relative w-full h-full" }, he = {
674
676
  // 弧顶位置比例
675
677
  headColor: e.style.headColor,
676
678
  trailColor: e.style.trailColor
677
- }), s.value.on("click", (i) => {
678
- const n = r.queryFeature(i.pixel.toArray());
679
- n && (y("amap3d-scene-pulseLinkLayer", n), p.parseEvents(
680
- m.useEvents,
681
- "amap3d-scene-pulseLinkLayer",
682
- n
683
- ));
684
- }), c.value.add(r), c.value.animate.start();
685
- }, f = (t, e) => {
679
+ }), l.value && v.value && (l.value.off("click", v.value), v.value = null), l.value) {
680
+ const i = (n) => {
681
+ const m = o.queryFeature(n.pixel.toArray());
682
+ m && (g("amap3d-scene-pulseLinkLayer", m), f.parseEvents(
683
+ u.useEvents,
684
+ "amap3d-scene-pulseLinkLayer",
685
+ m
686
+ ));
687
+ };
688
+ l.value.on("click", i), v.value = i;
689
+ }
690
+ c.value.add(o), c.value.animate.start();
691
+ }, k = (t, e) => {
686
692
  const a = {
687
693
  type: "FeatureCollection",
688
694
  features: []
689
695
  };
690
- return t.forEach((r) => {
691
- const l = {
696
+ return t.forEach((o) => {
697
+ const r = {
692
698
  type: "Feature",
693
- id: pe(),
699
+ id: fe(),
694
700
  properties: {
695
701
  type: e === "Point" ? e : 0,
696
- ...r
702
+ ...o
697
703
  },
698
704
  geometry: {
699
705
  type: e,
700
- coordinates: r.value
706
+ coordinates: o.value
701
707
  }
702
708
  };
703
- a.features.push(l);
709
+ a.features.push(r);
704
710
  }), a;
705
- }, te = (t) => {
706
- s.value && (s.value.setFeatures(t.config.features), s.value.setPitch(t.config.pitch), s.value.setRotation(t.config.rotation), s.value.setStatus({
711
+ }, le = (t) => {
712
+ l.value && (l.value.setFeatures(t.config.features), l.value.setPitch(t.config.pitch), l.value.setRotation(t.config.rotation), l.value.setStatus({
707
713
  dragEnable: t.config.dragEnable,
708
714
  zoomEnable: t.config.zoomEnable,
709
715
  rotateEnable: t.config.rotateEnable,
710
716
  pitchEnable: t.config.pitchEnable
711
- }), t.config.plugin.scale.visible ? z.value.show() : z.value.hide(), t.config.plugin.toolBar.visible ? b.value.show() : b.value.hide(), t.config.plugin.controlBar.visible ? k.value.show() : k.value.hide());
712
- }, ae = () => {
713
- s.value && (s.value.clearMap(), c.value.clear(), W(d.value));
714
- }, re = (t) => {
715
- s.value && s.value.setMapStyle(t.config.mapStyle);
716
- }, le = (t) => {
717
- s.value && s.value.setZoom(t.config.zoom, !1, 200);
717
+ }), t.config.plugin.scale.visible ? w.value.show() : w.value.hide(), t.config.plugin.toolBar.visible ? z.value.show() : z.value.hide(), t.config.plugin.controlBar.visible ? b.value.show() : b.value.hide());
718
+ }, oe = () => {
719
+ l.value && (l.value.clearMap(), c.value.clear(), D(d.value));
718
720
  }, se = (t) => {
719
- s.value && s.value.setCenter(t.config.center, !1, 200);
720
- }, $ = () => {
721
- s.value && (s.value.clearMap(), s.value.destroy(), s.value = null, c.value && (c.value.clear(), c.value.destroy(), c.value = null));
721
+ l.value && l.value.setMapStyle(t.config.mapStyle);
722
+ }, ie = (t) => {
723
+ l.value && l.value.setZoom(t.config.zoom, !1, 200);
724
+ }, ne = (t) => {
725
+ l.value && l.value.setCenter(t.config.center, !1, 200);
726
+ }, J = () => {
727
+ l.value && v.value && (l.value.off("click", v.value), v.value = null), l.value && (l.value.clearMap(), l.value.destroy(), l.value = null), c.value && (c.value.clear(), c.value.destroy(), c.value = null);
722
728
  };
723
- return me(() => {
729
+ return ye(() => {
724
730
  setTimeout(() => {
725
- B(o.value);
731
+ $(s.value);
726
732
  }, 0);
727
- }), de(() => $()), {
728
- initAMap3d: B,
729
- updateAMapStyle: re,
730
- updateAMapConfig: te,
731
- updateAMapComponents: ae,
732
- updateAMapZoom: le,
733
- updateAMapCenter: se,
734
- amap3d: s,
735
- loading: x,
733
+ }), pe(() => {
734
+ S.value = !0, J();
735
+ }), {
736
+ initAMap3d: $,
737
+ updateAMapStyle: se,
738
+ updateAMapConfig: le,
739
+ updateAMapComponents: oe,
740
+ updateAMapZoom: ie,
741
+ updateAMapCenter: ne,
742
+ amap3d: l,
743
+ loading: C,
736
744
  AMapPrototype: d,
737
- errorMessage: C
745
+ errorMessage: M
738
746
  };
739
747
  }, {
740
- initAMap3d: g,
741
- updateAMapStyle: H,
742
- updateAMapConfig: A,
743
- updateAMapComponents: Z,
744
- updateAMapZoom: j,
745
- updateAMapCenter: R,
746
- loading: I,
747
- errorMessage: O
748
- } = G();
749
- return u(
750
- () => o.value.config,
748
+ initAMap3d: h,
749
+ updateAMapStyle: j,
750
+ updateAMapConfig: B,
751
+ updateAMapComponents: R,
752
+ updateAMapZoom: V,
753
+ updateAMapCenter: U,
754
+ loading: W,
755
+ errorMessage: P
756
+ } = Z();
757
+ return y(
758
+ () => s.value.config,
751
759
  () => {
752
- A(o.value);
760
+ B(s.value);
753
761
  },
754
762
  { deep: !0 }
755
- ), u(
756
- () => o.value.config.zoom,
763
+ ), y(
764
+ () => s.value.config.zoom,
757
765
  () => {
758
- j(o.value);
766
+ V(s.value);
759
767
  },
760
768
  { deep: !0 }
761
- ), u(
762
- () => o.value.config.center,
769
+ ), y(
770
+ () => s.value.config.center,
763
771
  () => {
764
- R(o.value);
772
+ U(s.value);
765
773
  },
766
774
  { deep: !0 }
767
- ), u(
768
- () => o.value.config.floors,
769
- M(() => {
770
- g(o.value);
775
+ ), y(
776
+ () => s.value.config.floors,
777
+ O(() => {
778
+ h(s.value);
771
779
  }, 300),
772
780
  { deep: !0 }
773
- ), u(
774
- () => o.value.config.skyColor,
775
- M(() => {
776
- g(o.value);
781
+ ), y(
782
+ () => s.value.config.skyColor,
783
+ O(() => {
784
+ h(s.value);
777
785
  }, 300),
778
786
  { deep: !0 }
779
- ), u(
780
- () => o.value.widgets,
787
+ ), y(
788
+ () => s.value.widgets,
781
789
  () => {
782
- Z();
790
+ R();
783
791
  },
784
792
  { deep: !0 }
785
- ), u(
786
- () => o.value.config.mapStyle,
793
+ ), y(
794
+ () => s.value.config.mapStyle,
787
795
  () => {
788
- H(o.value);
796
+ j(s.value);
789
797
  },
790
798
  { deep: !0 }
791
- ), u(
792
- () => o.value.basic,
799
+ ), y(
800
+ () => s.value.basic,
793
801
  () => {
794
- g(o.value);
802
+ h(s.value);
795
803
  },
796
804
  { deep: !0 }
797
- ), u(
798
- () => m.sources,
805
+ ), y(
806
+ () => u.sources,
799
807
  () => {
800
- g(o.value);
808
+ h(s.value);
801
809
  },
802
810
  { deep: !0 }
803
- ), T({
804
- refresh: () => g(o.value),
805
- refreshView: () => A(o.value),
806
- refreshData: () => g(o.value)
807
- }), (s, c) => (L(), S("div", ve, [
808
- E("div", {
809
- class: ne(["amap-3d-wrap", { show: w(I) }])
811
+ ), H({
812
+ refresh: () => h(s.value),
813
+ refreshView: () => B(s.value),
814
+ refreshData: () => h(s.value)
815
+ }), (l, c) => (A(), E("div", be, [
816
+ I("div", {
817
+ class: me(["amap-3d-wrap", { show: x(W) }])
810
818
  }, c[0] || (c[0] = [
811
- E("div", {
819
+ I("div", {
812
820
  id: "zerov-amap-3d",
813
821
  class: "zerov-amap-container"
814
822
  }, null, -1)
815
823
  ]), 2),
816
- w(I) ? D("", !0) : (L(), S("div", he, [
817
- w(O) !== "" ? (L(), S("i", ke)) : D("", !0),
818
- E("p", be, ce(w(O)), 1)
824
+ x(W) ? T("", !0) : (A(), E("div", ze, [
825
+ x(P) !== "" ? (A(), E("i", we)) : T("", !0),
826
+ I("p", xe, de(x(P)), 1)
819
827
  ]))
820
828
  ]));
821
829
  }
822
830
  });
823
831
  export {
824
- xr as default
832
+ Lr as default
825
833
  };