map-ol-utils 0.0.13 → 0.0.15
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",
|
|
@@ -304,6 +299,8 @@ var createSelectByLayer = (vectorLayer) => {
|
|
|
304
299
|
emitter_default.emit("select-marker", data);
|
|
305
300
|
}
|
|
306
301
|
vectorLayer.set("_hasActive", true);
|
|
302
|
+
const view = instance.getView();
|
|
303
|
+
view.animate({ zoom: 12, center: [+data.lnglat[0], +data.lnglat[1]], duration: 1e3 });
|
|
307
304
|
if (vectorLayer.get("_isDynamic")) {
|
|
308
305
|
const activeImage = activeStyle.getImage();
|
|
309
306
|
emitter_default.emit(
|
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",
|
|
@@ -250,6 +245,8 @@ var createSelectByLayer = (vectorLayer) => {
|
|
|
250
245
|
emitter_default.emit("select-marker", data);
|
|
251
246
|
}
|
|
252
247
|
vectorLayer.set("_hasActive", true);
|
|
248
|
+
const view = instance.getView();
|
|
249
|
+
view.animate({ zoom: 12, center: [+data.lnglat[0], +data.lnglat[1]], duration: 1e3 });
|
|
253
250
|
if (vectorLayer.get("_isDynamic")) {
|
|
254
251
|
const activeImage = activeStyle.getImage();
|
|
255
252
|
emitter_default.emit(
|