@corpsmap/corpsmap 4.1.21 → 4.1.22
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) {
|
|
@@ -67,7 +67,7 @@ const identifyIncludeColumnsArcgisvector = function (data, identifyFields) {
|
|
|
67
67
|
data.forEach((feature) => {
|
|
68
68
|
console.log(feature, feature.properties);
|
|
69
69
|
if (feature.properties) {
|
|
70
|
-
for (const [
|
|
70
|
+
for (const [_key, _value] of Object.entries(feature.properties)) {
|
|
71
71
|
let reducedProperties = {};
|
|
72
72
|
identifyFields.forEach((property) => {
|
|
73
73
|
if (feature.properties[property]) {
|
|
@@ -84,17 +84,16 @@ const identifyIncludeColumnsArcgisvector = function (data, identifyFields) {
|
|
|
84
84
|
|
|
85
85
|
const identifyRenameColumnsArcgisvector = function (
|
|
86
86
|
data,
|
|
87
|
-
|
|
87
|
+
identifyRenameColumns
|
|
88
88
|
) {
|
|
89
89
|
data.forEach((feature) => {
|
|
90
90
|
if (feature.properties) {
|
|
91
91
|
let wkData = {};
|
|
92
|
-
for (const [featureKey,
|
|
92
|
+
for (const [featureKey, _featureValue] of Object.entries(
|
|
93
93
|
feature.properties
|
|
94
94
|
)) {
|
|
95
|
-
for (const [key, value] of Object.entries(
|
|
95
|
+
for (const [key, value] of Object.entries(identifyRenameColumns)) {
|
|
96
96
|
if (featureKey === key) {
|
|
97
|
-
// feature.properties[value] = feature.properties[featureKey];
|
|
98
97
|
wkData[value] = feature.properties[featureKey];
|
|
99
98
|
delete feature.properties[featureKey];
|
|
100
99
|
}
|
|
@@ -115,7 +114,7 @@ const identifyFormatColumnsArcgisvector = function (
|
|
|
115
114
|
if (feature.properties) {
|
|
116
115
|
for (const [key, value] of Object.entries(identifyFormatColumns)) {
|
|
117
116
|
console.log(key, value);
|
|
118
|
-
if (
|
|
117
|
+
if (Object.prototype.hasOwnProperty.call(feature.properties, key)) {
|
|
119
118
|
feature.properties[key] = formatColumns(
|
|
120
119
|
feature.properties[key],
|
|
121
120
|
value
|