@corpsmap/corpsmap 4.1.20 → 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
|
@@ -85,7 +85,7 @@ export default {
|
|
|
85
85
|
const overlayCenter = transform(
|
|
86
86
|
selectedItem.center,
|
|
87
87
|
displayProjection,
|
|
88
|
-
"EPSG:3857"
|
|
88
|
+
"EPSG:3857",
|
|
89
89
|
);
|
|
90
90
|
|
|
91
91
|
//add overlay to map
|
|
@@ -96,7 +96,7 @@ export default {
|
|
|
96
96
|
item={selectedItem}
|
|
97
97
|
map={map}
|
|
98
98
|
onClear={store.doClearGeocoderOverlay}
|
|
99
|
-
|
|
99
|
+
/>,
|
|
100
100
|
);
|
|
101
101
|
overlay.setPosition(overlayCenter);
|
|
102
102
|
|
|
@@ -141,8 +141,14 @@ export default {
|
|
|
141
141
|
}&access_token=${mapboxToken}`,
|
|
142
142
|
(err, response, body) => {
|
|
143
143
|
if (err) return callback(err);
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
//TODO JONB
|
|
145
|
+
let results;
|
|
146
|
+
try {
|
|
147
|
+
results = JSON.parse(body);
|
|
148
|
+
} catch (e) {
|
|
149
|
+
return callback(null, []);
|
|
150
|
+
}
|
|
151
|
+
if (!results.features) return callback(null, []);
|
|
146
152
|
|
|
147
153
|
return callback(
|
|
148
154
|
null,
|
|
@@ -163,9 +169,9 @@ export default {
|
|
|
163
169
|
geometry: r.geometry,
|
|
164
170
|
properties: r.properties,
|
|
165
171
|
};
|
|
166
|
-
})
|
|
172
|
+
}),
|
|
167
173
|
);
|
|
168
|
-
}
|
|
174
|
+
},
|
|
169
175
|
);
|
|
170
176
|
},
|
|
171
177
|
|
|
@@ -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
|