@corpsmap/corpsmap 4.1.21 → 4.1.23
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/package.json
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import buffer from "@turf/buffer";
|
|
2
|
-
import { point } from "@turf/helpers";
|
|
3
|
-
import { polygon } from "@turf/helpers";
|
|
4
1
|
import disjoint from "@turf/boolean-disjoint";
|
|
5
2
|
import bbox from "@turf/bbox";
|
|
6
3
|
import GeoJSON from "ol/format/GeoJSON";
|
|
@@ -59,7 +56,7 @@ export default {
|
|
|
59
56
|
const src = mapLayer.getSource();
|
|
60
57
|
let excludedColumns = store.selectIdentifyColumnsExclude();
|
|
61
58
|
const identifyFields = lyr.identifyFields;
|
|
62
|
-
const
|
|
59
|
+
const identifyRenameColumns = lyr.identifyRenameColumns ?? lyr.identifyRenameColums;
|
|
63
60
|
const identifyFormatColumns = lyr.identifyFormatColumns;
|
|
64
61
|
src.forEachFeatureIntersectingExtent(identifyExtent, (f) => {
|
|
65
62
|
const geoJsonFeature = geoJSON.writeFeatureObject(f, {
|
|
@@ -75,8 +72,8 @@ export default {
|
|
|
75
72
|
outFeatures = identifyIncludeColumnsArcgisvector(outFeatures, identifyFields);
|
|
76
73
|
}
|
|
77
74
|
|
|
78
|
-
if (
|
|
79
|
-
outFeatures = identifyRenameColumnsArcgisvector(outFeatures,
|
|
75
|
+
if (identifyRenameColumns) {
|
|
76
|
+
outFeatures = identifyRenameColumnsArcgisvector(outFeatures, identifyRenameColumns);
|
|
80
77
|
}
|
|
81
78
|
|
|
82
79
|
if (identifyFormatColumns) {
|
|
@@ -65,17 +65,14 @@ const identifyExcludeColumnsArcgisvector = function (data, excludedColumns) {
|
|
|
65
65
|
|
|
66
66
|
const identifyIncludeColumnsArcgisvector = function (data, identifyFields) {
|
|
67
67
|
data.forEach((feature) => {
|
|
68
|
-
console.log(feature, feature.properties);
|
|
69
68
|
if (feature.properties) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
feature.properties = reducedProperties;
|
|
78
|
-
}
|
|
69
|
+
const reducedProperties = {};
|
|
70
|
+
identifyFields.forEach((property) => {
|
|
71
|
+
if (Object.prototype.hasOwnProperty.call(feature.properties, property)) {
|
|
72
|
+
reducedProperties[property] = feature.properties[property];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
feature.properties = reducedProperties;
|
|
79
76
|
}
|
|
80
77
|
});
|
|
81
78
|
|
|
@@ -84,17 +81,16 @@ const identifyIncludeColumnsArcgisvector = function (data, identifyFields) {
|
|
|
84
81
|
|
|
85
82
|
const identifyRenameColumnsArcgisvector = function (
|
|
86
83
|
data,
|
|
87
|
-
|
|
84
|
+
identifyRenameColumns
|
|
88
85
|
) {
|
|
89
86
|
data.forEach((feature) => {
|
|
90
87
|
if (feature.properties) {
|
|
91
88
|
let wkData = {};
|
|
92
|
-
for (const [featureKey,
|
|
89
|
+
for (const [featureKey, _featureValue] of Object.entries(
|
|
93
90
|
feature.properties
|
|
94
91
|
)) {
|
|
95
|
-
for (const [key, value] of Object.entries(
|
|
92
|
+
for (const [key, value] of Object.entries(identifyRenameColumns)) {
|
|
96
93
|
if (featureKey === key) {
|
|
97
|
-
// feature.properties[value] = feature.properties[featureKey];
|
|
98
94
|
wkData[value] = feature.properties[featureKey];
|
|
99
95
|
delete feature.properties[featureKey];
|
|
100
96
|
}
|
|
@@ -115,7 +111,7 @@ const identifyFormatColumnsArcgisvector = function (
|
|
|
115
111
|
if (feature.properties) {
|
|
116
112
|
for (const [key, value] of Object.entries(identifyFormatColumns)) {
|
|
117
113
|
console.log(key, value);
|
|
118
|
-
if (
|
|
114
|
+
if (Object.prototype.hasOwnProperty.call(feature.properties, key)) {
|
|
119
115
|
feature.properties[key] = formatColumns(
|
|
120
116
|
feature.properties[key],
|
|
121
117
|
value
|