ym-giswidget-2d 1.0.59 → 1.0.61

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.
@@ -0,0 +1,163 @@
1
+ import { default as OLMap } from 'ym-gis-2d/mapView/Map';
2
+ interface IHotspot {
3
+ x: number;
4
+ y: number;
5
+ weight: number;
6
+ }
7
+ interface IHeatLayerOptions {
8
+ points: IHotspot[];
9
+ title: string;
10
+ }
11
+ type __VLS_Props = {
12
+ map: OLMap;
13
+ data: IHeatLayerOptions[];
14
+ };
15
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ activeInteraction: (...args: any[]) => void;
17
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onActiveInteraction?: ((...args: any[]) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
20
+ locationRef: ({
21
+ $: import('vue').ComponentInternalInstance;
22
+ $data: {};
23
+ $props: {
24
+ readonly title?: string | undefined;
25
+ readonly width?: number | undefined;
26
+ readonly height?: number | undefined;
27
+ readonly minWidth?: number | undefined;
28
+ readonly minHeight?: number | undefined;
29
+ readonly resizable?: boolean | undefined;
30
+ readonly showClose?: boolean | undefined;
31
+ readonly showMinimize?: boolean | undefined;
32
+ readonly showMaximize?: boolean | undefined;
33
+ readonly showDock?: boolean | undefined;
34
+ readonly drag?: boolean | undefined;
35
+ readonly showOk?: boolean | undefined;
36
+ readonly showCancel?: boolean | undefined;
37
+ readonly okText?: string | undefined;
38
+ readonly cancelText?: string | undefined;
39
+ readonly onClose?: ((...args: any[]) => any) | undefined;
40
+ readonly onResize?: ((...args: any[]) => any) | undefined;
41
+ readonly onMove?: ((...args: any[]) => any) | undefined;
42
+ readonly onOk?: ((...args: any[]) => any) | undefined;
43
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
44
+ $attrs: {
45
+ [x: string]: unknown;
46
+ };
47
+ $refs: {
48
+ [x: string]: unknown;
49
+ } & {
50
+ panelRef: HTMLDivElement;
51
+ };
52
+ $slots: Readonly<{
53
+ [name: string]: import('vue').Slot<any> | undefined;
54
+ }>;
55
+ $root: import('vue').ComponentPublicInstance | null;
56
+ $parent: import('vue').ComponentPublicInstance | null;
57
+ $host: Element | null;
58
+ $emit: ((event: "close", ...args: any[]) => void) & ((event: "resize", ...args: any[]) => void) & ((event: "move", ...args: any[]) => void) & ((event: "ok", ...args: any[]) => void);
59
+ $el: HTMLDivElement;
60
+ $options: import('vue').ComponentOptionsBase<Readonly<{
61
+ title?: string;
62
+ width?: number;
63
+ height?: number;
64
+ minWidth?: number;
65
+ minHeight?: number;
66
+ resizable?: boolean;
67
+ showClose?: boolean;
68
+ showMinimize?: boolean;
69
+ showMaximize?: boolean;
70
+ showDock?: boolean;
71
+ drag?: boolean;
72
+ showOk?: boolean;
73
+ showCancel?: boolean;
74
+ okText?: string;
75
+ cancelText?: string;
76
+ }> & Readonly<{
77
+ onClose?: ((...args: any[]) => any) | undefined;
78
+ onResize?: ((...args: any[]) => any) | undefined;
79
+ onMove?: ((...args: any[]) => any) | undefined;
80
+ onOk?: ((...args: any[]) => any) | undefined;
81
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
82
+ close: (...args: any[]) => void;
83
+ resize: (...args: any[]) => void;
84
+ move: (...args: any[]) => void;
85
+ ok: (...args: any[]) => void;
86
+ }, string, {
87
+ title: string;
88
+ showClose: boolean;
89
+ drag: boolean;
90
+ minWidth: number;
91
+ minHeight: number;
92
+ resizable: boolean;
93
+ showMinimize: boolean;
94
+ showMaximize: boolean;
95
+ showDock: boolean;
96
+ showOk: boolean;
97
+ showCancel: boolean;
98
+ okText: string;
99
+ cancelText: string;
100
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
101
+ beforeCreate?: (() => void) | (() => void)[];
102
+ created?: (() => void) | (() => void)[];
103
+ beforeMount?: (() => void) | (() => void)[];
104
+ mounted?: (() => void) | (() => void)[];
105
+ beforeUpdate?: (() => void) | (() => void)[];
106
+ updated?: (() => void) | (() => void)[];
107
+ activated?: (() => void) | (() => void)[];
108
+ deactivated?: (() => void) | (() => void)[];
109
+ beforeDestroy?: (() => void) | (() => void)[];
110
+ beforeUnmount?: (() => void) | (() => void)[];
111
+ destroyed?: (() => void) | (() => void)[];
112
+ unmounted?: (() => void) | (() => void)[];
113
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
114
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
115
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
116
+ };
117
+ $forceUpdate: () => void;
118
+ $nextTick: typeof import('vue').nextTick;
119
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
120
+ } & Readonly<{
121
+ title: string;
122
+ showClose: boolean;
123
+ drag: boolean;
124
+ minWidth: number;
125
+ minHeight: number;
126
+ resizable: boolean;
127
+ showMinimize: boolean;
128
+ showMaximize: boolean;
129
+ showDock: boolean;
130
+ showOk: boolean;
131
+ showCancel: boolean;
132
+ okText: string;
133
+ cancelText: string;
134
+ }> & Omit<Readonly<{
135
+ title?: string;
136
+ width?: number;
137
+ height?: number;
138
+ minWidth?: number;
139
+ minHeight?: number;
140
+ resizable?: boolean;
141
+ showClose?: boolean;
142
+ showMinimize?: boolean;
143
+ showMaximize?: boolean;
144
+ showDock?: boolean;
145
+ drag?: boolean;
146
+ showOk?: boolean;
147
+ showCancel?: boolean;
148
+ okText?: string;
149
+ cancelText?: string;
150
+ }> & Readonly<{
151
+ onClose?: ((...args: any[]) => any) | undefined;
152
+ onResize?: ((...args: any[]) => any) | undefined;
153
+ onMove?: ((...args: any[]) => any) | undefined;
154
+ onOk?: ((...args: any[]) => any) | undefined;
155
+ }>, "title" | "showClose" | "drag" | "minWidth" | "minHeight" | "resizable" | "showMinimize" | "showMaximize" | "showDock" | "showOk" | "showCancel" | "okText" | "cancelText"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
156
+ $slots: {
157
+ header?(_: {}): any;
158
+ default?(_: {}): any;
159
+ footer?(_: {}): any;
160
+ };
161
+ }) | null;
162
+ }, HTMLDivElement>;
163
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import _sfc_main from "./Heatmap.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const _Heatmap = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-39ea422b"]]);
5
+ export {
6
+ _Heatmap as default
7
+ };
@@ -0,0 +1,258 @@
1
+ import { ElForm, ElFormItem, ElSelect, ElOption, ElSlider } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/form/style/css";
4
+ import "element-plus/es/components/slider/style/css";
5
+ import "element-plus/es/components/form-item/style/css";
6
+ import "element-plus/es/components/select/style/css";
7
+ import "element-plus/es/components/option/style/css";
8
+ import { defineComponent, ref, reactive, computed, onMounted, onUnmounted, withDirectives, createBlock, openBlock, withCtx, createElementVNode, createVNode, unref, createCommentVNode, createElementBlock, Fragment, renderList, normalizeStyle, vShow } from "vue";
9
+ import DraggablePanel from "../../panel/DraggablePanel.vue.js";
10
+ import { Heatmap } from "ol/layer";
11
+ import { Vector } from "ol/source";
12
+ import { Feature } from "ol";
13
+ import { Point } from "ol/geom";
14
+ const _hoisted_1 = { class: "control-panel" };
15
+ const _hoisted_2 = { class: "panel-section" };
16
+ const _hoisted_3 = { class: "panel-section" };
17
+ const heatmapId = "heatmap456321";
18
+ const _sfc_main = /* @__PURE__ */ defineComponent({
19
+ __name: "Heatmap",
20
+ props: {
21
+ map: {},
22
+ data: {}
23
+ },
24
+ emits: ["activeInteraction"],
25
+ setup(__props, { emit: __emit }) {
26
+ const emit = __emit;
27
+ const props = __props;
28
+ const gradients = ref({
29
+ "喷流色带": ["#0000FF", "#00FFFF", "#00FF00", "#FFFF00", "#FF0000"],
30
+ "热力图色带": ["#000000", "#800000", "#FF0000", "#FF8000", "#FFFF00"],
31
+ "冷色调色带": ["#00FFFF", "#00BFFF", "#0000FF", "#8A2BE2", "#FF00FF"],
32
+ "大地色系": ["#000000", "#006400", "#00FF00", "#FFFF00", "#FFA500", "#FF0000"],
33
+ "紫翠玉色带": ["#440154", "#3B528B", "#21908C", "#5DC963", "#FDE725"]
34
+ });
35
+ let reactiveValue = reactive({
36
+ visible: true,
37
+ heatOptions: {
38
+ pointRadius: 15,
39
+ blurSize: 15,
40
+ opacity: 0.7,
41
+ selectedGradient: "热力图色带"
42
+ }
43
+ });
44
+ const gradientStyle = computed(() => {
45
+ const colors = gradients.value[reactiveValue.heatOptions.selectedGradient];
46
+ return {
47
+ background: `linear-gradient(to right, ${colors.join(", ")})`
48
+ };
49
+ });
50
+ onMounted(() => {
51
+ const heatLayer = getHeatLayer();
52
+ const title = heatLayer.title;
53
+ if (title) {
54
+ const currentData = props.data.find((item) => item.title === title);
55
+ if (currentData) {
56
+ reactiveValue.sourceData = currentData;
57
+ changeSourceData();
58
+ return;
59
+ }
60
+ }
61
+ reactiveValue.sourceData = props.data[0];
62
+ changeSourceData();
63
+ });
64
+ onUnmounted(() => {
65
+ reactiveValue.visible = false;
66
+ });
67
+ function handleClose() {
68
+ props.map.removeLayerById(heatmapId);
69
+ emit("activeInteraction", { success: false, message: "" });
70
+ }
71
+ function handleOk() {
72
+ reactiveValue.visible = false;
73
+ emit("activeInteraction", { success: false, message: "" });
74
+ }
75
+ function changeSourceData() {
76
+ var _a, _b;
77
+ const heatLayer = getHeatLayer();
78
+ heatLayer.title = (_a = reactiveValue.sourceData) == null ? void 0 : _a.title;
79
+ (_b = heatLayer.getSource()) == null ? void 0 : _b.clear();
80
+ const selectedData = reactiveValue.sourceData;
81
+ if (selectedData) {
82
+ const vectorSource = heatLayer.getSource();
83
+ selectedData.points.forEach((pt) => {
84
+ const feature = new Feature({
85
+ geometry: new Point([pt.x, pt.y]),
86
+ weight: pt.weight
87
+ });
88
+ vectorSource == null ? void 0 : vectorSource.addFeature(feature);
89
+ });
90
+ heatLayer.setSource(vectorSource);
91
+ }
92
+ }
93
+ function getHeatLayer() {
94
+ let heatLayer = props.map.getLayerById(heatmapId);
95
+ if (!heatLayer) {
96
+ heatLayer = new Heatmap({
97
+ source: new Vector(),
98
+ blur: reactiveValue.heatOptions.blurSize,
99
+ radius: reactiveValue.heatOptions.pointRadius,
100
+ opacity: reactiveValue.heatOptions.opacity,
101
+ gradient: gradients.value[reactiveValue.heatOptions.selectedGradient]
102
+ });
103
+ heatLayer.id = heatmapId;
104
+ props.map.addLayer(heatLayer, false);
105
+ }
106
+ return heatLayer;
107
+ }
108
+ function updateHeatmapStyle() {
109
+ const heatmapLayer = getHeatLayer();
110
+ heatmapLayer.setBlur(reactiveValue.heatOptions.blurSize);
111
+ heatmapLayer.setRadius(reactiveValue.heatOptions.pointRadius);
112
+ heatmapLayer.setOpacity(reactiveValue.heatOptions.opacity);
113
+ heatmapLayer.setGradient(gradients.value[reactiveValue.heatOptions.selectedGradient]);
114
+ }
115
+ return (_ctx, _cache) => {
116
+ const _component_el_option = ElOption;
117
+ const _component_el_select = ElSelect;
118
+ const _component_el_form_item = ElFormItem;
119
+ const _component_el_slider = ElSlider;
120
+ const _component_el_form = ElForm;
121
+ return withDirectives((openBlock(), createBlock(DraggablePanel, {
122
+ ref: "locationRef",
123
+ class: "el-current",
124
+ title: "热力图控制",
125
+ drag: true,
126
+ width: 320,
127
+ height: props.data.length > 1 ? 458 : 408,
128
+ showMaximize: false,
129
+ showOk: true,
130
+ "show-cancel": true,
131
+ "cancel-text": "关闭",
132
+ "ok-text": "确认",
133
+ onOk: handleOk,
134
+ onClose: handleClose
135
+ }, {
136
+ default: withCtx(() => [
137
+ createElementVNode("div", _hoisted_1, [
138
+ createElementVNode("div", _hoisted_2, [
139
+ createVNode(_component_el_form, {
140
+ model: unref(reactiveValue).heatOptions,
141
+ "label-width": "auto"
142
+ }, {
143
+ default: withCtx(() => [
144
+ props.data.length > 1 ? (openBlock(), createBlock(_component_el_form_item, {
145
+ key: 0,
146
+ label: "数据源"
147
+ }, {
148
+ default: withCtx(() => [
149
+ createVNode(_component_el_select, {
150
+ modelValue: unref(reactiveValue).sourceData,
151
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(reactiveValue).sourceData = $event),
152
+ "value-key": "title",
153
+ placeholder: "请选择",
154
+ onChange: changeSourceData
155
+ }, {
156
+ default: withCtx(() => [
157
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.data, (item) => {
158
+ return openBlock(), createBlock(_component_el_option, {
159
+ key: item.title,
160
+ label: item.title,
161
+ value: item
162
+ }, null, 8, ["label", "value"]);
163
+ }), 128))
164
+ ]),
165
+ _: 1
166
+ }, 8, ["modelValue"])
167
+ ]),
168
+ _: 1
169
+ })) : createCommentVNode("", true),
170
+ createVNode(_component_el_form_item, { label: "点半径" }, {
171
+ default: withCtx(() => [
172
+ createVNode(_component_el_slider, {
173
+ modelValue: unref(reactiveValue).heatOptions.pointRadius,
174
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(reactiveValue).heatOptions.pointRadius = $event),
175
+ min: 1,
176
+ max: 50,
177
+ step: 1,
178
+ onInput: updateHeatmapStyle
179
+ }, null, 8, ["modelValue"])
180
+ ]),
181
+ _: 1
182
+ }),
183
+ createVNode(_component_el_form_item, { label: "模糊度" }, {
184
+ default: withCtx(() => [
185
+ createVNode(_component_el_slider, {
186
+ modelValue: unref(reactiveValue).heatOptions.blurSize,
187
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(reactiveValue).heatOptions.blurSize = $event),
188
+ min: 1,
189
+ max: 50,
190
+ step: 1,
191
+ onInput: updateHeatmapStyle
192
+ }, null, 8, ["modelValue"])
193
+ ]),
194
+ _: 1
195
+ }),
196
+ createVNode(_component_el_form_item, { label: "颜色渐变" }, {
197
+ default: withCtx(() => [
198
+ createVNode(_component_el_select, {
199
+ modelValue: unref(reactiveValue).heatOptions.selectedGradient,
200
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(reactiveValue).heatOptions.selectedGradient = $event),
201
+ placeholder: "请选择",
202
+ onChange: updateHeatmapStyle
203
+ }, {
204
+ default: withCtx(() => [
205
+ (openBlock(true), createElementBlock(Fragment, null, renderList(gradients.value, (grad, name) => {
206
+ return openBlock(), createBlock(_component_el_option, {
207
+ key: name,
208
+ label: name,
209
+ value: name
210
+ }, null, 8, ["label", "value"]);
211
+ }), 128))
212
+ ]),
213
+ _: 1
214
+ }, 8, ["modelValue"])
215
+ ]),
216
+ _: 1
217
+ }),
218
+ createVNode(_component_el_form_item, { label: "不透明度" }, {
219
+ default: withCtx(() => [
220
+ createVNode(_component_el_slider, {
221
+ modelValue: unref(reactiveValue).heatOptions.opacity,
222
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(reactiveValue).heatOptions.opacity = $event),
223
+ min: 0,
224
+ max: 1,
225
+ step: 0.1,
226
+ onInput: updateHeatmapStyle
227
+ }, null, 8, ["modelValue"])
228
+ ]),
229
+ _: 1
230
+ })
231
+ ]),
232
+ _: 1
233
+ }, 8, ["model"])
234
+ ]),
235
+ createElementVNode("div", _hoisted_3, [
236
+ _cache[5] || (_cache[5] = createElementVNode("h3", null, "热力分布说明", -1)),
237
+ createElementVNode("div", {
238
+ class: "gradient-preview",
239
+ style: normalizeStyle(gradientStyle.value)
240
+ }, null, 4),
241
+ _cache[6] || (_cache[6] = createElementVNode("div", { class: "legend" }, [
242
+ createElementVNode("span", null, "低密度"),
243
+ createElementVNode("span", null, "中密度"),
244
+ createElementVNode("span", null, "高密度")
245
+ ], -1))
246
+ ])
247
+ ])
248
+ ]),
249
+ _: 1
250
+ }, 8, ["height"])), [
251
+ [vShow, unref(reactiveValue).visible]
252
+ ]);
253
+ };
254
+ }
255
+ });
256
+ export {
257
+ _sfc_main as default
258
+ };
@@ -0,0 +1,14 @@
1
+ .control-panel[data-v-39ea422b] {
2
+ padding: 0px 10px;
3
+ }
4
+ .control-panel .gradient-preview[data-v-39ea422b] {
5
+ height: 25px;
6
+ border-radius: 5px;
7
+ margin-bottom: 10px;
8
+ border: 1px solid #ddd;
9
+ }
10
+ .control-panel .legend[data-v-39ea422b] {
11
+ display: flex;
12
+ justify-content: space-between;
13
+ font-size: 0.85rem;
14
+ }
@@ -0,0 +1,8 @@
1
+ import "./index.css";
2
+ import { withInstall } from "../../utils/wthInstall.js";
3
+ import _Heatmap from "./Heatmap.vue.js";
4
+ const Heatmap = withInstall(_Heatmap);
5
+ export {
6
+ Heatmap,
7
+ Heatmap as default
8
+ };
@@ -145,7 +145,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
145
145
  },
