map-ol-utils 0.0.13 → 0.0.14
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/index.cjs +5 -8
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +5 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -206,9 +206,8 @@ var resetActiveMarker = () => {
|
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
};
|
|
209
|
-
var activeMarkerByUid = (uid
|
|
209
|
+
var activeMarkerByUid = (uid) => {
|
|
210
210
|
var _a;
|
|
211
|
-
console.log(setFitView);
|
|
212
211
|
const massMarksLayers = instance.getLayers().getArray().filter((layer) => layer.get("_isMassMarksLayer"));
|
|
213
212
|
if (massMarksLayers.length) {
|
|
214
213
|
const targetLayer = massMarksLayers.find(
|
|
@@ -216,15 +215,11 @@ var activeMarkerByUid = (uid, setFitView = true) => {
|
|
|
216
215
|
);
|
|
217
216
|
if (targetLayer) {
|
|
218
217
|
const tempList = ((_a = targetLayer.getSource()) == null ? void 0 : _a.getFeatures()) || [];
|
|
219
|
-
const targetFeature = tempList.find(
|
|
220
|
-
(feature) => feature.get("_uuid") === uid
|
|
221
|
-
);
|
|
218
|
+
const targetFeature = tempList.find((feature) => feature.get("_uuid") === uid);
|
|
222
219
|
const selectInteraction = targetLayer.get("_selectInteraction");
|
|
223
220
|
if (selectInteraction) {
|
|
224
221
|
const collection = selectInteraction.getFeatures().getArray();
|
|
225
|
-
const hasFeature = collection.find(
|
|
226
|
-
(feature) => feature.get("_uuid") === uid
|
|
227
|
-
);
|
|
222
|
+
const hasFeature = collection.find((feature) => feature.get("_uuid") === uid);
|
|
228
223
|
if (!hasFeature) {
|
|
229
224
|
selectInteraction.dispatchEvent({
|
|
230
225
|
type: "select",
|
|
@@ -316,6 +311,8 @@ var createSelectByLayer = (vectorLayer) => {
|
|
|
316
311
|
})
|
|
317
312
|
);
|
|
318
313
|
}
|
|
314
|
+
const view = instance.getView();
|
|
315
|
+
view.animate({ zoom: 12, center: [+data.lnglat[0], +data.lnglat[1]], duration: 1e3 });
|
|
319
316
|
}
|
|
320
317
|
if (deselected.length) {
|
|
321
318
|
const feature = deselected[0];
|
package/dist/index.d.cts
CHANGED
|
@@ -125,9 +125,8 @@ declare const resetActiveMarker: () => void;
|
|
|
125
125
|
/**
|
|
126
126
|
* 激活标注点
|
|
127
127
|
* @param uid
|
|
128
|
-
* @param setFitView
|
|
129
128
|
*/
|
|
130
|
-
declare const activeMarkerByUid: (uid: string
|
|
129
|
+
declare const activeMarkerByUid: (uid: string) => void;
|
|
131
130
|
/**
|
|
132
131
|
* 构建MassMarks样式数组
|
|
133
132
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -125,9 +125,8 @@ declare const resetActiveMarker: () => void;
|
|
|
125
125
|
/**
|
|
126
126
|
* 激活标注点
|
|
127
127
|
* @param uid
|
|
128
|
-
* @param setFitView
|
|
129
128
|
*/
|
|
130
|
-
declare const activeMarkerByUid: (uid: string
|
|
129
|
+
declare const activeMarkerByUid: (uid: string) => void;
|
|
131
130
|
/**
|
|
132
131
|
* 构建MassMarks样式数组
|
|
133
132
|
*/
|
package/dist/index.js
CHANGED
|
@@ -152,9 +152,8 @@ var resetActiveMarker = () => {
|
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
};
|
|
155
|
-
var activeMarkerByUid = (uid
|
|
155
|
+
var activeMarkerByUid = (uid) => {
|
|
156
156
|
var _a;
|
|
157
|
-
console.log(setFitView);
|
|
158
157
|
const massMarksLayers = instance.getLayers().getArray().filter((layer) => layer.get("_isMassMarksLayer"));
|
|
159
158
|
if (massMarksLayers.length) {
|
|
160
159
|
const targetLayer = massMarksLayers.find(
|
|
@@ -162,15 +161,11 @@ var activeMarkerByUid = (uid, setFitView = true) => {
|
|
|
162
161
|
);
|
|
163
162
|
if (targetLayer) {
|
|
164
163
|
const tempList = ((_a = targetLayer.getSource()) == null ? void 0 : _a.getFeatures()) || [];
|
|
165
|
-
const targetFeature = tempList.find(
|
|
166
|
-
(feature) => feature.get("_uuid") === uid
|
|
167
|
-
);
|
|
164
|
+
const targetFeature = tempList.find((feature) => feature.get("_uuid") === uid);
|
|
168
165
|
const selectInteraction = targetLayer.get("_selectInteraction");
|
|
169
166
|
if (selectInteraction) {
|
|
170
167
|
const collection = selectInteraction.getFeatures().getArray();
|
|
171
|
-
const hasFeature = collection.find(
|
|
172
|
-
(feature) => feature.get("_uuid") === uid
|
|
173
|
-
);
|
|
168
|
+
const hasFeature = collection.find((feature) => feature.get("_uuid") === uid);
|
|
174
169
|
if (!hasFeature) {
|
|
175
170
|
selectInteraction.dispatchEvent({
|
|
176
171
|
type: "select",
|
|
@@ -262,6 +257,8 @@ var createSelectByLayer = (vectorLayer) => {
|
|
|
262
257
|
})
|
|
263
258
|
);
|
|
264
259
|
}
|
|
260
|
+
const view = instance.getView();
|
|
261
|
+
view.animate({ zoom: 12, center: [+data.lnglat[0], +data.lnglat[1]], duration: 1e3 });
|
|
265
262
|
}
|
|
266
263
|
if (deselected.length) {
|
|
267
264
|
const feature = deselected[0];
|