@corpsmap/corpsmap 3.2.5 → 3.2.6
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/dev.js +51 -5
- package/lib/prod.js +51 -5
- package/package.json +1 -1
- package/src/core-plugins/identify/bundle.js +13 -1
- package/src/core-plugins/identify-arcgis-rest/bundle.js +19 -17
- package/src/core-plugins/identify-vector/bundle.js +4 -2
- package/src/openlayers-utils/format-utilities.js +27 -1
package/lib/dev.js
CHANGED
|
@@ -106554,7 +106554,7 @@ var config = {
|
|
|
106554
106554
|
};
|
|
106555
106555
|
|
|
106556
106556
|
var name = "@corpsmap/corpsmap";
|
|
106557
|
-
var version$1 = "3.2.
|
|
106557
|
+
var version$1 = "3.2.6";
|
|
106558
106558
|
var description = "CorpsMap as React Components";
|
|
106559
106559
|
var main = "index.js";
|
|
106560
106560
|
var scripts = {
|
|
@@ -132855,6 +132855,32 @@ var formatArcgisVector = function formatArcgisVector(results) {
|
|
|
132855
132855
|
return results;
|
|
132856
132856
|
};
|
|
132857
132857
|
|
|
132858
|
+
var identifyColumnsArcgisrest = function identifyColumnsArcgisrest(data, excludedColumns) {
|
|
132859
|
+
data.results.forEach(function (result) {
|
|
132860
|
+
if (result.attributes) {
|
|
132861
|
+
excludedColumns.forEach(function (column) {
|
|
132862
|
+
delete result.attributes[column];
|
|
132863
|
+
});
|
|
132864
|
+
}
|
|
132865
|
+
|
|
132866
|
+
return result.attributes;
|
|
132867
|
+
});
|
|
132868
|
+
return data;
|
|
132869
|
+
};
|
|
132870
|
+
|
|
132871
|
+
var identifyColumnsArcgisvector = function identifyColumnsArcgisvector(data, excludedColumns) {
|
|
132872
|
+
data.forEach(function (feature) {
|
|
132873
|
+
if (feature.properties) {
|
|
132874
|
+
excludedColumns.forEach(function (column) {
|
|
132875
|
+
delete feature.properties[column];
|
|
132876
|
+
});
|
|
132877
|
+
}
|
|
132878
|
+
|
|
132879
|
+
return feature.properties;
|
|
132880
|
+
});
|
|
132881
|
+
return data;
|
|
132882
|
+
};
|
|
132883
|
+
|
|
132858
132884
|
function formatUrl(options) {
|
|
132859
132885
|
var url = "".concat(options.root, "/identify?");
|
|
132860
132886
|
var params = [];
|
|
@@ -132910,6 +132936,7 @@ var bundle$1 = {
|
|
|
132910
132936
|
anonGet = _ref3.anonGet;
|
|
132911
132937
|
var coords = store.selectIdentifyCoordinates();
|
|
132912
132938
|
var visibleLayers = store.selectVisibleLayers();
|
|
132939
|
+
var excludedColumns = store.selectIdentifyColumnsExclude();
|
|
132913
132940
|
var featureType = "Point";
|
|
132914
132941
|
if (!visibleLayers.length) return callback(null, []); //http://resources.esri.com/help/9.3/arcgisserver/apis/rest/identify.html
|
|
132915
132942
|
|
|
@@ -132953,7 +132980,8 @@ var bundle$1 = {
|
|
|
132953
132980
|
cb("Error for ".concat(visibleLayer.displayName));
|
|
132954
132981
|
} else {
|
|
132955
132982
|
try {
|
|
132956
|
-
var data = JSON.parse(body);
|
|
132983
|
+
var data = JSON.parse(body);
|
|
132984
|
+
data = identifyColumnsArcgisrest(data, excludedColumns); //Column Filtering
|
|
132957
132985
|
|
|
132958
132986
|
if (visibleLayer.identifyFields) {
|
|
132959
132987
|
data.results.forEach(function (result) {
|
|
@@ -132963,7 +132991,7 @@ var bundle$1 = {
|
|
|
132963
132991
|
key = _Object$entries$_i[0],
|
|
132964
132992
|
value = _Object$entries$_i[1];
|
|
132965
132993
|
|
|
132966
|
-
var reducedProperties =
|
|
132994
|
+
var reducedProperties = [];
|
|
132967
132995
|
visibleLayer.identifyFields.forEach(function (property) {
|
|
132968
132996
|
if (result.attributes[property]) {
|
|
132969
132997
|
reducedProperties[property] = result.attributes[property];
|
|
@@ -142188,7 +142216,8 @@ var bundle$6 = {
|
|
|
142188
142216
|
geom: null,
|
|
142189
142217
|
results: [],
|
|
142190
142218
|
selectedFeature: null,
|
|
142191
|
-
selectedLayer: null
|
|
142219
|
+
selectedLayer: null,
|
|
142220
|
+
identifyColumnsExclude: []
|
|
142192
142221
|
};
|
|
142193
142222
|
return function () {
|
|
142194
142223
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialData;
|
|
@@ -142210,6 +142239,7 @@ var bundle$6 = {
|
|
|
142210
142239
|
case "IDENTIFY_UI_BUFFER_UNIT_UPDATED":
|
|
142211
142240
|
case "IDENTIFY_UI_BUFFER_VALUE_UPDATED":
|
|
142212
142241
|
case "IDENTIFY_UI_BUFFER_FEATURE_UPDATED":
|
|
142242
|
+
case "IDENTIFY_EXCLUDED_COLUMNS_SET":
|
|
142213
142243
|
return Object.assign({}, state, payload);
|
|
142214
142244
|
|
|
142215
142245
|
case "IDENTIFY_ERROR":
|
|
@@ -142754,6 +142784,20 @@ var bundle$6 = {
|
|
|
142754
142784
|
store.doModalClose();
|
|
142755
142785
|
};
|
|
142756
142786
|
},
|
|
142787
|
+
doSetIdentifyColumnsExclude: function doSetIdentifyColumnsExclude(excludedColumn) {
|
|
142788
|
+
return function (_ref25) {
|
|
142789
|
+
var dispatch = _ref25.dispatch;
|
|
142790
|
+
dispatch({
|
|
142791
|
+
type: "IDENTIFY_EXCLUDED_COLUMNS_SET",
|
|
142792
|
+
payload: {
|
|
142793
|
+
identifyColumnsExclude: excludedColumn
|
|
142794
|
+
}
|
|
142795
|
+
});
|
|
142796
|
+
};
|
|
142797
|
+
},
|
|
142798
|
+
selectIdentifyColumnsExclude: function selectIdentifyColumnsExclude(state) {
|
|
142799
|
+
return state.identifyUi.identifyColumnsExclude;
|
|
142800
|
+
},
|
|
142757
142801
|
selectIdentifySelectBy: function selectIdentifySelectBy(state) {
|
|
142758
142802
|
return state.identifyUi.selectBy;
|
|
142759
142803
|
},
|
|
@@ -162681,13 +162725,15 @@ var bundle$e = {
|
|
|
162681
162725
|
var mapLayer = lyr.mapLayer;
|
|
162682
162726
|
var outFeatures = [];
|
|
162683
162727
|
var src = mapLayer.getSource();
|
|
162728
|
+
var excludedColumns = store.selectIdentifyColumnsExclude();
|
|
162684
162729
|
src.forEachFeatureIntersectingExtent(identifyExtent, function (f) {
|
|
162685
162730
|
var geoJsonFeature = geoJSON$3.writeFeatureObject(f, {
|
|
162686
162731
|
featureProjection: "EPSG:3857",
|
|
162687
162732
|
dataProjection: "EPSG:4326"
|
|
162688
162733
|
});
|
|
162689
162734
|
if (!booleanDisjoint(identifyFeature, geoJsonFeature)) outFeatures.push(geoJsonFeature);
|
|
162690
|
-
});
|
|
162735
|
+
});
|
|
162736
|
+
outFeatures = identifyColumnsArcgisvector(outFeatures, excludedColumns); //Column Filtering
|
|
162691
162737
|
|
|
162692
162738
|
if (layers[0].identifyFields) {
|
|
162693
162739
|
outFeatures.forEach(function (feature) {
|
package/lib/prod.js
CHANGED
|
@@ -106468,7 +106468,7 @@ var config = {
|
|
|
106468
106468
|
};
|
|
106469
106469
|
|
|
106470
106470
|
var name = "@corpsmap/corpsmap";
|
|
106471
|
-
var version$1 = "3.2.
|
|
106471
|
+
var version$1 = "3.2.6";
|
|
106472
106472
|
var description = "CorpsMap as React Components";
|
|
106473
106473
|
var main = "index.js";
|
|
106474
106474
|
var scripts = {
|
|
@@ -132769,6 +132769,32 @@ var formatArcgisVector = function formatArcgisVector(results) {
|
|
|
132769
132769
|
return results;
|
|
132770
132770
|
};
|
|
132771
132771
|
|
|
132772
|
+
var identifyColumnsArcgisrest = function identifyColumnsArcgisrest(data, excludedColumns) {
|
|
132773
|
+
data.results.forEach(function (result) {
|
|
132774
|
+
if (result.attributes) {
|
|
132775
|
+
excludedColumns.forEach(function (column) {
|
|
132776
|
+
delete result.attributes[column];
|
|
132777
|
+
});
|
|
132778
|
+
}
|
|
132779
|
+
|
|
132780
|
+
return result.attributes;
|
|
132781
|
+
});
|
|
132782
|
+
return data;
|
|
132783
|
+
};
|
|
132784
|
+
|
|
132785
|
+
var identifyColumnsArcgisvector = function identifyColumnsArcgisvector(data, excludedColumns) {
|
|
132786
|
+
data.forEach(function (feature) {
|
|
132787
|
+
if (feature.properties) {
|
|
132788
|
+
excludedColumns.forEach(function (column) {
|
|
132789
|
+
delete feature.properties[column];
|
|
132790
|
+
});
|
|
132791
|
+
}
|
|
132792
|
+
|
|
132793
|
+
return feature.properties;
|
|
132794
|
+
});
|
|
132795
|
+
return data;
|
|
132796
|
+
};
|
|
132797
|
+
|
|
132772
132798
|
function formatUrl(options) {
|
|
132773
132799
|
var url = "".concat(options.root, "/identify?");
|
|
132774
132800
|
var params = [];
|
|
@@ -132824,6 +132850,7 @@ var bundle$1 = {
|
|
|
132824
132850
|
anonGet = _ref3.anonGet;
|
|
132825
132851
|
var coords = store.selectIdentifyCoordinates();
|
|
132826
132852
|
var visibleLayers = store.selectVisibleLayers();
|
|
132853
|
+
var excludedColumns = store.selectIdentifyColumnsExclude();
|
|
132827
132854
|
var featureType = "Point";
|
|
132828
132855
|
if (!visibleLayers.length) return callback(null, []); //http://resources.esri.com/help/9.3/arcgisserver/apis/rest/identify.html
|
|
132829
132856
|
|
|
@@ -132867,7 +132894,8 @@ var bundle$1 = {
|
|
|
132867
132894
|
cb("Error for ".concat(visibleLayer.displayName));
|
|
132868
132895
|
} else {
|
|
132869
132896
|
try {
|
|
132870
|
-
var data = JSON.parse(body);
|
|
132897
|
+
var data = JSON.parse(body);
|
|
132898
|
+
data = identifyColumnsArcgisrest(data, excludedColumns); //Column Filtering
|
|
132871
132899
|
|
|
132872
132900
|
if (visibleLayer.identifyFields) {
|
|
132873
132901
|
data.results.forEach(function (result) {
|
|
@@ -132877,7 +132905,7 @@ var bundle$1 = {
|
|
|
132877
132905
|
key = _Object$entries$_i[0],
|
|
132878
132906
|
value = _Object$entries$_i[1];
|
|
132879
132907
|
|
|
132880
|
-
var reducedProperties =
|
|
132908
|
+
var reducedProperties = [];
|
|
132881
132909
|
visibleLayer.identifyFields.forEach(function (property) {
|
|
132882
132910
|
if (result.attributes[property]) {
|
|
132883
132911
|
reducedProperties[property] = result.attributes[property];
|
|
@@ -142102,7 +142130,8 @@ var bundle$6 = {
|
|
|
142102
142130
|
geom: null,
|
|
142103
142131
|
results: [],
|
|
142104
142132
|
selectedFeature: null,
|
|
142105
|
-
selectedLayer: null
|
|
142133
|
+
selectedLayer: null,
|
|
142134
|
+
identifyColumnsExclude: []
|
|
142106
142135
|
};
|
|
142107
142136
|
return function () {
|
|
142108
142137
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialData;
|
|
@@ -142124,6 +142153,7 @@ var bundle$6 = {
|
|
|
142124
142153
|
case "IDENTIFY_UI_BUFFER_UNIT_UPDATED":
|
|
142125
142154
|
case "IDENTIFY_UI_BUFFER_VALUE_UPDATED":
|
|
142126
142155
|
case "IDENTIFY_UI_BUFFER_FEATURE_UPDATED":
|
|
142156
|
+
case "IDENTIFY_EXCLUDED_COLUMNS_SET":
|
|
142127
142157
|
return Object.assign({}, state, payload);
|
|
142128
142158
|
|
|
142129
142159
|
case "IDENTIFY_ERROR":
|
|
@@ -142668,6 +142698,20 @@ var bundle$6 = {
|
|
|
142668
142698
|
store.doModalClose();
|
|
142669
142699
|
};
|
|
142670
142700
|
},
|
|
142701
|
+
doSetIdentifyColumnsExclude: function doSetIdentifyColumnsExclude(excludedColumn) {
|
|
142702
|
+
return function (_ref25) {
|
|
142703
|
+
var dispatch = _ref25.dispatch;
|
|
142704
|
+
dispatch({
|
|
142705
|
+
type: "IDENTIFY_EXCLUDED_COLUMNS_SET",
|
|
142706
|
+
payload: {
|
|
142707
|
+
identifyColumnsExclude: excludedColumn
|
|
142708
|
+
}
|
|
142709
|
+
});
|
|
142710
|
+
};
|
|
142711
|
+
},
|
|
142712
|
+
selectIdentifyColumnsExclude: function selectIdentifyColumnsExclude(state) {
|
|
142713
|
+
return state.identifyUi.identifyColumnsExclude;
|
|
142714
|
+
},
|
|
142671
142715
|
selectIdentifySelectBy: function selectIdentifySelectBy(state) {
|
|
142672
142716
|
return state.identifyUi.selectBy;
|
|
142673
142717
|
},
|
|
@@ -162595,13 +162639,15 @@ var bundle$e = {
|
|
|
162595
162639
|
var mapLayer = lyr.mapLayer;
|
|
162596
162640
|
var outFeatures = [];
|
|
162597
162641
|
var src = mapLayer.getSource();
|
|
162642
|
+
var excludedColumns = store.selectIdentifyColumnsExclude();
|
|
162598
162643
|
src.forEachFeatureIntersectingExtent(identifyExtent, function (f) {
|
|
162599
162644
|
var geoJsonFeature = geoJSON$3.writeFeatureObject(f, {
|
|
162600
162645
|
featureProjection: "EPSG:3857",
|
|
162601
162646
|
dataProjection: "EPSG:4326"
|
|
162602
162647
|
});
|
|
162603
162648
|
if (!booleanDisjoint(identifyFeature, geoJsonFeature)) outFeatures.push(geoJsonFeature);
|
|
162604
|
-
});
|
|
162649
|
+
});
|
|
162650
|
+
outFeatures = identifyColumnsArcgisvector(outFeatures, excludedColumns); //Column Filtering
|
|
162605
162651
|
|
|
162606
162652
|
if (layers[0].identifyFields) {
|
|
162607
162653
|
outFeatures.forEach(function (feature) {
|
package/package.json
CHANGED
|
@@ -117,6 +117,7 @@ export default {
|
|
|
117
117
|
results: [],
|
|
118
118
|
selectedFeature: null,
|
|
119
119
|
selectedLayer: null,
|
|
120
|
+
identifyColumnsExclude: [],
|
|
120
121
|
};
|
|
121
122
|
|
|
122
123
|
return (state = initialData, { type, payload }) => {
|
|
@@ -133,6 +134,7 @@ export default {
|
|
|
133
134
|
case "IDENTIFY_UI_BUFFER_UNIT_UPDATED":
|
|
134
135
|
case "IDENTIFY_UI_BUFFER_VALUE_UPDATED":
|
|
135
136
|
case "IDENTIFY_UI_BUFFER_FEATURE_UPDATED":
|
|
137
|
+
case "IDENTIFY_EXCLUDED_COLUMNS_SET":
|
|
136
138
|
return Object.assign({}, state, payload);
|
|
137
139
|
case "IDENTIFY_ERROR":
|
|
138
140
|
return Object.assign({}, state, {
|
|
@@ -638,7 +640,17 @@ export default {
|
|
|
638
640
|
//close modal after selection
|
|
639
641
|
store.doModalClose();
|
|
640
642
|
},
|
|
641
|
-
|
|
643
|
+
doSetIdentifyColumnsExclude: (excludedColumn) => ({dispatch}) =>{
|
|
644
|
+
dispatch({
|
|
645
|
+
type: "IDENTIFY_EXCLUDED_COLUMNS_SET",
|
|
646
|
+
payload: {
|
|
647
|
+
identifyColumnsExclude: excludedColumn,
|
|
648
|
+
},
|
|
649
|
+
});
|
|
650
|
+
},
|
|
651
|
+
selectIdentifyColumnsExclude: (state) => {
|
|
652
|
+
return state.identifyUi.identifyColumnsExclude;
|
|
653
|
+
},
|
|
642
654
|
selectIdentifySelectBy: (state) => {
|
|
643
655
|
return state.identifyUi.selectBy;
|
|
644
656
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import async from "async";
|
|
2
|
-
import { formatArcgisrest} from "../../openlayers-utils/format-utilities";
|
|
2
|
+
import { formatArcgisrest, identifyColumnsArcgisrest} from "../../openlayers-utils/format-utilities";
|
|
3
3
|
|
|
4
4
|
function formatUrl(options) {
|
|
5
5
|
let url = `${options.root}/identify?`;
|
|
@@ -46,6 +46,7 @@ export default {
|
|
|
46
46
|
({ store, anonGet }) => {
|
|
47
47
|
const coords = store.selectIdentifyCoordinates();
|
|
48
48
|
const visibleLayers = store.selectVisibleLayers();
|
|
49
|
+
let excludedColumns = store.selectIdentifyColumnsExclude()
|
|
49
50
|
let featureType = "Point";
|
|
50
51
|
|
|
51
52
|
if (!visibleLayers.length) return callback(null, []);
|
|
@@ -90,22 +91,23 @@ export default {
|
|
|
90
91
|
if (err || response.statusCode !== 200) {
|
|
91
92
|
cb(`Error for ${visibleLayer.displayName}`);
|
|
92
93
|
} else {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
94
|
+
try {
|
|
95
|
+
let data = JSON.parse(body);
|
|
96
|
+
data = identifyColumnsArcgisrest(data, excludedColumns)
|
|
97
|
+
//Column Filtering
|
|
98
|
+
if (visibleLayer.identifyFields) {
|
|
99
|
+
data.results.forEach((result) => {
|
|
100
|
+
if(result.attributes){
|
|
101
|
+
for (const [key, value] of Object.entries(result.attributes)) {
|
|
102
|
+
let reducedProperties = [];
|
|
103
|
+
visibleLayer.identifyFields.forEach((property) => {
|
|
104
|
+
if (result.attributes[property]) {
|
|
105
|
+
reducedProperties[property] =
|
|
106
|
+
result.attributes[property];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
result.attributes = reducedProperties;
|
|
110
|
+
}
|
|
109
111
|
}
|
|
110
112
|
})
|
|
111
113
|
}
|
|
@@ -5,7 +5,7 @@ import disjoint from "@turf/boolean-disjoint";
|
|
|
5
5
|
import bbox from "@turf/bbox";
|
|
6
6
|
import GeoJSON from "ol/format/GeoJSON";
|
|
7
7
|
import { transformExtent } from "ol/proj";
|
|
8
|
-
import { formatArcgisVector } from "../../openlayers-utils/format-utilities";
|
|
8
|
+
import { formatArcgisVector, identifyColumnsArcgisvector } from "../../openlayers-utils/format-utilities";
|
|
9
9
|
|
|
10
10
|
const geoJSON = new GeoJSON();
|
|
11
11
|
|
|
@@ -67,8 +67,9 @@ export default {
|
|
|
67
67
|
layers.forEach((lyr) => {
|
|
68
68
|
if (lyr.identifyType === "arcgisvector") {
|
|
69
69
|
const { mapLayer } = lyr;
|
|
70
|
-
|
|
70
|
+
let outFeatures = [];
|
|
71
71
|
const src = mapLayer.getSource();
|
|
72
|
+
let excludedColumns = store.selectIdentifyColumnsExclude()
|
|
72
73
|
src.forEachFeatureIntersectingExtent(identifyExtent, (f) => {
|
|
73
74
|
const geoJsonFeature = geoJSON.writeFeatureObject(f, {
|
|
74
75
|
featureProjection: "EPSG:3857",
|
|
@@ -77,6 +78,7 @@ export default {
|
|
|
77
78
|
if (!disjoint(identifyFeature, geoJsonFeature))
|
|
78
79
|
outFeatures.push(geoJsonFeature);
|
|
79
80
|
});
|
|
81
|
+
outFeatures = identifyColumnsArcgisvector(outFeatures, excludedColumns)
|
|
80
82
|
//Column Filtering
|
|
81
83
|
if (layers[0].identifyFields) {
|
|
82
84
|
outFeatures.forEach((feature) => {
|
|
@@ -30,4 +30,30 @@ const formatArcgisVector = function (results) {
|
|
|
30
30
|
return results;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const identifyColumnsArcgisrest = function (data, excludedColumns) {
|
|
34
|
+
data.results.forEach((result) => {
|
|
35
|
+
if(result.attributes){
|
|
36
|
+
excludedColumns.forEach((column) => {
|
|
37
|
+
delete result.attributes[column];
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return result.attributes
|
|
41
|
+
});
|
|
42
|
+
return data;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const identifyColumnsArcgisvector = function (data, excludedColumns) {
|
|
46
|
+
data.forEach((feature) => {
|
|
47
|
+
if(feature.properties){
|
|
48
|
+
excludedColumns.forEach((column) => {
|
|
49
|
+
delete feature.properties[column];
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return feature.properties
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export { formatArcgisVector, formatArcgisrest, identifyColumnsArcgisrest, identifyColumnsArcgisvector };
|