@community-release/nx-ui 0.0.35 → 0.0.36
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/dist/module.json +1 -1
- package/dist/runtime/components/map/index.vue +10 -0
- package/dist/runtime/components/map/location/nearest.vue +2 -1
- package/dist/runtime/components/map/openlayers/index.vue +19 -6
- package/dist/runtime/components/map/props.json +2 -1
- package/dist/runtime/components/map/store.d.ts +2 -0
- package/dist/runtime/components/map/store.mjs +2 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -75,6 +75,14 @@ const props = defineProps({
|
|
|
75
75
|
default: '',
|
|
76
76
|
type: String
|
|
77
77
|
},
|
|
78
|
+
clusterColor: {
|
|
79
|
+
default: comProps.clusterColor,
|
|
80
|
+
type: String
|
|
81
|
+
},
|
|
82
|
+
disabledClusterColor: {
|
|
83
|
+
default: comProps.disabledClusterColor,
|
|
84
|
+
type: String
|
|
85
|
+
},
|
|
78
86
|
});
|
|
79
87
|
|
|
80
88
|
store.coord = props.coord;
|
|
@@ -86,6 +94,8 @@ store.markers = props.markers;
|
|
|
86
94
|
store.markerImage = props.markerImage;
|
|
87
95
|
store.markerActiveImage = props.markerActiveImage;
|
|
88
96
|
store.markerDisabledImage = props.markerDisabledImage;
|
|
97
|
+
store.clusterColor = props.clusterColor;
|
|
98
|
+
store.disabledClusterColor = props.disabledClusterColor;
|
|
89
99
|
|
|
90
100
|
watch(() => props.disabledMarkers, (v) => {
|
|
91
101
|
store.setDisabledMarkers(v);
|
|
@@ -72,6 +72,8 @@
|
|
|
72
72
|
if (clickInProcess) return;
|
|
73
73
|
clickInProcess = true;
|
|
74
74
|
|
|
75
|
+
store.setSelectedMarker(null);
|
|
76
|
+
|
|
75
77
|
try {
|
|
76
78
|
// If cache not exist or it's older than 1 minute
|
|
77
79
|
if (!cachedPosition || Date.now() - cachedTime > 60000) {
|
|
@@ -107,7 +109,6 @@
|
|
|
107
109
|
emit('error', 'error-geo-not-enabled-on-device');
|
|
108
110
|
}
|
|
109
111
|
|
|
110
|
-
store.setSelectedMarker(null);
|
|
111
112
|
loading.value = false;
|
|
112
113
|
clickInProcess = false;
|
|
113
114
|
}
|
|
@@ -75,6 +75,8 @@
|
|
|
75
75
|
markerActiveImage,
|
|
76
76
|
markerDisabledImage,
|
|
77
77
|
selectedMarker,
|
|
78
|
+
clusterColor,
|
|
79
|
+
disabledClusterColor,
|
|
78
80
|
userCoord
|
|
79
81
|
} = storeToRefs(store);
|
|
80
82
|
|
|
@@ -90,8 +92,6 @@
|
|
|
90
92
|
watch([requestCoordChange, requestZoomChange], () => {
|
|
91
93
|
if (!requestCoordChange.value && !requestZoomChange.value) return;
|
|
92
94
|
|
|
93
|
-
console.log('Watch coord or zoom change');
|
|
94
|
-
|
|
95
95
|
const options = {
|
|
96
96
|
duration: cameraDuration.value
|
|
97
97
|
};
|
|
@@ -239,18 +239,31 @@
|
|
|
239
239
|
const isSelected = markerId === selectedMarker.value?.id;
|
|
240
240
|
|
|
241
241
|
style = styleCache[isSelected ? 'active' : (isDisabled ? 'disabled' : 'default')];
|
|
242
|
+
|
|
242
243
|
// If cluster
|
|
243
244
|
} else {
|
|
245
|
+
let isDisabled = false;
|
|
246
|
+
|
|
247
|
+
// Check if cluster have disabled markers
|
|
248
|
+
for (let item of allFeatures) {
|
|
249
|
+
if (disabledMarkers.value.includes(item.attributes.id)) {
|
|
250
|
+
isDisabled = true;
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const cacheId = size + (isDisabled ? 'd' : '');
|
|
256
|
+
|
|
244
257
|
// Have cache
|
|
245
|
-
if (styleCache[
|
|
246
|
-
style = styleCache[
|
|
258
|
+
if (styleCache[cacheId]) {
|
|
259
|
+
style = styleCache[cacheId];
|
|
247
260
|
// No cache
|
|
248
261
|
} else {
|
|
249
262
|
style = new Style({
|
|
250
263
|
image: new CircleStyle({
|
|
251
264
|
radius: 14,
|
|
252
265
|
fill: new Fill({
|
|
253
|
-
color:
|
|
266
|
+
color: isDisabled ? disabledClusterColor.value : clusterColor.value,
|
|
254
267
|
}),
|
|
255
268
|
}),
|
|
256
269
|
text: new Text({
|
|
@@ -262,7 +275,7 @@
|
|
|
262
275
|
}),
|
|
263
276
|
});
|
|
264
277
|
|
|
265
|
-
styleCache[
|
|
278
|
+
styleCache[cacheId] = style;
|
|
266
279
|
}
|
|
267
280
|
}
|
|
268
281
|
|