@corpsmap/corpsmap 3.2.4 → 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 +77 -48
- package/lib/prod.js +77 -48
- package/package.json +1 -1
- package/src/application-bundles/config-bundle.js +37 -33
- package/src/application-exports/map-provider.js +3 -0
- package/src/core-plugins/basemap-switcher/basemap-switcher-list-item copy.js +59 -0
- package/src/core-plugins/basemap-switcher/basemap-switcher-list-item.js +11 -24
- 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
|
@@ -4573,6 +4573,9 @@ var configBundle = {
|
|
|
4573
4573
|
return b;
|
|
4574
4574
|
});
|
|
4575
4575
|
},
|
|
4576
|
+
selectBasemapImages: function selectBasemapImages(state) {
|
|
4577
|
+
return state.config["default"].basemapImageIDs;
|
|
4578
|
+
},
|
|
4576
4579
|
selectDefaultLayers: function selectDefaultLayers(state) {
|
|
4577
4580
|
return state.config["default"].datasets;
|
|
4578
4581
|
},
|
|
@@ -106551,7 +106554,7 @@ var config = {
|
|
|
106551
106554
|
};
|
|
106552
106555
|
|
|
106553
106556
|
var name = "@corpsmap/corpsmap";
|
|
106554
|
-
var version$1 = "3.2.
|
|
106557
|
+
var version$1 = "3.2.6";
|
|
106555
106558
|
var description = "CorpsMap as React Components";
|
|
106556
106559
|
var main = "index.js";
|
|
106557
106560
|
var scripts = {
|
|
@@ -106705,6 +106708,8 @@ var Map$4 = /*#__PURE__*/function (_React$Component) {
|
|
|
106705
106708
|
theme = _this$props.theme,
|
|
106706
106709
|
themeNavSize = _this$props.themeNavSize,
|
|
106707
106710
|
basemaps = _this$props.basemaps,
|
|
106711
|
+
_this$props$basemapIm = _this$props.basemapImageIDs,
|
|
106712
|
+
basemapImageIDs = _this$props$basemapIm === void 0 ? [] : _this$props$basemapIm,
|
|
106708
106713
|
limitMapExtent = _this$props.limitMapExtent;
|
|
106709
106714
|
cache.getAll().then(function (initialData) {
|
|
106710
106715
|
initialData.config = {
|
|
@@ -106717,6 +106722,8 @@ var Map$4 = /*#__PURE__*/function (_React$Component) {
|
|
|
106717
106722
|
});
|
|
106718
106723
|
}
|
|
106719
106724
|
|
|
106725
|
+
initialData.config["default"].basemapImageIDs = basemapImageIDs;
|
|
106726
|
+
|
|
106720
106727
|
if (height) {
|
|
106721
106728
|
initialData.vLayout = {
|
|
106722
106729
|
height: height,
|
|
@@ -132848,6 +132855,32 @@ var formatArcgisVector = function formatArcgisVector(results) {
|
|
|
132848
132855
|
return results;
|
|
132849
132856
|
};
|
|
132850
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
|
+
|
|
132851
132884
|
function formatUrl(options) {
|
|
132852
132885
|
var url = "".concat(options.root, "/identify?");
|
|
132853
132886
|
var params = [];
|
|
@@ -132903,6 +132936,7 @@ var bundle$1 = {
|
|
|
132903
132936
|
anonGet = _ref3.anonGet;
|
|
132904
132937
|
var coords = store.selectIdentifyCoordinates();
|
|
132905
132938
|
var visibleLayers = store.selectVisibleLayers();
|
|
132939
|
+
var excludedColumns = store.selectIdentifyColumnsExclude();
|
|
132906
132940
|
var featureType = "Point";
|
|
132907
132941
|
if (!visibleLayers.length) return callback(null, []); //http://resources.esri.com/help/9.3/arcgisserver/apis/rest/identify.html
|
|
132908
132942
|
|
|
@@ -132946,7 +132980,8 @@ var bundle$1 = {
|
|
|
132946
132980
|
cb("Error for ".concat(visibleLayer.displayName));
|
|
132947
132981
|
} else {
|
|
132948
132982
|
try {
|
|
132949
|
-
var data = JSON.parse(body);
|
|
132983
|
+
var data = JSON.parse(body);
|
|
132984
|
+
data = identifyColumnsArcgisrest(data, excludedColumns); //Column Filtering
|
|
132950
132985
|
|
|
132951
132986
|
if (visibleLayer.identifyFields) {
|
|
132952
132987
|
data.results.forEach(function (result) {
|
|
@@ -132956,7 +132991,7 @@ var bundle$1 = {
|
|
|
132956
132991
|
key = _Object$entries$_i[0],
|
|
132957
132992
|
value = _Object$entries$_i[1];
|
|
132958
132993
|
|
|
132959
|
-
var reducedProperties =
|
|
132994
|
+
var reducedProperties = [];
|
|
132960
132995
|
visibleLayer.identifyFields.forEach(function (property) {
|
|
132961
132996
|
if (result.attributes[property]) {
|
|
132962
132997
|
reducedProperties[property] = result.attributes[property];
|
|
@@ -133070,8 +133105,6 @@ var BasemapItem = /*#__PURE__*/function (_React$Component) {
|
|
|
133070
133105
|
_createClass(BasemapItem, [{
|
|
133071
133106
|
key: "render",
|
|
133072
133107
|
value: function render() {
|
|
133073
|
-
var _this2 = this;
|
|
133074
|
-
|
|
133075
133108
|
var _this$props2 = this.props,
|
|
133076
133109
|
active = _this$props2.active,
|
|
133077
133110
|
basemap = _this$props2.basemap,
|
|
@@ -133081,52 +133114,30 @@ var BasemapItem = /*#__PURE__*/function (_React$Component) {
|
|
|
133081
133114
|
tileurl = tileurl.replace("{z}", "12");
|
|
133082
133115
|
tileurl = tileurl.replace("{x}", "1206");
|
|
133083
133116
|
tileurl = tileurl.replace("{y}", "1539");
|
|
133117
|
+
var id = basemapImages.find(function (imageID) {
|
|
133118
|
+
return imageID === basemap.id;
|
|
133119
|
+
});
|
|
133120
|
+
var src = id ? basemap.altImage : tileurl;
|
|
133084
133121
|
var itemClass = classnames(_defineProperty({
|
|
133085
133122
|
"cm-list-group-item": true,
|
|
133086
133123
|
"pointer": true
|
|
133087
133124
|
}, theme, active));
|
|
133088
|
-
|
|
133089
|
-
|
|
133090
|
-
|
|
133091
|
-
|
|
133092
|
-
|
|
133093
|
-
|
|
133094
|
-
|
|
133095
|
-
|
|
133096
|
-
|
|
133097
|
-
|
|
133098
|
-
|
|
133099
|
-
|
|
133100
|
-
|
|
133101
|
-
|
|
133102
|
-
alt: "Basemap tile for ".concat(basemap.name)
|
|
133103
|
-
}), /*#__PURE__*/React$1__default.createElement("span", {
|
|
133104
|
-
style: {
|
|
133105
|
-
marginLeft: '10px'
|
|
133106
|
-
}
|
|
133107
|
-
}, basemap.name)));
|
|
133108
|
-
return false;
|
|
133109
|
-
} else {
|
|
133110
|
-
basemapUI = /*#__PURE__*/React$1__default.createElement("li", {
|
|
133111
|
-
onClick: _this2.handleClick,
|
|
133112
|
-
className: itemClass,
|
|
133113
|
-
title: basemap.name
|
|
133114
|
-
}, /*#__PURE__*/React$1__default.createElement("div", {
|
|
133115
|
-
className: "overflow-ellipsis"
|
|
133116
|
-
}, /*#__PURE__*/React$1__default.createElement("img", {
|
|
133117
|
-
src: tileurl,
|
|
133118
|
-
width: "40",
|
|
133119
|
-
height: "40",
|
|
133120
|
-
alt: "Basemap tile for ".concat(basemap.name)
|
|
133121
|
-
}), /*#__PURE__*/React$1__default.createElement("span", {
|
|
133122
|
-
style: {
|
|
133123
|
-
marginLeft: '10px'
|
|
133124
|
-
}
|
|
133125
|
-
}, basemap.name)));
|
|
133126
|
-
return true;
|
|
133125
|
+
return /*#__PURE__*/React$1__default.createElement("li", {
|
|
133126
|
+
onClick: this.handleClick,
|
|
133127
|
+
className: itemClass,
|
|
133128
|
+
title: basemap.name
|
|
133129
|
+
}, /*#__PURE__*/React$1__default.createElement("div", {
|
|
133130
|
+
className: "overflow-ellipsis"
|
|
133131
|
+
}, /*#__PURE__*/React$1__default.createElement("img", {
|
|
133132
|
+
src: src,
|
|
133133
|
+
width: "40",
|
|
133134
|
+
height: "40",
|
|
133135
|
+
alt: "Basemap tile for ".concat(basemap.name)
|
|
133136
|
+
}), /*#__PURE__*/React$1__default.createElement("span", {
|
|
133137
|
+
style: {
|
|
133138
|
+
marginLeft: '10px'
|
|
133127
133139
|
}
|
|
133128
|
-
});
|
|
133129
|
-
return basemapUI;
|
|
133140
|
+
}, basemap.name)));
|
|
133130
133141
|
}
|
|
133131
133142
|
}]);
|
|
133132
133143
|
|
|
@@ -142205,7 +142216,8 @@ var bundle$6 = {
|
|
|
142205
142216
|
geom: null,
|
|
142206
142217
|
results: [],
|
|
142207
142218
|
selectedFeature: null,
|
|
142208
|
-
selectedLayer: null
|
|
142219
|
+
selectedLayer: null,
|
|
142220
|
+
identifyColumnsExclude: []
|
|
142209
142221
|
};
|
|
142210
142222
|
return function () {
|
|
142211
142223
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialData;
|
|
@@ -142227,6 +142239,7 @@ var bundle$6 = {
|
|
|
142227
142239
|
case "IDENTIFY_UI_BUFFER_UNIT_UPDATED":
|
|
142228
142240
|
case "IDENTIFY_UI_BUFFER_VALUE_UPDATED":
|
|
142229
142241
|
case "IDENTIFY_UI_BUFFER_FEATURE_UPDATED":
|
|
142242
|
+
case "IDENTIFY_EXCLUDED_COLUMNS_SET":
|
|
142230
142243
|
return Object.assign({}, state, payload);
|
|
142231
142244
|
|
|
142232
142245
|
case "IDENTIFY_ERROR":
|
|
@@ -142771,6 +142784,20 @@ var bundle$6 = {
|
|
|
142771
142784
|
store.doModalClose();
|
|
142772
142785
|
};
|
|
142773
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
|
+
},
|
|
142774
142801
|
selectIdentifySelectBy: function selectIdentifySelectBy(state) {
|
|
142775
142802
|
return state.identifyUi.selectBy;
|
|
142776
142803
|
},
|
|
@@ -162698,13 +162725,15 @@ var bundle$e = {
|
|
|
162698
162725
|
var mapLayer = lyr.mapLayer;
|
|
162699
162726
|
var outFeatures = [];
|
|
162700
162727
|
var src = mapLayer.getSource();
|
|
162728
|
+
var excludedColumns = store.selectIdentifyColumnsExclude();
|
|
162701
162729
|
src.forEachFeatureIntersectingExtent(identifyExtent, function (f) {
|
|
162702
162730
|
var geoJsonFeature = geoJSON$3.writeFeatureObject(f, {
|
|
162703
162731
|
featureProjection: "EPSG:3857",
|
|
162704
162732
|
dataProjection: "EPSG:4326"
|
|
162705
162733
|
});
|
|
162706
162734
|
if (!booleanDisjoint(identifyFeature, geoJsonFeature)) outFeatures.push(geoJsonFeature);
|
|
162707
|
-
});
|
|
162735
|
+
});
|
|
162736
|
+
outFeatures = identifyColumnsArcgisvector(outFeatures, excludedColumns); //Column Filtering
|
|
162708
162737
|
|
|
162709
162738
|
if (layers[0].identifyFields) {
|
|
162710
162739
|
outFeatures.forEach(function (feature) {
|
package/lib/prod.js
CHANGED
|
@@ -4487,6 +4487,9 @@ var configBundle = {
|
|
|
4487
4487
|
return b;
|
|
4488
4488
|
});
|
|
4489
4489
|
},
|
|
4490
|
+
selectBasemapImages: function selectBasemapImages(state) {
|
|
4491
|
+
return state.config["default"].basemapImageIDs;
|
|
4492
|
+
},
|
|
4490
4493
|
selectDefaultLayers: function selectDefaultLayers(state) {
|
|
4491
4494
|
return state.config["default"].datasets;
|
|
4492
4495
|
},
|
|
@@ -106465,7 +106468,7 @@ var config = {
|
|
|
106465
106468
|
};
|
|
106466
106469
|
|
|
106467
106470
|
var name = "@corpsmap/corpsmap";
|
|
106468
|
-
var version$1 = "3.2.
|
|
106471
|
+
var version$1 = "3.2.6";
|
|
106469
106472
|
var description = "CorpsMap as React Components";
|
|
106470
106473
|
var main = "index.js";
|
|
106471
106474
|
var scripts = {
|
|
@@ -106619,6 +106622,8 @@ var Map$4 = /*#__PURE__*/function (_React$Component) {
|
|
|
106619
106622
|
theme = _this$props.theme,
|
|
106620
106623
|
themeNavSize = _this$props.themeNavSize,
|
|
106621
106624
|
basemaps = _this$props.basemaps,
|
|
106625
|
+
_this$props$basemapIm = _this$props.basemapImageIDs,
|
|
106626
|
+
basemapImageIDs = _this$props$basemapIm === void 0 ? [] : _this$props$basemapIm,
|
|
106622
106627
|
limitMapExtent = _this$props.limitMapExtent;
|
|
106623
106628
|
cache.getAll().then(function (initialData) {
|
|
106624
106629
|
initialData.config = {
|
|
@@ -106631,6 +106636,8 @@ var Map$4 = /*#__PURE__*/function (_React$Component) {
|
|
|
106631
106636
|
});
|
|
106632
106637
|
}
|
|
106633
106638
|
|
|
106639
|
+
initialData.config["default"].basemapImageIDs = basemapImageIDs;
|
|
106640
|
+
|
|
106634
106641
|
if (height) {
|
|
106635
106642
|
initialData.vLayout = {
|
|
106636
106643
|
height: height,
|
|
@@ -132762,6 +132769,32 @@ var formatArcgisVector = function formatArcgisVector(results) {
|
|
|
132762
132769
|
return results;
|
|
132763
132770
|
};
|
|
132764
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
|
+
|
|
132765
132798
|
function formatUrl(options) {
|
|
132766
132799
|
var url = "".concat(options.root, "/identify?");
|
|
132767
132800
|
var params = [];
|
|
@@ -132817,6 +132850,7 @@ var bundle$1 = {
|
|
|
132817
132850
|
anonGet = _ref3.anonGet;
|
|
132818
132851
|
var coords = store.selectIdentifyCoordinates();
|
|
132819
132852
|
var visibleLayers = store.selectVisibleLayers();
|
|
132853
|
+
var excludedColumns = store.selectIdentifyColumnsExclude();
|
|
132820
132854
|
var featureType = "Point";
|
|
132821
132855
|
if (!visibleLayers.length) return callback(null, []); //http://resources.esri.com/help/9.3/arcgisserver/apis/rest/identify.html
|
|
132822
132856
|
|
|
@@ -132860,7 +132894,8 @@ var bundle$1 = {
|
|
|
132860
132894
|
cb("Error for ".concat(visibleLayer.displayName));
|
|
132861
132895
|
} else {
|
|
132862
132896
|
try {
|
|
132863
|
-
var data = JSON.parse(body);
|
|
132897
|
+
var data = JSON.parse(body);
|
|
132898
|
+
data = identifyColumnsArcgisrest(data, excludedColumns); //Column Filtering
|
|
132864
132899
|
|
|
132865
132900
|
if (visibleLayer.identifyFields) {
|
|
132866
132901
|
data.results.forEach(function (result) {
|
|
@@ -132870,7 +132905,7 @@ var bundle$1 = {
|
|
|
132870
132905
|
key = _Object$entries$_i[0],
|
|
132871
132906
|
value = _Object$entries$_i[1];
|
|
132872
132907
|
|
|
132873
|
-
var reducedProperties =
|
|
132908
|
+
var reducedProperties = [];
|
|
132874
132909
|
visibleLayer.identifyFields.forEach(function (property) {
|
|
132875
132910
|
if (result.attributes[property]) {
|
|
132876
132911
|
reducedProperties[property] = result.attributes[property];
|
|
@@ -132984,8 +133019,6 @@ var BasemapItem = /*#__PURE__*/function (_React$Component) {
|
|
|
132984
133019
|
_createClass(BasemapItem, [{
|
|
132985
133020
|
key: "render",
|
|
132986
133021
|
value: function render() {
|
|
132987
|
-
var _this2 = this;
|
|
132988
|
-
|
|
132989
133022
|
var _this$props2 = this.props,
|
|
132990
133023
|
active = _this$props2.active,
|
|
132991
133024
|
basemap = _this$props2.basemap,
|
|
@@ -132995,52 +133028,30 @@ var BasemapItem = /*#__PURE__*/function (_React$Component) {
|
|
|
132995
133028
|
tileurl = tileurl.replace("{z}", "12");
|
|
132996
133029
|
tileurl = tileurl.replace("{x}", "1206");
|
|
132997
133030
|
tileurl = tileurl.replace("{y}", "1539");
|
|
133031
|
+
var id = basemapImages.find(function (imageID) {
|
|
133032
|
+
return imageID === basemap.id;
|
|
133033
|
+
});
|
|
133034
|
+
var src = id ? basemap.altImage : tileurl;
|
|
132998
133035
|
var itemClass = classnames(_defineProperty({
|
|
132999
133036
|
"cm-list-group-item": true,
|
|
133000
133037
|
"pointer": true
|
|
133001
133038
|
}, theme, active));
|
|
133002
|
-
|
|
133003
|
-
|
|
133004
|
-
|
|
133005
|
-
|
|
133006
|
-
|
|
133007
|
-
|
|
133008
|
-
|
|
133009
|
-
|
|
133010
|
-
|
|
133011
|
-
|
|
133012
|
-
|
|
133013
|
-
|
|
133014
|
-
|
|
133015
|
-
|
|
133016
|
-
alt: "Basemap tile for ".concat(basemap.name)
|
|
133017
|
-
}), /*#__PURE__*/React$1__default.createElement("span", {
|
|
133018
|
-
style: {
|
|
133019
|
-
marginLeft: '10px'
|
|
133020
|
-
}
|
|
133021
|
-
}, basemap.name)));
|
|
133022
|
-
return false;
|
|
133023
|
-
} else {
|
|
133024
|
-
basemapUI = /*#__PURE__*/React$1__default.createElement("li", {
|
|
133025
|
-
onClick: _this2.handleClick,
|
|
133026
|
-
className: itemClass,
|
|
133027
|
-
title: basemap.name
|
|
133028
|
-
}, /*#__PURE__*/React$1__default.createElement("div", {
|
|
133029
|
-
className: "overflow-ellipsis"
|
|
133030
|
-
}, /*#__PURE__*/React$1__default.createElement("img", {
|
|
133031
|
-
src: tileurl,
|
|
133032
|
-
width: "40",
|
|
133033
|
-
height: "40",
|
|
133034
|
-
alt: "Basemap tile for ".concat(basemap.name)
|
|
133035
|
-
}), /*#__PURE__*/React$1__default.createElement("span", {
|
|
133036
|
-
style: {
|
|
133037
|
-
marginLeft: '10px'
|
|
133038
|
-
}
|
|
133039
|
-
}, basemap.name)));
|
|
133040
|
-
return true;
|
|
133039
|
+
return /*#__PURE__*/React$1__default.createElement("li", {
|
|
133040
|
+
onClick: this.handleClick,
|
|
133041
|
+
className: itemClass,
|
|
133042
|
+
title: basemap.name
|
|
133043
|
+
}, /*#__PURE__*/React$1__default.createElement("div", {
|
|
133044
|
+
className: "overflow-ellipsis"
|
|
133045
|
+
}, /*#__PURE__*/React$1__default.createElement("img", {
|
|
133046
|
+
src: src,
|
|
133047
|
+
width: "40",
|
|
133048
|
+
height: "40",
|
|
133049
|
+
alt: "Basemap tile for ".concat(basemap.name)
|
|
133050
|
+
}), /*#__PURE__*/React$1__default.createElement("span", {
|
|
133051
|
+
style: {
|
|
133052
|
+
marginLeft: '10px'
|
|
133041
133053
|
}
|
|
133042
|
-
});
|
|
133043
|
-
return basemapUI;
|
|
133054
|
+
}, basemap.name)));
|
|
133044
133055
|
}
|
|
133045
133056
|
}]);
|
|
133046
133057
|
|
|
@@ -142119,7 +142130,8 @@ var bundle$6 = {
|
|
|
142119
142130
|
geom: null,
|
|
142120
142131
|
results: [],
|
|
142121
142132
|
selectedFeature: null,
|
|
142122
|
-
selectedLayer: null
|
|
142133
|
+
selectedLayer: null,
|
|
142134
|
+
identifyColumnsExclude: []
|
|
142123
142135
|
};
|
|
142124
142136
|
return function () {
|
|
142125
142137
|
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialData;
|
|
@@ -142141,6 +142153,7 @@ var bundle$6 = {
|
|
|
142141
142153
|
case "IDENTIFY_UI_BUFFER_UNIT_UPDATED":
|
|
142142
142154
|
case "IDENTIFY_UI_BUFFER_VALUE_UPDATED":
|
|
142143
142155
|
case "IDENTIFY_UI_BUFFER_FEATURE_UPDATED":
|
|
142156
|
+
case "IDENTIFY_EXCLUDED_COLUMNS_SET":
|
|
142144
142157
|
return Object.assign({}, state, payload);
|
|
142145
142158
|
|
|
142146
142159
|
case "IDENTIFY_ERROR":
|
|
@@ -142685,6 +142698,20 @@ var bundle$6 = {
|
|
|
142685
142698
|
store.doModalClose();
|
|
142686
142699
|
};
|
|
142687
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
|
+
},
|
|
142688
142715
|
selectIdentifySelectBy: function selectIdentifySelectBy(state) {
|
|
142689
142716
|
return state.identifyUi.selectBy;
|
|
142690
142717
|
},
|
|
@@ -162612,13 +162639,15 @@ var bundle$e = {
|
|
|
162612
162639
|
var mapLayer = lyr.mapLayer;
|
|
162613
162640
|
var outFeatures = [];
|
|
162614
162641
|
var src = mapLayer.getSource();
|
|
162642
|
+
var excludedColumns = store.selectIdentifyColumnsExclude();
|
|
162615
162643
|
src.forEachFeatureIntersectingExtent(identifyExtent, function (f) {
|
|
162616
162644
|
var geoJsonFeature = geoJSON$3.writeFeatureObject(f, {
|
|
162617
162645
|
featureProjection: "EPSG:3857",
|
|
162618
162646
|
dataProjection: "EPSG:4326"
|
|
162619
162647
|
});
|
|
162620
162648
|
if (!booleanDisjoint(identifyFeature, geoJsonFeature)) outFeatures.push(geoJsonFeature);
|
|
162621
|
-
});
|
|
162649
|
+
});
|
|
162650
|
+
outFeatures = identifyColumnsArcgisvector(outFeatures, excludedColumns); //Column Filtering
|
|
162622
162651
|
|
|
162623
162652
|
if (layers[0].identifyFields) {
|
|
162624
162653
|
outFeatures.forEach(function (feature) {
|
package/package.json
CHANGED
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
export default {
|
|
3
|
-
name: 'config',
|
|
4
|
-
|
|
5
|
-
getReducer(){
|
|
6
|
-
const initialData = {
|
|
7
|
-
default:{}
|
|
8
|
-
}
|
|
9
|
-
return (state = initialData, { type, payload }) => {
|
|
10
|
-
return state;
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
selectDefaultConfig: (state) => {
|
|
15
|
-
return state.config.default;
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
selectBasemapList: (state) => {
|
|
19
|
-
return state.config.default.basemaps.map((b) => {
|
|
20
|
-
if(b.url.indexOf('{accessToken}') !== -1) b.url = b.url.replace(/{accessToken}/ig, b.accessToken || '');
|
|
21
|
-
if(b.url.indexOf('{s}') !== -1) b.url = b.url.replace(/{s}/ig, b.accessToken || '{a-c}');
|
|
22
|
-
return b;
|
|
23
|
-
});
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return state.config.default.
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return state.config.default.
|
|
32
|
-
}
|
|
33
|
-
|
|
1
|
+
|
|
2
|
+
export default {
|
|
3
|
+
name: 'config',
|
|
4
|
+
|
|
5
|
+
getReducer(){
|
|
6
|
+
const initialData = {
|
|
7
|
+
default:{}
|
|
8
|
+
}
|
|
9
|
+
return (state = initialData, { type, payload }) => {
|
|
10
|
+
return state;
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
selectDefaultConfig: (state) => {
|
|
15
|
+
return state.config.default;
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
selectBasemapList: (state) => {
|
|
19
|
+
return state.config.default.basemaps.map((b) => {
|
|
20
|
+
if(b.url.indexOf('{accessToken}') !== -1) b.url = b.url.replace(/{accessToken}/ig, b.accessToken || '');
|
|
21
|
+
if(b.url.indexOf('{s}') !== -1) b.url = b.url.replace(/{s}/ig, b.accessToken || '{a-c}');
|
|
22
|
+
return b;
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
selectBasemapImages: (state) => {
|
|
27
|
+
return state.config.default.basemapImageIDs;
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
selectDefaultLayers: (state) => {
|
|
31
|
+
return state.config.default.datasets;
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
selectLimitMapExtent: (state) => {
|
|
35
|
+
return state.config.default.limitMapExtent;
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
}
|
|
@@ -38,6 +38,7 @@ class Map extends React.Component {
|
|
|
38
38
|
theme,
|
|
39
39
|
themeNavSize,
|
|
40
40
|
basemaps,
|
|
41
|
+
basemapImageIDs = [],
|
|
41
42
|
limitMapExtent,
|
|
42
43
|
} = this.props;
|
|
43
44
|
|
|
@@ -51,6 +52,8 @@ class Map extends React.Component {
|
|
|
51
52
|
initialData.config.default.basemaps.push(basemap);
|
|
52
53
|
});
|
|
53
54
|
}
|
|
55
|
+
|
|
56
|
+
initialData.config.default.basemapImageIDs = basemapImageIDs;
|
|
54
57
|
|
|
55
58
|
if (height) {
|
|
56
59
|
initialData.vLayout = {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { connect } from 'redux-bundler-react';
|
|
3
|
+
import classnames from "classnames";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class BasemapItem extends React.Component {
|
|
7
|
+
handleClick = () => {
|
|
8
|
+
const { idx, doChangeBasemap } = this.props;
|
|
9
|
+
doChangeBasemap(idx);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
render() {
|
|
13
|
+
const { active, basemap, basemapImages, theme } = this.props;
|
|
14
|
+
let tileurl = basemap.url.replace(/{[a-z]-[a-z]}/gi, "a");
|
|
15
|
+
tileurl = tileurl.replace("{z}", "12");
|
|
16
|
+
tileurl = tileurl.replace("{x}", "1206");
|
|
17
|
+
tileurl = tileurl.replace("{y}", "1539");
|
|
18
|
+
|
|
19
|
+
const itemClass = classnames({
|
|
20
|
+
"cm-list-group-item": true,
|
|
21
|
+
"pointer": true,
|
|
22
|
+
[theme]: active
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
let basemapUI = null;
|
|
26
|
+
//looking to set src.
|
|
27
|
+
basemapImages.every((imageID) =>{
|
|
28
|
+
if( basemap.id === imageID){
|
|
29
|
+
console.log(basemap.id)
|
|
30
|
+
basemapUI =
|
|
31
|
+
(<li onClick={this.handleClick} className={itemClass} title={basemap.name}>
|
|
32
|
+
<div className="overflow-ellipsis">
|
|
33
|
+
<img src={basemap.altImage} width="40" height="40" alt={`Basemap tile for ${basemap.name}`} />
|
|
34
|
+
<span style={{marginLeft:'10px'}}>{basemap.name}</span>
|
|
35
|
+
</div>
|
|
36
|
+
</li>)
|
|
37
|
+
return false
|
|
38
|
+
}else{
|
|
39
|
+
basemapUI = (
|
|
40
|
+
<li onClick={this.handleClick} className={itemClass} title={basemap.name}>
|
|
41
|
+
<div className="overflow-ellipsis">
|
|
42
|
+
<img src={tileurl} width="40" height="40" alt={`Basemap tile for ${basemap.name}`} />
|
|
43
|
+
<span style={{marginLeft:'10px'}}>{basemap.name}</span>
|
|
44
|
+
</div>
|
|
45
|
+
</li>
|
|
46
|
+
);
|
|
47
|
+
return true
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
return basemapUI
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default connect(
|
|
55
|
+
'selectTheme',
|
|
56
|
+
'doChangeBasemap',
|
|
57
|
+
'selectBasemapImages',
|
|
58
|
+
BasemapItem
|
|
59
|
+
);
|
|
@@ -10,43 +10,30 @@ class BasemapItem extends React.Component {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
render() {
|
|
13
|
-
const { active, basemap,basemapImages, theme } = this.props;
|
|
14
|
-
|
|
13
|
+
const { active, basemap, basemapImages, theme } = this.props;
|
|
15
14
|
let tileurl = basemap.url.replace(/{[a-z]-[a-z]}/gi, "a");
|
|
16
15
|
tileurl = tileurl.replace("{z}", "12");
|
|
17
16
|
tileurl = tileurl.replace("{x}", "1206");
|
|
18
17
|
tileurl = tileurl.replace("{y}", "1539");
|
|
19
18
|
|
|
19
|
+
let id = basemapImages.find(imageID => imageID === basemap.id);
|
|
20
|
+
let src = id ? basemap.altImage : tileurl;
|
|
21
|
+
|
|
20
22
|
const itemClass = classnames({
|
|
21
23
|
"cm-list-group-item": true,
|
|
22
24
|
"pointer": true,
|
|
23
25
|
[theme]: active
|
|
24
26
|
})
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
console.log(basemap.id)
|
|
29
|
-
basemapUI =
|
|
30
|
-
(<li onClick={this.handleClick} className={itemClass} title={basemap.name}>
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<li onClick={this.handleClick} className={itemClass} title={basemap.name}>
|
|
31
30
|
<div className="overflow-ellipsis">
|
|
32
|
-
<img src={
|
|
31
|
+
<img src={src} width="40" height="40" alt={`Basemap tile for ${basemap.name}`} />
|
|
33
32
|
<span style={{marginLeft:'10px'}}>{basemap.name}</span>
|
|
34
33
|
</div>
|
|
35
|
-
</li>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
basemapUI = (
|
|
39
|
-
<li onClick={this.handleClick} className={itemClass} title={basemap.name}>
|
|
40
|
-
<div className="overflow-ellipsis">
|
|
41
|
-
<img src={tileurl} width="40" height="40" alt={`Basemap tile for ${basemap.name}`} />
|
|
42
|
-
<span style={{marginLeft:'10px'}}>{basemap.name}</span>
|
|
43
|
-
</div>
|
|
44
|
-
</li>
|
|
45
|
-
);
|
|
46
|
-
return true
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return basemapUI
|
|
34
|
+
</li>
|
|
35
|
+
);
|
|
36
|
+
|
|
50
37
|
}
|
|
51
38
|
}
|
|
52
39
|
|
|
@@ -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 };
|