vue-openlayers-plugin 1.0.54 → 1.0.56
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/lib/{index-a3727619.mjs → index-a4ec7e53.mjs} +36 -28
- package/lib/{index.es-49a6cfdb.mjs → index.es-1ed309bd.mjs} +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +35 -27
- package/package.json +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/GeoJSONLayerHandler.d.ts +2 -0
- package/types/src/components/CustomOpenlayer/utils/layers/GeoJSONLayerHandler.d.ts.map +1 -1
|
@@ -83210,6 +83210,8 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83210
83210
|
constructor(config, map2) {
|
|
83211
83211
|
super(config, map2);
|
|
83212
83212
|
__publicField(this, "styleConfig");
|
|
83213
|
+
__publicField(this, "currentFilters", []);
|
|
83214
|
+
__publicField(this, "originalFeatures", []);
|
|
83213
83215
|
}
|
|
83214
83216
|
createLayer() {
|
|
83215
83217
|
var _a3, _b3, _c2;
|
|
@@ -83235,12 +83237,7 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83235
83237
|
const features2 = format2.readFeatures(this.config.data, {
|
|
83236
83238
|
featureProjection: mapProjection
|
|
83237
83239
|
});
|
|
83238
|
-
|
|
83239
|
-
try {
|
|
83240
|
-
console.log("[GeoJSONLayerHandler] 示例要素属性:", features2[0].getProperties());
|
|
83241
|
-
} catch (e8) {
|
|
83242
|
-
}
|
|
83243
|
-
}
|
|
83240
|
+
this.originalFeatures = features2;
|
|
83244
83241
|
return new VectorSource$2({ features: features2 });
|
|
83245
83242
|
} else if (this.config.url) {
|
|
83246
83243
|
const source = new VectorSource$2({
|
|
@@ -83262,6 +83259,9 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83262
83259
|
source.on("addfeature", logOnce);
|
|
83263
83260
|
} catch (e8) {
|
|
83264
83261
|
}
|
|
83262
|
+
source.on("featuresloadend", () => {
|
|
83263
|
+
this.originalFeatures = source.getFeatures();
|
|
83264
|
+
});
|
|
83265
83265
|
return source;
|
|
83266
83266
|
} else {
|
|
83267
83267
|
return new VectorSource$2();
|
|
@@ -83419,16 +83419,20 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83419
83419
|
var _a3;
|
|
83420
83420
|
const layer2 = this.getLayer();
|
|
83421
83421
|
const source = layer2.getSource();
|
|
83422
|
-
if (source)
|
|
83423
|
-
|
|
83424
|
-
|
|
83425
|
-
|
|
83426
|
-
|
|
83427
|
-
|
|
83428
|
-
|
|
83429
|
-
|
|
83430
|
-
|
|
83431
|
-
|
|
83422
|
+
if (!source)
|
|
83423
|
+
return;
|
|
83424
|
+
const format2 = new GeoJSON$4();
|
|
83425
|
+
const mapProjection = ((_a3 = this.map) == null ? void 0 : _a3.getView().getProjection().getCode()) || "EPSG:4326";
|
|
83426
|
+
const olFeatures = format2.readFeatures({
|
|
83427
|
+
type: "FeatureCollection",
|
|
83428
|
+
features: features2
|
|
83429
|
+
}, {
|
|
83430
|
+
featureProjection: mapProjection
|
|
83431
|
+
});
|
|
83432
|
+
source.addFeatures(olFeatures);
|
|
83433
|
+
this.originalFeatures.push(...olFeatures);
|
|
83434
|
+
if (this.getEnabledFilters().length > 0) {
|
|
83435
|
+
this.applyFilters();
|
|
83432
83436
|
}
|
|
83433
83437
|
}
|
|
83434
83438
|
/**
|
|
@@ -83437,9 +83441,10 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83437
83441
|
clearFeatures() {
|
|
83438
83442
|
const layer2 = this.getLayer();
|
|
83439
83443
|
const source = layer2.getSource();
|
|
83440
|
-
if (source)
|
|
83441
|
-
|
|
83442
|
-
|
|
83444
|
+
if (!source)
|
|
83445
|
+
return;
|
|
83446
|
+
source.clear();
|
|
83447
|
+
this.originalFeatures = [];
|
|
83443
83448
|
}
|
|
83444
83449
|
/**
|
|
83445
83450
|
* 获取要素数量
|
|
@@ -83670,25 +83675,28 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83670
83675
|
* 应用过滤器(实现基类的抽象方法)
|
|
83671
83676
|
*/
|
|
83672
83677
|
applyFilters() {
|
|
83678
|
+
debugger;
|
|
83673
83679
|
const layer2 = this.getLayer();
|
|
83674
83680
|
const source = layer2.getSource();
|
|
83675
83681
|
if (!source)
|
|
83676
83682
|
return;
|
|
83677
83683
|
const enabledFilters = this.getEnabledFilters();
|
|
83678
|
-
|
|
83684
|
+
if (this.originalFeatures.length === 0) {
|
|
83685
|
+
this.originalFeatures = source.getFeatures();
|
|
83686
|
+
}
|
|
83679
83687
|
if (enabledFilters.length === 0) {
|
|
83680
|
-
|
|
83681
|
-
|
|
83682
|
-
});
|
|
83688
|
+
source.clear();
|
|
83689
|
+
source.addFeatures(this.originalFeatures);
|
|
83683
83690
|
return;
|
|
83684
83691
|
}
|
|
83685
83692
|
const logic = this.getFilterLogic();
|
|
83686
|
-
|
|
83693
|
+
const filtered = this.originalFeatures.filter((feature2) => {
|
|
83687
83694
|
const results = enabledFilters.map((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
|
|
83688
|
-
|
|
83689
|
-
feature2.setStyle(visible ? void 0 : new Style$3({}));
|
|
83695
|
+
return this.combineByLogic(results);
|
|
83690
83696
|
});
|
|
83691
|
-
|
|
83697
|
+
source.clear();
|
|
83698
|
+
source.addFeatures(filtered);
|
|
83699
|
+
console.log(`GeoJSON图层应用过滤器(${logic}),显示 ${filtered.length}/${this.originalFeatures.length} 个要素`);
|
|
83692
83700
|
}
|
|
83693
83701
|
/**
|
|
83694
83702
|
* 检查要素是否符合过滤器条件
|
|
@@ -490520,7 +490528,7 @@ function(t3) {
|
|
|
490520
490528
|
*/
|
|
490521
490529
|
function(t3) {
|
|
490522
490530
|
function e8() {
|
|
490523
|
-
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-
|
|
490531
|
+
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-1ed309bd.mjs")).catch(function(t4) {
|
|
490524
490532
|
return Promise.reject(new Error("Could not load canvg: " + t4));
|
|
490525
490533
|
}).then(function(t4) {
|
|
490526
490534
|
return t4.default ? t4.default : t4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as commonjsGlobal, R as RGBColor, r as requestAnimationFrame, _ as _asyncToGenerator, a as _, p as processCanvasRGBA, b as _defineProperty } from "./index-
|
|
1
|
+
import { c as commonjsGlobal, R as RGBColor, r as requestAnimationFrame, _ as _asyncToGenerator, a as _, p as processCanvasRGBA, b as _defineProperty } from "./index-a4ec7e53.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ol";
|
|
4
4
|
var check = function(it) {
|
package/lib/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z, B, d, C, D, a2, a3, u, y, a7, a6, I, H, Z, $, L, J, K, a4, h, M, a0, a1, X, Y, U, W, Q, S, P, A, F, G, N, O, a8, e, T, E, V, x, j, o, t, f, k, g, w, q, m, n, a5, i, s, l, v } from "./index-
|
|
1
|
+
import { z, B, d, C, D, a2, a3, u, y, a7, a6, I, H, Z, $, L, J, K, a4, h, M, a0, a1, X, Y, U, W, Q, S, P, A, F, G, N, O, a8, e, T, E, V, x, j, o, t, f, k, g, w, q, m, n, a5, i, s, l, v } from "./index-a4ec7e53.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ol";
|
|
4
4
|
export {
|
package/lib/index.umd.js
CHANGED
|
@@ -83719,6 +83719,8 @@ ${this.attributes_.map(
|
|
|
83719
83719
|
constructor(config, map2) {
|
|
83720
83720
|
super(config, map2);
|
|
83721
83721
|
__publicField(this, "styleConfig");
|
|
83722
|
+
__publicField(this, "currentFilters", []);
|
|
83723
|
+
__publicField(this, "originalFeatures", []);
|
|
83722
83724
|
}
|
|
83723
83725
|
createLayer() {
|
|
83724
83726
|
var _a3, _b3, _c2;
|
|
@@ -83744,12 +83746,7 @@ ${this.attributes_.map(
|
|
|
83744
83746
|
const features2 = format2.readFeatures(this.config.data, {
|
|
83745
83747
|
featureProjection: mapProjection
|
|
83746
83748
|
});
|
|
83747
|
-
|
|
83748
|
-
try {
|
|
83749
|
-
console.log("[GeoJSONLayerHandler] 示例要素属性:", features2[0].getProperties());
|
|
83750
|
-
} catch (e3) {
|
|
83751
|
-
}
|
|
83752
|
-
}
|
|
83749
|
+
this.originalFeatures = features2;
|
|
83753
83750
|
return new VectorSource$2({ features: features2 });
|
|
83754
83751
|
} else if (this.config.url) {
|
|
83755
83752
|
const source = new VectorSource$2({
|
|
@@ -83771,6 +83768,9 @@ ${this.attributes_.map(
|
|
|
83771
83768
|
source.on("addfeature", logOnce);
|
|
83772
83769
|
} catch (e3) {
|
|
83773
83770
|
}
|
|
83771
|
+
source.on("featuresloadend", () => {
|
|
83772
|
+
this.originalFeatures = source.getFeatures();
|
|
83773
|
+
});
|
|
83774
83774
|
return source;
|
|
83775
83775
|
} else {
|
|
83776
83776
|
return new VectorSource$2();
|
|
@@ -83928,16 +83928,20 @@ ${this.attributes_.map(
|
|
|
83928
83928
|
var _a3;
|
|
83929
83929
|
const layer2 = this.getLayer();
|
|
83930
83930
|
const source = layer2.getSource();
|
|
83931
|
-
if (source)
|
|
83932
|
-
|
|
83933
|
-
|
|
83934
|
-
|
|
83935
|
-
|
|
83936
|
-
|
|
83937
|
-
|
|
83938
|
-
|
|
83939
|
-
|
|
83940
|
-
|
|
83931
|
+
if (!source)
|
|
83932
|
+
return;
|
|
83933
|
+
const format2 = new GeoJSON$4();
|
|
83934
|
+
const mapProjection = ((_a3 = this.map) == null ? void 0 : _a3.getView().getProjection().getCode()) || "EPSG:4326";
|
|
83935
|
+
const olFeatures = format2.readFeatures({
|
|
83936
|
+
type: "FeatureCollection",
|
|
83937
|
+
features: features2
|
|
83938
|
+
}, {
|
|
83939
|
+
featureProjection: mapProjection
|
|
83940
|
+
});
|
|
83941
|
+
source.addFeatures(olFeatures);
|
|
83942
|
+
this.originalFeatures.push(...olFeatures);
|
|
83943
|
+
if (this.getEnabledFilters().length > 0) {
|
|
83944
|
+
this.applyFilters();
|
|
83941
83945
|
}
|
|
83942
83946
|
}
|
|
83943
83947
|
/**
|
|
@@ -83946,9 +83950,10 @@ ${this.attributes_.map(
|
|
|
83946
83950
|
clearFeatures() {
|
|
83947
83951
|
const layer2 = this.getLayer();
|
|
83948
83952
|
const source = layer2.getSource();
|
|
83949
|
-
if (source)
|
|
83950
|
-
|
|
83951
|
-
|
|
83953
|
+
if (!source)
|
|
83954
|
+
return;
|
|
83955
|
+
source.clear();
|
|
83956
|
+
this.originalFeatures = [];
|
|
83952
83957
|
}
|
|
83953
83958
|
/**
|
|
83954
83959
|
* 获取要素数量
|
|
@@ -84179,25 +84184,28 @@ ${this.attributes_.map(
|
|
|
84179
84184
|
* 应用过滤器(实现基类的抽象方法)
|
|
84180
84185
|
*/
|
|
84181
84186
|
applyFilters() {
|
|
84187
|
+
debugger;
|
|
84182
84188
|
const layer2 = this.getLayer();
|
|
84183
84189
|
const source = layer2.getSource();
|
|
84184
84190
|
if (!source)
|
|
84185
84191
|
return;
|
|
84186
84192
|
const enabledFilters = this.getEnabledFilters();
|
|
84187
|
-
|
|
84193
|
+
if (this.originalFeatures.length === 0) {
|
|
84194
|
+
this.originalFeatures = source.getFeatures();
|
|
84195
|
+
}
|
|
84188
84196
|
if (enabledFilters.length === 0) {
|
|
84189
|
-
|
|
84190
|
-
|
|
84191
|
-
});
|
|
84197
|
+
source.clear();
|
|
84198
|
+
source.addFeatures(this.originalFeatures);
|
|
84192
84199
|
return;
|
|
84193
84200
|
}
|
|
84194
84201
|
const logic = this.getFilterLogic();
|
|
84195
|
-
|
|
84202
|
+
const filtered = this.originalFeatures.filter((feature2) => {
|
|
84196
84203
|
const results = enabledFilters.map((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
|
|
84197
|
-
|
|
84198
|
-
feature2.setStyle(visible ? void 0 : new Style$3({}));
|
|
84204
|
+
return this.combineByLogic(results);
|
|
84199
84205
|
});
|
|
84200
|
-
|
|
84206
|
+
source.clear();
|
|
84207
|
+
source.addFeatures(filtered);
|
|
84208
|
+
console.log(`GeoJSON图层应用过滤器(${logic}),显示 ${filtered.length}/${this.originalFeatures.length} 个要素`);
|
|
84201
84209
|
}
|
|
84202
84210
|
/**
|
|
84203
84211
|
* 检查要素是否符合过滤器条件
|
package/package.json
CHANGED
|
@@ -10,6 +10,8 @@ import { IStyleConfigMap } from '../styles';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class GeoJSONLayerHandler extends BaseLayer {
|
|
12
12
|
private styleConfig?;
|
|
13
|
+
private currentFilters;
|
|
14
|
+
private originalFeatures;
|
|
13
15
|
constructor(config: LayerConfig, map?: OLMap);
|
|
14
16
|
createLayer(): Layer<VectorSource>;
|
|
15
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoJSONLayerHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CustomOpenlayer/utils/layers/GeoJSONLayerHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,YAAY,MAAM,kBAAkB,CAAC;AAM5C,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAA0D,MAAM,aAAa,CAAC;AAEvG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;IAChD,OAAO,CAAC,WAAW,CAAC,CAAkB;
|
|
1
|
+
{"version":3,"file":"GeoJSONLayerHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CustomOpenlayer/utils/layers/GeoJSONLayerHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC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