gisviewer-vue3-arcgis 1.0.285 → 1.0.286

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 (67) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +2 -2
  2. package/es/src/gis-map/index.d.ts +2 -2
  3. package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +6 -2
  4. package/es/src/gis-map/utils/holo-flow/trace-renderer-external.mjs +5 -3
  5. package/es/src/gis-map/utils/overlay.d.ts +2 -2
  6. package/es/src/gis-map/utils/overlay.mjs +2 -2
  7. package/es/src/gis-map/utils/police-jurisdiction.mjs +1 -1
  8. package/es/src/gis-map/utils/signal-system/signal-system-controller.mjs +2 -2
  9. package/es/src/gis-map-ol/gis-map-ol.vue.d.ts +30 -1
  10. package/es/src/gis-map-ol/gis-map-ol.vue.mjs +69 -43
  11. package/es/src/gis-map-ol/index.d.ts +25 -0
  12. package/es/src/gis-map-ol/utils/cluster/index.d.ts +2 -0
  13. package/es/src/gis-map-ol/utils/cluster/pixel-cluster-calculator.d.ts +65 -0
  14. package/es/src/gis-map-ol/utils/cluster/pixel-cluster-calculator.mjs +122 -0
  15. package/es/src/gis-map-ol/utils/ol-map-initializer.d.ts +1 -0
  16. package/es/src/gis-map-ol/utils/ol-map-initializer.mjs +95 -41
  17. package/es/src/gis-map-ol/utils/overlay/cluster-point-controller.d.ts +23 -0
  18. package/es/src/gis-map-ol/utils/overlay/cluster-point-controller.mjs +102 -0
  19. package/es/src/gis-map-ol/utils/overlay/overlay-controller.d.ts +116 -0
  20. package/es/src/gis-map-ol/utils/overlay/overlay-controller.mjs +276 -0
  21. package/es/src/gis-map-ol/utils/police-area-controller.d.ts +16 -0
  22. package/es/src/gis-map-ol/utils/police-area-controller.mjs +155 -0
  23. package/es/src/gis-map-ol/utils/signal-control/signal-cross-controller.d.ts +1 -10
  24. package/es/src/gis-map-ol/utils/signal-control/signal-cross-controller.mjs +124 -166
  25. package/es/src/gis-map-ol/utils/signal-control/signal-system-controller.d.ts +49 -0
  26. package/es/src/gis-map-ol/utils/signal-control/signal-system-controller.mjs +127 -0
  27. package/es/src/gis-map-ol/utils/style/line-style.d.ts +64 -0
  28. package/es/src/gis-map-ol/utils/style/line-style.mjs +151 -0
  29. package/es/src/gis-map-ol/utils/style/point-style.d.ts +78 -0
  30. package/es/src/gis-map-ol/utils/style/point-style.mjs +206 -0
  31. package/es/src/gis-map-ol/utils/style/polygon-style.d.ts +60 -0
  32. package/es/src/gis-map-ol/utils/style/polygon-style.mjs +166 -0
  33. package/es/src/types/index.d.ts +2 -1
  34. package/lib/src/gis-map/gis-map.vue.d.ts +2 -2
  35. package/lib/src/gis-map/index.d.ts +2 -2
  36. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -1
  37. package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.js +1 -1
  38. package/lib/src/gis-map/utils/overlay.d.ts +2 -2
  39. package/lib/src/gis-map/utils/overlay.js +1 -1
  40. package/lib/src/gis-map/utils/police-jurisdiction.js +1 -1
  41. package/lib/src/gis-map/utils/signal-system/signal-system-controller.js +1 -1
  42. package/lib/src/gis-map-ol/gis-map-ol.vue.d.ts +30 -1
  43. package/lib/src/gis-map-ol/gis-map-ol.vue.js +1 -1
  44. package/lib/src/gis-map-ol/index.d.ts +25 -0
  45. package/lib/src/gis-map-ol/utils/cluster/index.d.ts +2 -0
  46. package/lib/src/gis-map-ol/utils/cluster/pixel-cluster-calculator.d.ts +65 -0
  47. package/lib/src/gis-map-ol/utils/cluster/pixel-cluster-calculator.js +1 -0
  48. package/lib/src/gis-map-ol/utils/ol-map-initializer.d.ts +1 -0
  49. package/lib/src/gis-map-ol/utils/ol-map-initializer.js +1 -1
  50. package/lib/src/gis-map-ol/utils/overlay/cluster-point-controller.d.ts +23 -0
  51. package/lib/src/gis-map-ol/utils/overlay/cluster-point-controller.js +1 -0
  52. package/lib/src/gis-map-ol/utils/overlay/overlay-controller.d.ts +116 -0
  53. package/lib/src/gis-map-ol/utils/overlay/overlay-controller.js +1 -0
  54. package/lib/src/gis-map-ol/utils/police-area-controller.d.ts +16 -0
  55. package/lib/src/gis-map-ol/utils/police-area-controller.js +1 -0
  56. package/lib/src/gis-map-ol/utils/signal-control/signal-cross-controller.d.ts +1 -10
  57. package/lib/src/gis-map-ol/utils/signal-control/signal-cross-controller.js +1 -1
  58. package/lib/src/gis-map-ol/utils/signal-control/signal-system-controller.d.ts +49 -0
  59. package/lib/src/gis-map-ol/utils/signal-control/signal-system-controller.js +1 -0
  60. package/lib/src/gis-map-ol/utils/style/line-style.d.ts +64 -0
  61. package/lib/src/gis-map-ol/utils/style/line-style.js +1 -0
  62. package/lib/src/gis-map-ol/utils/style/point-style.d.ts +78 -0
  63. package/lib/src/gis-map-ol/utils/style/point-style.js +1 -0
  64. package/lib/src/gis-map-ol/utils/style/polygon-style.d.ts +60 -0
  65. package/lib/src/gis-map-ol/utils/style/polygon-style.js +1 -0
  66. package/lib/src/types/index.d.ts +2 -1
  67. package/package.json +1 -1