146
146
  emits: ["loaded"],
147
147
  setup(__props, { emit: __emit }) {
148
- const modules = /* @__PURE__ */ Object.assign({ "../area-measurement/AreaMeasurement.vue": () => import("../area-measurement/AreaMeasurement.vue2.js"), "../area-measurement/index.ts": () => import("../area-measurement/index.js"), "../clear/Clear.vue": () => import("../clear/Clear.vue2.js"), "../clear/index.ts": () => import("../clear/index.js"), "../difference/Difference.vue": () => import("../difference/Difference.vue2.js"), "../difference/index.ts": () => import("../difference/index.js"), "../distance-measurement/DistanceMeasurement.vue": () => import("../distance-measurement/DistanceMeasurement.vue.js"), "../distance-measurement/index.ts": () => import("../distance-measurement/index.js"), "../draw/Draw.vue": () => import("../draw/Draw.vue2.js"), "../draw/index.ts": () => import("../draw/index.js"), "../export/Export.vue": () => import("../export/Export.vue.js"), "../export/index.ts": () => import("../export/index.js"), "./HorizontallyTopToolbar.vue": () => import("./HorizontallyTopToolbar.vue.js"), "./index.ts": () => import("./index.js"), "../identify/Identify.vue": () => import("../identify/Identify.vue2.js"), "../identify/index.ts": () => import("../identify/index.js"), "../import/Import.vue": () => import("../import/Import.vue2.js"), "../import/index.ts": () => import("../import/index.js"), "../layer-switcher/LayerSwitcher.vue": () => import("../layer-switcher/LayerSwitcher.vue.js"), "../layer-switcher/index.ts": () => import("../layer-switcher/index.js"), "../layer-tree/LayerTree.vue": () => import("../layer-tree/LayerTree.vue.js"), "../layer-tree/index.ts": () => import("../layer-tree/index.js"), "../legend/Legend.vue": () => import("../legend/Legend.vue.js"), "../legend/index.ts": () => import("../legend/index.js"), "../location/Location.vue": () => import("../location/Location.vue.js"), "../location/index.ts": () => import("../location/index.js"), "../map-view/MapView.vue": () => import("../map-view/MapView.vue2.js"), "../map-view/index.ts": () => import("../map-view/index.js"), "../modify/Modify.vue": () => import("../modify/Modify.vue2.js"), "../modify/index.ts": () => import("../modify/index.js"), "../mouse-position/MousePositon.vue": () => import("../mouse-position/MousePositon.vue.js"), "../mouse-position/index.ts": () => import("../mouse-position/index.js"), "../multi-screen-panel/PanelMultiScreen.vue": () => import("../multi-screen-panel/PanelMultiScreen.vue.js"), "../multi-screen-panel/index.ts": () => import("../multi-screen-panel/index.js"), "../multi-screen/MultiScreen.vue": () => import("../multi-screen/MultiScreen.vue.js"), "../multi-screen/index.ts": () => import("../multi-screen/index.js"), "../popup/Popup.vue": () => import("../popup/Popup.vue.js"), "../popup/index.ts": () => import("../popup/index.js"), "../scale-line/ScaleLine.vue": () => import("../scale-line/ScaleLine.vue.js"), "../scale-line/index.ts": () => import("../scale-line/index.js"), "../select/Select.vue": () => import("../select/Select.vue2.js"), "../select/index.ts": () => import("../select/index.js"), "../split/Split.vue": () => import("../split/Split.vue2.js"), "../split/index.ts": () => import("../split/index.js"), "../swipe-layer/SwipeLayer.vue": () => import("../swipe-layer/SwipeLayer.vue2.js"), "../swipe-layer/index.ts": () => import("../swipe-layer/index.js"), "../toc-card/TocCard.vue": () => import("../toc-card/TocCard.vue.js"), "../toc-card/index.ts": () => import("../toc-card/index.js") });
148
+ const modules = /* @__PURE__ */ Object.assign({ "../area-measurement/AreaMeasurement.vue": () => import("../area-measurement/AreaMeasurement.vue2.js"), "../area-measurement/index.ts": () => import("../area-measurement/index.js"), "../clear/Clear.vue": () => import("../clear/Clear.vue2.js"), "../clear/index.ts": () => import("../clear/index.js"), "../difference/Difference.vue": () => import("../difference/Difference.vue2.js"), "../difference/index.ts": () => import("../difference/index.js"), "../distance-measurement/DistanceMeasurement.vue": () => import("../distance-measurement/DistanceMeasurement.vue.js"), "../distance-measurement/index.ts": () => import("../distance-measurement/index.js"), "../draw/Draw.vue": () => import("../draw/Draw.vue2.js"), "../draw/index.ts": () => import("../draw/index.js"), "../export/Export.vue": () => import("../export/Export.vue.js"), "../export/index.ts": () => import("../export/index.js"), "../heatmap/Heatmap.vue": () => import("../heatmap/Heatmap.vue.js"), "../heatmap/index.ts": () => import("../heatmap/index.js"), "./HorizontallyTopToolbar.vue": () => import("./HorizontallyTopToolbar.vue.js"), "./index.ts": () => import("./index.js"), "../identify/Identify.vue": () => import("../identify/Identify.vue2.js"), "../identify/index.ts": () => import("../identify/index.js"), "../import/Import.vue": () => import("../import/Import.vue2.js"), "../import/index.ts": () => import("../import/index.js"), "../layer-switcher/LayerSwitcher.vue": () => import("../layer-switcher/LayerSwitcher.vue.js"), "../layer-switcher/index.ts": () => import("../layer-switcher/index.js"), "../layer-tree/LayerTree.vue": () => import("../layer-tree/LayerTree.vue.js"), "../layer-tree/index.ts": () => import("../layer-tree/index.js"), "../legend/Legend.vue": () => import("../legend/Legend.vue.js"), "../legend/index.ts": () => import("../legend/index.js"), "../location/Location.vue": () => import("../location/Location.vue.js"), "../location/index.ts": () => import("../location/index.js"), "../map-view/MapView.vue": () => import("../map-view/MapView.vue2.js"), "../map-view/index.ts": () => import("../map-view/index.js"), "../modify/Modify.vue": () => import("../modify/Modify.vue2.js"), "../modify/index.ts": () => import("../modify/index.js"), "../mouse-position/MousePositon.vue": () => import("../mouse-position/MousePositon.vue.js"), "../mouse-position/index.ts": () => import("../mouse-position/index.js"), "../multi-screen-panel/PanelMultiScreen.vue": () => import("../multi-screen-panel/PanelMultiScreen.vue.js"), "../multi-screen-panel/index.ts": () => import("../multi-screen-panel/index.js"), "../multi-screen/MultiScreen.vue": () => import("../multi-screen/MultiScreen.vue.js"), "../multi-screen/index.ts": () => import("../multi-screen/index.js"), "../popup/Popup.vue": () => import("../popup/Popup.vue.js"), "../popup/index.ts": () => import("../popup/index.js"), "../scale-line/ScaleLine.vue": () => import("../scale-line/ScaleLine.vue.js"), "../scale-line/index.ts": () => import("../scale-line/index.js"), "../select/Select.vue": () => import("../select/Select.vue2.js"), "../select/index.ts": () => import("../select/index.js"), "../split/Split.vue": () => import("../split/Split.vue2.js"), "../split/index.ts": () => import("../split/index.js"), "../swipe-layer/SwipeLayer.vue": () => import("../swipe-layer/SwipeLayer.vue2.js"), "../swipe-layer/index.ts": () => import("../swipe-layer/index.js"), "../toc-card/TocCard.vue": () => import("../toc-card/TocCard.vue.js"), "../toc-card/index.ts": () => import("../toc-card/index.js") });
149
149
  const emit = __emit;
150
150
  const props = __props;
151
151
  const reactiveValue = reactive({
@@ -1,8 +1,11 @@
1
1
  import { IMapService } from 'ym-gis-2d/entity';
2
2
  import { default as OLMap } from 'ym-gis-2d/mapView/Map';
3
+ interface ILayerSwitcher extends IMapService {
4
+ isRepels?: boolean;
5
+ }
3
6
  type __VLS_Props = {
4
7
  map: OLMap;
5
- layers: IMapService[];
8
+ layers: ILayerSwitcher[];
6
9
  };
7
10
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
8
11
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./LayerSwitcher.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _LayerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2222fecf"]]);
4
+ const _LayerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d9bf6ad4"]]);
5
5
  export {
6
6
  _LayerSwitcher as default
7
7
  };
@@ -13,21 +13,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  activeIds: []
14
14
  //用户存储当前激活的图层id
15
15
  });
16
- onMounted(() => {
16
+ onMounted(async () => {
17
17
  for (const layer of props.layers) {
18
18
  if (layer.checked) {
19
- reactiveValues.activeIds.push(layer.id);
20
- props.map.addMapLayer(layer);
19
+ await addLayer(layer);
21
20
  }
22
21
  }
23
22
  });
24
- function addLayer(layer) {
23
+ async function addLayer(layer) {
25
24
  if (reactiveValues.activeIds.indexOf(layer.id) > -1) {
26
25
  reactiveValues.activeIds.splice(reactiveValues.activeIds.indexOf(layer.id), 1);
27
26
  props.map.removeLayerById(layer.id);
28
27
  } else {
28
+ const ids = props.layers.filter((t) => t.isRepels).map((t) => t.id);
29
+ if (layer.isRepels && ids && ids.length > 0) {
30
+ props.map.removeLayerByIds(ids);
31
+ reactiveValues.activeIds = reactiveValues.activeIds.filter((t) => ids.indexOf(t) === -1);
32
+ }
29
33
  reactiveValues.activeIds.push(layer.id);
30
- props.map.addMapLayer(layer);
34
+ await props.map.addMapLayer(layer);
31
35
  }
32
36
  }
33
37
  return (_ctx, _cache) => {
@@ -1,5 +1,5 @@
1
1
  @charset "UTF-8";
2
- .layerSwitcher[data-v-2222fecf] {
2
+ .layerSwitcher[data-v-d9bf6ad4] {
3
3
  width: 106px;
4
4
  height: 70px;
5
5
  position: absolute;
@@ -16,22 +16,22 @@
16
16
  -o-transition: width 0.8s, height 0.8s, -o-transform 0.8s;
17
17
  /* Opera */
18
18
  }
19
- .layerSwitcher[data-v-2222fecf]:hover {
19
+ .layerSwitcher[data-v-d9bf6ad4]:hover {
20
20
  width: unset;
21
21
  padding-right: 5px;
22
22
  background: rgba(255, 255, 255, 0.3);
23
23
  display: flex;
24
24
  align-items: center;
25
25
  }
26
- .layerSwitcher:hover .layer[data-v-2222fecf] {
26
+ .layerSwitcher:hover .layer[data-v-d9bf6ad4] {
27
27
  margin-left: 5px;
28
28
  position: unset;
29
29
  }
30
- .layerSwitcher:hover span[data-v-2222fecf] {
30
+ .layerSwitcher:hover span[data-v-d9bf6ad4] {
31
31
  position: unset !important;
32
32
  margin-top: 42px;
33
33
  }
34
- .layerSwitcher .mapTypeCard[data-v-2222fecf] {
34
+ .layerSwitcher .mapTypeCard[data-v-d9bf6ad4] {
35
35
  position: absolute;
36
36
  top: 5px;
37
37
  width: 86px;
@@ -53,7 +53,7 @@
53
53
  -o-transition: right 0.8s;
54
54
  /* Opera */
55
55
  }
56
- .layerSwitcher .mapTypeCard span[data-v-2222fecf] {
56
+ .layerSwitcher .mapTypeCard span[data-v-d9bf6ad4] {
57
57
  width: 84px;
58
58
  border-radius: 2px;
59
59
  height: 16px;
@@ -67,15 +67,15 @@
67
67
  background: #888f88;
68
68
  opacity: 0.8;
69
69
  }
70
- .layerSwitcher .layer[data-v-2222fecf] {
70
+ .layerSwitcher .layer[data-v-d9bf6ad4] {
71
71
  background-position: center;
72
72
  background-repeat: no-repeat;
73
73
  background-size: cover;
74
74
  }
75
- .layerSwitcher .layer[data-v-2222fecf]:hover {
75
+ .layerSwitcher .layer[data-v-d9bf6ad4]:hover {
76
76
  border: solid 1px #31a5f7;
77
77
  }
78
- .layerSwitcher .layer:hover span[data-v-2222fecf],
79
- .layerSwitcher .active span[data-v-2222fecf] {
78
+ .layerSwitcher .layer:hover span[data-v-d9bf6ad4],
79
+ .layerSwitcher .active span[data-v-d9bf6ad4] {
80
80
  background: #31a5f7;
81
81
  }
@@ -395,10 +395,12 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
395
395
  refresh: () => void;
396
396
  fitLayer: (layer: import('ym-gis-2d/layers/IBaseLayer').IBaseLayer) => void;
397
397
  fitLayerById: (id: string) => void;
398
+ fitFilterByLayerTag: (layerTag: string, filter: string, isSelected?: boolean) => Promise<void>;
398
399
  addMapLayer: (layerInfo: import('ym-gis-2d/entity').IMapService) => Promise<import('ol/layer/Base').default>;
399
400
  addMapLayers: (layerInfo: import('ym-gis-2d/entity').IMapService[]) => Promise<import('ol/layer/Base').default[]>;
400
401
  addLayer: (layer: import('ol/layer/Base').default, fitLayer?: boolean) => void;
401
402
  removeLayerById: (id: string) => void;
403
+ removeLayerByIds: (ids: string[]) => void;
402
404
  getLayerById: (id: string) => import('ol/layer/Base').default | undefined;
403
405
  getLayerByLayerTag: (layerTag: string) => import('ol/layer/Base').default | undefined;
404
406
  getLayersByIds: (ids: string[]) => import('ol/layer/Base').default[];
@@ -390,10 +390,12 @@ export declare const MapView: import('../../utils').WithInstall<import('vue').De
390
390
  refresh: () => void;
391
391
  fitLayer: (layer: import('ym-gis-2d/layers/IBaseLayer').IBaseLayer) => void;
392
392
  fitLayerById: (id: string) => void;
393
+ fitFilterByLayerTag: (layerTag: string, filter: string, isSelected?: boolean) => Promise<void>;
393
394
  addMapLayer: (layerInfo: import('ym-gis-2d/entity').IMapService) => Promise<import('ol/layer/Base').default>;
394
395
  addMapLayers: (layerInfo: import('ym-gis-2d/entity').IMapService[]) => Promise<import('ol/layer/Base').default[]>;
395
396
  addLayer: (layer: import('ol/layer/Base').default, fitLayer?: boolean) => void;
396
397
  removeLayerById: (id: string) => void;
398
+ removeLayerByIds: (ids: string[]) => void;
397
399
  getLayerById: (id: string) => import('ol/layer/Base').default | undefined;
398
400
  getLayerByLayerTag: (layerTag: string) => import('ol/layer/Base').default | undefined;
399
401
  getLayersByIds: (ids: string[]) => import('ol/layer/Base').default[];
@@ -397,10 +397,12 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
397
397
  refresh: () => void;
398
398
  fitLayer: (layer: import('ym-gis-2d/layers/IBaseLayer').IBaseLayer) => void;
399
399
  fitLayerById: (id: string) => void;
400
+ fitFilterByLayerTag: (layerTag: string, filter: string, isSelected?: boolean) => Promise<void>;
400
401
  addMapLayer: (layerInfo: IMapService) => Promise<import('ol/layer/Base').default>;
401
402
  addMapLayers: (layerInfo: IMapService[]) => Promise<import('ol/layer/Base').default[]>;
402
403
  addLayer: (layer: import('ol/layer/Base').default, fitLayer?: boolean) => void;
403
404
  removeLayerById: (id: string) => void;
405
+ removeLayerByIds: (ids: string[]) => void;
404
406
  getLayerById: (id: string) => import('ol/layer/Base').default | undefined;
405
407
  getLayerByLayerTag: (layerTag: string) => import('ol/layer/Base').default | undefined;
406
408
  getLayersByIds: (ids: string[]) => import('ol/layer/Base').default[];
@@ -393,10 +393,12 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
393
393
  refresh: () => void;
394
394
  fitLayer: (layer: import('ym-gis-2d/layers/IBaseLayer').IBaseLayer) => void;
395
395
  fitLayerById: (id: string) => void;
396
+ fitFilterByLayerTag: (layerTag: string, filter: string, isSelected?: boolean) => Promise<void>;
396
397
  addMapLayer: (layerInfo: import('ym-gis-2d/entity').IMapService) => Promise<import('ol/layer/Base').default>;
397
398
  addMapLayers: (layerInfo: import('ym-gis-2d/entity').IMapService[]) => Promise<import('ol/layer/Base').default[]>;
398
399
  addLayer: (layer: import('ol/layer/Base').default, fitLayer?: boolean) => void;
399
400
  removeLayerById: (id: string) => void;
401
+ removeLayerByIds: (ids: string[]) => void;
400
402
  getLayerById: (id: string) => import('ol/layer/Base').default | undefined;
401
403
  getLayerByLayerTag: (layerTag: string) => import('ol/layer/Base').default | undefined;
402
404
  getLayersByIds: (ids: string[]) => import('ol/layer/Base').default[];
package/index.d.ts CHANGED
@@ -19,3 +19,4 @@ export * from './components/location';
19
19
  export * from './components/split';
20
20
  export * from './components/difference';
21
21
  export * from './components/modify';
22
+ export * from './components/heatmap';
package/index.js CHANGED
@@ -20,6 +20,7 @@ import { Location } from "./components/location/index.js";
20
20
  import { Split } from "./components/split/index.js";
21
21
  import { Difference } from "./components/difference/index.js";
22
22
  import { Modify } from "./components/modify/index.js";
23
+ import { Heatmap } from "./components/heatmap/index.js";
23
24
  export {
24
25
  AreaMeasurement,
25
26
  Clear,
@@ -27,6 +28,7 @@ export {
27
28
  DistanceMeasurement,
28
29
  Draw,
29
30
  Export,
31
+ Heatmap,
30
32
  HorizontallyTopToolbar,
31
33
  Identify,
32
34
  Import,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ym-giswidget-2d",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -10,6 +10,6 @@
10
10
  "element-plus": "^2.9.0",
11
11
  "jszip": "^3.10.1",
12
12
  "ol": "^9.2.4",
13
- "ym-gis-2d": "1.0.38"
13
+ "ym-gis-2d": "1.0.40"
14
14
  }
15
15
  }
@@ -1,8 +0,0 @@
1
- export declare const LayerSwitcher: import('../../utils').WithInstall<import('vue').DefineComponent<{
2
- map: import('ym-gis-2d/mapView/Map').default;
3
- layers: import('ym-gis-2d/entity').IMapService[];
4
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
5
- map: import('ym-gis-2d/mapView/Map').default;
6
- layers: import('ym-gis-2d/entity').IMapService[];
7
- }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>>;
8
- export default LayerSwitcher;