@@ -123,8 +123,8 @@ declare const _sfc_main: import("vue").DefineComponent<{
123
123
  removeAllClusterPoints: () => void;
124
124
  addMask: (params: IMaskParam) => void;
125
125
  removeMask: () => void;
126
- removeOverlaysByType: (types: string[]) => import("../types").IResult;
127
- removeOverlaysById: (ids: string[]) => import("../types").IResult;
126
+ removeOverlaysByType: (types: string[] | string) => import("../types").IResult;
127
+ removeOverlaysById: (ids: string[] | string) => import("../types").IResult;
128
128
  removeAllOverlays: () => import("../types").IResult;
129
129
  showAllOverlays: () => void;
130
130
  updateQueueLength: (params: IQueueLengthParams[]) => void;
@@ -105,8 +105,8 @@ export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWi
105
105
  removeAllClusterPoints: () => void;
106
106
  addMask: (params: import("../types").IMaskParam) => void;
107
107
  removeMask: () => void;
108
- removeOverlaysByType: (types: string[]) => import("../types").IResult;
109
- removeOverlaysById: (ids: string[]) => import("../types").IResult;
108
+ removeOverlaysByType: (types: string | string[]) => import("../types").IResult;
109
+ removeOverlaysById: (ids: string | string[]) => import("../types").IResult;
110
110
  removeAllOverlays: () => import("../types").IResult;
111
111
  showAllOverlays: () => void;
112
112
  updateQueueLength: (params: import("../types").IQueueLengthParams[]) => void;
@@ -184,7 +184,9 @@ class C {
184
184
  * @param rtStage.stageYellowTime 黄灯时间
185
185
  */
186
186
  drawCountdownText(e, t) {
187
- const a = e.getContext("2d");
187
+ const a = e.getContext("2d", {
188
+ willReadFrequently: !0
189
+ });
188
190
  a.clearRect(0, 0, e.width, e.height), a.font = "24px Digital", a.textBaseline = "middle", a.textAlign = "center", a.fillStyle = t.stageRemainingTime <= t.stageAllRedTime ? "red" : t.stageRemainingTime <= t.stageAllRedTime + t.stageYellowTime ? "yellow" : "lime", a.fillText(
189
191
  t.stageRemainingTime.toFixed(0),
190
192
  e.width / 2,
@@ -219,7 +221,9 @@ class C {
219
221
  createCountdownCanvas() {
220
222
  const e = document.createElement("canvas");
221
223
  e.width = this.canvasWidth, e.height = this.canvasHeight, e.style.position = "absolute", e.style.transform = "translate(-50%, -50%)";
222
- const t = e.getContext("2d");
224
+ const t = e.getContext("2d", {
225
+ willReadFrequently: !0
226
+ });
223
227
  this.plateBackground ? t.drawImage(
224
228
  this.plateBackground,
225
229
  0,
@@ -8,7 +8,7 @@ import { GLTFLoader as f } from "three/examples/jsm/loaders/GLTFLoader";
8
8
  import { MTLLoader as G } from "three/examples/jsm/loaders/MTLLoader";
9
9
  import { OBJLoader as w } from "three/examples/jsm/loaders/OBJLoader";
10
10
  import { toRaw as S } from "vue";
11
- import B from "../../../stores/index.mjs";
11
+ import R from "../../../stores/index.mjs";
12
12
  import { EVehiclePlateState as m } from "../../../types/index.mjs";
13
13
  class O {
14
14
  constructor(t) {
@@ -26,7 +26,7 @@ class O {
26
26
  [9, this.createCarMaterial(2105376)],
27
27
  [10, this.createCarMaterial(9662683)],
28
28
  [99, this.createCarMaterial(6908265)]
29
- ]), this.isInitialized = !1, this.showGroundVehicle = !0, this.showElevatedVehicle = !0, this.isPaused = !1, this.currentSpriteContent = m.None, this.historyPositionMap = /* @__PURE__ */ new Map(), this.vehicleObjectMap = /* @__PURE__ */ new Map(), this.tabVisible = !0, this.updateModel = !1, this.appDataStore = B.useAppDataStore, this.logTable = [
29
+ ]), this.isInitialized = !1, this.showGroundVehicle = !0, this.showElevatedVehicle = !0, this.isPaused = !1, this.currentSpriteContent = m.None, this.historyPositionMap = /* @__PURE__ */ new Map(), this.vehicleObjectMap = /* @__PURE__ */ new Map(), this.tabVisible = !0, this.updateModel = !1, this.appDataStore = R.useAppDataStore, this.logTable = [
30
30
  [
31
31
  "ptcId",
32
32
  "plateno",
@@ -509,7 +509,9 @@ class O {
509
509
  createCanvas(t, s, e) {
510
510
  const i = document.createElement("canvas"), o = t.width, l = t.height;
511
511
  i.width = o, i.height = l;
512
- const r = i.getContext("2d");
512
+ const r = i.getContext("2d", {
513
+ willReadFrequently: !0
514
+ });
513
515
  if (!r) {
514
516
  console.log("canvas创建失败");
515
517
  return;
@@ -22,12 +22,12 @@ export default class Overlay {
22
22
  * 按type移除覆盖物
23
23
  * @param types
24
24
  */
25
- removeOverlaysByType(types: string[]): IResult;
25
+ removeOverlaysByType(types: string[] | string): IResult;
26
26
  /**
27
27
  * 按id移除覆盖物
28
28
  * @param ids
29
29
  */
30
- removeOverlaysById(ids: string[]): IResult;
30
+ removeOverlaysById(ids: string[] | string): IResult;
31
31
  /**
32
32
  * 按id显示或隐藏覆盖物
33
33
  * @param ids
@@ -83,7 +83,7 @@ class L {
83
83
  removeOverlaysByType(e) {
84
84
  const t = this.overlayLayer.graphics.filter((i) => {
85
85
  const r = i.getAttribute("type");
86
- return e.includes(r);
86
+ return Array.isArray(e) ? e.includes(r) : r === e;
87
87
  });
88
88
  return this.overlayLayer.graphics.removeMany(t), { status: 0, message: `删除${t.length}` };
89
89
  }
@@ -94,7 +94,7 @@ class L {
94
94
  removeOverlaysById(e) {
95
95
  const t = this.overlayLayer.graphics.filter((i) => {
96
96
  const r = i.getAttribute("id");
97
- return e.includes(r);
97
+ return Array.isArray(e) ? e.includes(r) : r === e;
98
98
  });
99
99
  return this.overlayLayer.graphics.removeMany(t), { status: 0, message: `删除${t.length}` };
100
100
  }
@@ -47,7 +47,7 @@ class R {
47
47
  });
48
48
  const p = s[0].centroid, u = n.geodesicBuffer(
49
49
  p,
50
- 100,
50
+ 500,
51
51
  "kilometers"
52
52
  );
53
53
  let a = n.difference(
@@ -109,8 +109,8 @@ class S {
109
109
  const t = e.children.map((a) => new i({
110
110
  geometry: {
111
111
  type: "point",
112
- longitude: a.x,
113
- latitude: a.y
112
+ longitude: Number(a.x),
113
+ latitude: Number(a.y)
114
114
  },
115
115
  symbol: a.symbol || e.nodeSymbol || {
116
116
  type: "simple-marker",
@@ -1,8 +1,12 @@
1
1
  import { default as OlMap } from 'ol/Map';
2
2
  import type { EventsKey } from 'ol/events';
3
- import { ILayerVisibleParams, ISetMapCameraParams, ISetMapCenterParams, IShowSignalCrossParams } from '../types';
3
+ import { IClusterPointParams, ILayerVisibleParams, IOverlayParam, ISetMapCameraParams, ISetMapCenterParams, IShowJurisdictionParams, IShowSignalCrossParams, IShowSignalSystemParams, IShowSubSignalSystemParams } from '../types';
4
4
  import OlMapInitializer from './utils/ol-map-initializer';
5
+ import ClusterPointController from './utils/overlay/cluster-point-controller';
6
+ import PoliceAreaController from './utils/police-area-controller';
5
7
  import SignalCrossController from './utils/signal-control/signal-cross-controller';
8
+ import SignalSystemController from './utils/signal-control/signal-system-controller';
9
+ import OverlayController from './utils/overlay/overlay-controller';
6
10
  declare const _sfc_main: import("vue").DefineComponent<{
7
11
  config: {
8
12
  type: StringConstructor;
@@ -20,6 +24,10 @@ declare const _sfc_main: import("vue").DefineComponent<{
20
24
  lastEmittedZoomInt: number | null;
21
25
  emitZoomIfChanged: (z: number) => void;
22
26
  signalCrossController: SignalCrossController;
27
+ signalSystemController: SignalSystemController;
28
+ clusterPointController: ClusterPointController;
29
+ policeAreaController: PoliceAreaController;
30
+ overlayController: OverlayController;
23
31
  setMapCenter: (params: ISetMapCenterParams) => Promise<import("../types").IResult>;
24
32
  setMapCamera: (params: ISetMapCameraParams) => Promise<import("../types").IResult>;
25
33
  setLayerVisibility: (params: ILayerVisibleParams) => Promise<import("../types").IResult>;
@@ -30,6 +38,27 @@ declare const _sfc_main: import("vue").DefineComponent<{
30
38
  message: string;
31
39
  };
32
40
  clearSignalCross: () => void;
41
+ showSignalSystem: (params: IShowSignalSystemParams) => Promise<import("../types").IResult> | {
42
+ status: number;
43
+ message: string;
44
+ };
45
+ removeSignalSystem: (areaCode?: string | undefined) => void | {
46
+ success: boolean;
47
+ message: string;
48
+ };
49
+ showSubSignalSystem: (params: IShowSubSignalSystemParams) => Promise<import("../types").IResult>;
50
+ removeSubSignalSystem: (subCode?: string | undefined) => void | {
51
+ success: boolean;
52
+ message: string;
53
+ };
54
+ addClusterPoints: (params: IClusterPointParams) => void;
55
+ removeAllClusterPoints: () => void;
56
+ showPoliceArea: (params: IShowJurisdictionParams) => Promise<void>;
57
+ clearPoliceArea: () => void;
58
+ addOverlays: (params: IOverlayParam) => import("../types").IResult;
59
+ removeOverlaysById: (ids: string[] | string) => void;
60
+ removeOverlaysByType: (type: string[] | string) => void;
61
+ removeAllOverlays: () => void;
33
62
  props: any;
34
63
  emit: (event: "mapLoaded" | "markerClick" | "mapClick" | "update:zoom", ...args: any[]) => void;
35
64
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick" | "update:zoom")[], "mapLoaded" | "markerClick" | "mapClick" | "update:zoom", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -1,67 +1,93 @@
1
- import { defineComponent as x, ref as z, onMounted as E, getCurrentInstance as I, onBeforeUnmount as V, openBlock as B, createElementBlock as L, createElementVNode as N } from "vue";
2
- import { unByKey as R } from "ol/Observable";
3
- import { registerStore as K } from "../stores/index.mjs";
4
- import j from "./utils/ol-map-initializer.mjs";
5
- import A from "./utils/signal-control/signal-cross-controller.mjs";
6
- const F = { class: "gis-viewer" }, D = /* @__PURE__ */ x({
1
+ import { defineComponent as $, ref as q, onMounted as D, getCurrentInstance as G, onBeforeUnmount as H, openBlock as Q, createElementBlock as W, createElementVNode as X } from "vue";
2
+ import { unByKey as Y } from "ol/Observable";
3
+ import { registerStore as ee } from "../stores/index.mjs";
4
+ import te from "./utils/ol-map-initializer.mjs";
5
+ import oe from "./utils/overlay/cluster-point-controller.mjs";
6
+ import S from "./utils/police-area-controller.mjs";
7
+ import re from "./utils/signal-control/signal-cross-controller.mjs";
8
+ import v from "./utils/signal-control/signal-system-controller.mjs";
9
+ import se from "./utils/overlay/overlay-controller.mjs";
10
+ const ne = { class: "gis-viewer" }, ge = /* @__PURE__ */ $({
7
11
  __name: "gis-map-ol",
8
12
  props: {
9
13
  config: {},
10
14
  assetsRoot: {}
11
15
  },
12
16
  emits: ["mapLoaded", "markerClick", "mapClick", "update:zoom"],
13
- setup(C, { expose: u, emit: f }) {
14
- const i = z(null);
15
- let o, n, a = [], l = null;
16
- const c = (e) => {
17
+ setup(w, { expose: d, emit: h }) {
18
+ const u = q(null);
19
+ let i, t, m = [], p = null;
20
+ const f = (e) => {
17
21
  if (!Number.isFinite(e))
18
22
  return;
19
- const s = Math.round(e);
20
- s !== l && (l = s, r("update:zoom", s));
23
+ const a = Math.round(e);
24
+ a !== p && (p = a, c("update:zoom", a));
21
25
  };
22
- let t;
23
- E(async () => {
24
- K();
25
- const e = I(), { $gisviewerAssetsRoot: s } = e.appContext.config.globalProperties, p = await (await fetch(m.config)).json();
26
- p.assetsRoot = m.assetsRoot || s, o = new j(), n = o.initialize({
27
- container: i.value,
28
- mapConfig: p,
29
- markerClickCallback: (S, _, Z, b) => {
30
- r("markerClick", S, _, Z, b);
26
+ let s, o, l, n, r;
27
+ D(async () => {
28
+ ee();
29
+ const e = G(), { $gisviewerAssetsRoot: a } = e.appContext.config.globalProperties, g = await (await fetch(C.config)).json();
30
+ g.assetsRoot = C.assetsRoot || a, i = new te(), t = i.initialize({
31
+ container: u.value,
32
+ mapConfig: g,
33
+ markerClickCallback: (T, j, F, U) => {
34
+ c("markerClick", T, j, F, U);
31
35
  }
32
36
  });
33
- const g = n.getView();
34
- a.push(
35
- g.on("change:resolution", () => {
36
- c(g.getZoom());
37
+ const y = t.getView();
38
+ m.push(
39
+ y.on("change:resolution", () => {
40
+ f(y.getZoom());
37
41
  })
38
- ), c(n.getView().getZoom()), r("mapLoaded");
42
+ ), f(t.getView().getZoom()), c("mapLoaded"), n = new S(t), await n.initialize();
39
43
  });
40
- const d = async (e) => await o.setMapCenter(e), w = async (e) => await o.setMapCamera(e), h = async (e) => await o.setLayerVisibility(e), y = (e) => o.setMapZoom({ zoom: e }), k = (e) => (t || (t = new A(n)), t.showSignalCross(e)), v = (e) => t ? t.changeShowName(e) : { success: !1, message: "SignalCrossController未初始化" }, M = () => {
41
- t && t.clearSignalCross();
44
+ const k = async (e) => await i.setMapCenter(e), M = async (e) => await i.setMapCamera(e), O = async (e) => await i.setLayerVisibility(e), P = (e) => i.setMapZoom({ zoom: e }), b = (e) => (s || (s = new re(t)), s.showSignalCross(e)), A = (e) => s ? s.changeShowName(e) : { success: !1, message: "SignalCrossController未初始化" }, _ = () => {
45
+ s && s.clearSignalCross();
46
+ }, B = (e) => (o || (o = new v(t)), o.showSignalSystem(e)), I = (e) => o ? o.removeSignalSystem(e) : { success: !1, message: "SignalSystemController未初始化" }, z = (e) => (o || (o = new v(t)), o.showSubSignalSystem(e)), Z = (e) => o ? o.removeSubSignalSystem(e) : { success: !1, message: "SignalSystemController未初始化" }, x = (e) => (l || (l = new oe(t)), l.addClusterPoints(e)), E = () => {
47
+ l && l.removeAllClusterPoints();
48
+ }, V = async (e) => (n || (n = new S(t)), await n.showJurisdiction(e)), L = () => {
49
+ n && n.clearJurisdiction();
50
+ }, N = (e) => (r || (r = new se(t)), r.addOverlays(e)), R = (e) => {
51
+ r && r.removeOverlaysById(e);
52
+ }, J = (e) => {
53
+ r && r.removeOverlaysByType(e);
54
+ }, K = () => {
55
+ r && r.removeAllOverlays();
42
56
  };
43
- V(() => {
44
- a.forEach((e) => R(e)), a = [];
57
+ H(() => {
58
+ m.forEach((e) => Y(e)), m = [];
45
59
  });
46
- const m = C, r = f;
47
- return u({
48
- setMapCenter: d,
49
- setMapCamera: w,
50
- setMapZoom: y,
51
- setLayerVisibility: h,
52
- showSignalCross: k,
53
- clearSignalCross: M,
54
- changeSignalCrossShowName: v
55
- }), (e, s) => (B(), L("div", F, [
56
- N("div", {
60
+ const C = w, c = h;
61
+ return d({
62
+ setMapCenter: k,
63
+ setMapCamera: M,
64
+ setMapZoom: P,
65
+ setLayerVisibility: O,
66
+ showSignalCross: b,
67
+ showSignalSystem: B,
68
+ removeSignalSystem: I,
69
+ showSubSignalSystem: z,
70
+ removeSubSignalSystem: Z,
71
+ clearSignalCross: _,
72
+ changeSignalCrossShowName: A,
73
+ addClusterPoints: x,
74
+ removeAllClusterPoints: E,
75
+ showPoliceArea: V,
76
+ clearPoliceArea: L,
77
+ addOverlays: N,
78
+ removeOverlaysById: R,
79
+ removeOverlaysByType: J,
80
+ removeAllOverlays: K
81
+ }), (e, a) => (Q(), W("div", ne, [
82
+ X("div", {
57
83
  id: "divCMap",
58
84
  class: "gis-viewer-main",
59
85
  ref_key: "mapContainer",
60
- ref: i
86
+ ref: u
61
87
  }, null, 512)
62
88
  ]));
63
89
  }
64
90
  });
65
91
  export {
66
- D as default
92
+ ge as default
67
93
  };
@@ -15,6 +15,10 @@ export declare const GisMapOl: import("@easyest/utils/dist/lib/withinstall").SFC
15
15
  lastEmittedZoomInt: number | null;
16
16
  emitZoomIfChanged: (z: number) => void;
17
17
  signalCrossController: import("./utils/signal-control/signal-cross-controller").default;
18
+ signalSystemController: import("./utils/signal-control/signal-system-controller").default;
19
+ clusterPointController: import("./utils/overlay/cluster-point-controller").default;
20
+ policeAreaController: import("./utils/police-area-controller").default;
21
+ overlayController: import("./utils/overlay/overlay-controller").default;
18
22
  setMapCenter: (params: import("../types").ISetMapCenterParams) => Promise<import("../types").IResult>;
19
23
  setMapCamera: (params: import("../types").ISetMapCameraParams) => Promise<import("../types").IResult>;
20
24
  setLayerVisibility: (params: import("../types").ILayerVisibleParams) => Promise<import("../types").IResult>;
@@ -25,6 +29,27 @@ export declare const GisMapOl: import("@easyest/utils/dist/lib/withinstall").SFC
25
29
  message: string;
26
30
  };
27
31
  clearSignalCross: () => void;
32
+ showSignalSystem: (params: import("../types").IShowSignalSystemParams) => Promise<import("../types").IResult> | {
33
+ status: number;
34
+ message: string;
35
+ };
36
+ removeSignalSystem: (areaCode?: string | undefined) => void | {
37
+ success: boolean;
38
+ message: string;
39
+ };
40
+ showSubSignalSystem: (params: import("../types").IShowSubSignalSystemParams) => Promise<import("../types").IResult>;
41
+ removeSubSignalSystem: (subCode?: string | undefined) => void | {
42
+ success: boolean;
43
+ message: string;
44
+ };
45
+ addClusterPoints: (params: import("../types").IClusterPointParams) => void;
46
+ removeAllClusterPoints: () => void;
47
+ showPoliceArea: (params: import("../types").IShowJurisdictionParams) => Promise<void>;
48
+ clearPoliceArea: () => void;
49
+ addOverlays: (params: import("../types").IOverlayParam) => import("../types").IResult;
50
+ removeOverlaysById: (ids: string | string[]) => void;
51
+ removeOverlaysByType: (type: string | string[]) => void;
52
+ removeAllOverlays: () => void;
28
53
  props: any;
29
54
  emit: (event: "mapLoaded" | "markerClick" | "mapClick" | "update:zoom", ...args: any[]) => void;
30
55
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick" | "update:zoom")[], "mapLoaded" | "markerClick" | "mapClick" | "update:zoom", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -0,0 +1,2 @@
1
+ export { PixelClusterCalculator } from './pixel-cluster-calculator';
2
+ export type { IPixelClusterOptions } from './pixel-cluster-calculator';
@@ -0,0 +1,65 @@
1
+ import type { default as OlMap } from 'ol/Map';
2
+ import { ICluster, IClusterLocation } from '../../../types';
3
+ export interface IPixelClusterOptions {
4
+ /** 聚合半径(像素),默认 120 */
5
+ clusterRadius?: number;
6
+ /** 最小聚合点数,默认 2 */
7
+ minClusterPoints?: number;
8
+ /** 最大聚合符号大小,默认 40 */
9
+ maxClusterSymbolSize?: number;
10
+ /** 最小聚合符号大小,默认 20 */
11
+ minClusterSymbolSize?: number;
12
+ }
13
+ /**
14
+ * 像素聚合计算器
15
+ * 基于屏幕像素距离进行点聚合
16
+ */
17
+ export declare class PixelClusterCalculator {
18
+ private map;
19
+ private options;
20
+ private clusteredLocations;
21
+ constructor(map: OlMap, options?: IPixelClusterOptions);
22
+ /**
23
+ * 计算聚合结果
24
+ * @param locations 原始点位数组
25
+ * @returns 聚合结果
26
+ */
27
+ calculate(locations: IClusterLocation[]): ICluster[];
28
+ /**
29
+ * 计算聚合符号大小
30
+ * @param clusters 聚合结果
31
+ * @returns 带有符号大小信息的聚合结果
32
+ */
33
+ calculateSymbolSizes(clusters: ICluster[]): (ICluster & {
34
+ symbolSize?: number;
35
+ })[];
36
+ /**
37
+ * 更新配置
38
+ */
39
+ updateOptions(options: Partial<IPixelClusterOptions>): void;
40
+ /**
41
+ * 获取当前配置
42
+ */
43
+ getOptions(): Required<IPixelClusterOptions>;
44
+ /**
45
+ * 将地理坐标转换为屏幕坐标
46
+ */
47
+ private locationToScreen;
48
+ /**
49
+ * 基于像素距离的聚合算法
50
+ */
51
+ private doPixelCluster;
52
+ /**
53
+ * 获取指定点的邻近点
54
+ */
55
+ private getNeighbors;
56
+ /**
57
+ * 计算两点之间的屏幕距离
58
+ */
59
+ private getDistance;
60
+ /**
61
+ * 根据聚合结果创建聚合对象
62
+ */
63
+ private createClusters;
64
+ }
65
+ export default PixelClusterCalculator;
@@ -0,0 +1,122 @@
1
+ const d = {
2
+ clusterRadius: 120,
3
+ minClusterPoints: 2,
4
+ maxClusterSymbolSize: 40,
5
+ minClusterSymbolSize: 20
6
+ };
7
+ class m {
8
+ constructor(s, e) {
9
+ this.clusteredLocations = [], this.map = s, this.options = { ...d, ...e };
10
+ }
11
+ /**
12
+ * 计算聚合结果
13
+ * @param locations 原始点位数组
14
+ * @returns 聚合结果
15
+ */
16
+ calculate(s) {
17
+ return this.locationToScreen(s), this.doPixelCluster(this.options.clusterRadius);
18
+ }
19
+ /**
20
+ * 计算聚合符号大小
21
+ * @param clusters 聚合结果
22
+ * @returns 带有符号大小信息的聚合结果
23
+ */
24
+ calculateSymbolSizes(s) {
25
+ let e = Number.MIN_VALUE, i = Number.MAX_VALUE;
26
+ return s.forEach((t) => {
27
+ t.count > 1 && (i = Math.min(i, t.count), e = Math.max(e, t.count));
28
+ }), s.map((t) => {
29
+ if (t.id !== -1 && t.center) {
30
+ let r = i === e ? (this.options.maxClusterSymbolSize + this.options.minClusterSymbolSize) / 2 : this.options.minClusterSymbolSize + (t.count - i) / (e - i) * (this.options.maxClusterSymbolSize - this.options.minClusterSymbolSize);
31
+ return r *= 0.75, { ...t, symbolSize: r };
32
+ }
33
+ return t;
34
+ });
35
+ }
36
+ /**
37
+ * 更新配置
38
+ */
39
+ updateOptions(s) {
40
+ this.options = { ...this.options, ...s };
41
+ }
42
+ /**
43
+ * 获取当前配置
44
+ */
45
+ getOptions() {
46
+ return { ...this.options };
47
+ }
48
+ /**
49
+ * 将地理坐标转换为屏幕坐标
50
+ */
51
+ locationToScreen(s) {
52
+ this.clusteredLocations = [], s.forEach((e) => {
53
+ const i = this.map.getPixelFromCoordinate([e.x, e.y]), [t, r] = i || [NaN, NaN];
54
+ Number.isFinite(t) && Number.isFinite(r) && t > 0 && r > 0 && (e.properties = e.properties || {}, e.properties.screenX = t, e.properties.screenY = r, e.visited = !1, e.clusterId = void 0, this.clusteredLocations.push(e));
55
+ });
56
+ }
57
+ /**
58
+ * 基于像素距离的聚合算法
59
+ */
60
+ doPixelCluster(s) {
61
+ let e = 0;
62
+ for (let i = 0; i < this.clusteredLocations.length; i++) {
63
+ const t = this.clusteredLocations[i];
64
+ if (t.visited)
65
+ continue;
66
+ t.visited = !0;
67
+ const r = this.getNeighbors(t, s);
68
+ r.length < this.options.minClusterPoints ? t.clusterId = -1 : (r.forEach((o) => {
69
+ o.visited = !0, o.clusterId = e;
70
+ }), t.clusterId = e, e++);
71
+ }
72
+ return this.createClusters();
73
+ }
74
+ /**
75
+ * 获取指定点的邻近点
76
+ */
77
+ getNeighbors(s, e) {
78
+ return this.clusteredLocations.filter((i) => i.id === s.id || i.visited ? !1 : this.getDistance(s, i) <= e);
79
+ }
80
+ /**
81
+ * 计算两点之间的屏幕距离
82
+ */
83
+ getDistance(s, e) {
84
+ var i, t, r, o;
85
+ return Math.sqrt(
86
+ Math.pow(
87
+ (((i = s.properties) == null ? void 0 : i.screenX) ?? 0) - (((t = e.properties) == null ? void 0 : t.screenX) ?? 0),
88
+ 2
89
+ ) + Math.pow(
90
+ (((r = s.properties) == null ? void 0 : r.screenY) ?? 0) - (((o = e.properties) == null ? void 0 : o.screenY) ?? 0),
91
+ 2
92
+ )
93
+ );
94
+ }
95
+ /**
96
+ * 根据聚合结果创建聚合对象
97
+ */
98
+ createClusters() {
99
+ const s = {}, e = [];
100
+ for (const t of this.clusteredLocations)
101
+ t.clusterId === void 0 || t.clusterId === -1 ? e.push(t) : (s[t.clusterId] || (s[t.clusterId] = []), s[t.clusterId].push(t));
102
+ const i = Object.keys(s).map((t) => {
103
+ const r = s[Number(t)], o = r.length, c = r.reduce((n, u) => n + u.x, 0), l = r.reduce((n, u) => n + u.y, 0), h = c / o, p = l / o;
104
+ return {
105
+ id: Number(t),
106
+ items: r,
107
+ count: o,
108
+ center: { x: h, y: p }
109
+ };
110
+ });
111
+ return e.length > 0 && i.push({
112
+ id: -1,
113
+ items: e,
114
+ count: e.length,
115
+ center: null
116
+ }), i;
117
+ }
118
+ }
119
+ export {
120
+ m as PixelClusterCalculator,
121
+ m as default
122
+ };
@@ -4,6 +4,7 @@ export default class OlMapInitializer {
4
4
  private mapConfig;
5
5
  private map;
6
6
  private mapView;
7
+ private pointerMoveRaf;
7
8
  private markerClick;
8
9
  initialize(params: IMapInitializerParams): OlMap;
9
10
  private processUrl;