@corpsmap/corpsmap 3.1.10 → 3.1.11

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 CHANGED
@@ -79454,6 +79454,7 @@ var createNode$1 = function createNode(options, map) {
79454
79454
  info: options.info,
79455
79455
  identifyType: options.identifyType,
79456
79456
  identifyFields: options.identifyFields,
79457
+ identifyRenameColums: options.identifyRenameColums,
79457
79458
  legend: options.legend,
79458
79459
  passFilter: true,
79459
79460
  zoomTo: !!options.zoomTo,
@@ -106531,7 +106532,7 @@ var config = {
106531
106532
  };
106532
106533
 
106533
106534
  var name = "@corpsmap/corpsmap";
106534
- var version$1 = "3.1.10";
106535
+ var version$1 = "3.1.11";
106535
106536
  var description = "CorpsMap as React Components";
106536
106537
  var main = "index.js";
106537
106538
  var scripts = {
@@ -132926,7 +132927,56 @@ var bundle$1 = {
132926
132927
  cb("Error for ".concat(visibleLayer.displayName));
132927
132928
  } else {
132928
132929
  try {
132929
- var data = JSON.parse(body);
132930
+ var data = JSON.parse(body); //Column Filtering
132931
+
132932
+ if (visibleLayer.identifyFields) {
132933
+ data.results.forEach(function (result) {
132934
+ if (result.attributes) {
132935
+ var _loop = function _loop() {
132936
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
132937
+ key = _Object$entries$_i[0],
132938
+ value = _Object$entries$_i[1];
132939
+
132940
+ var reducedProperties = {};
132941
+ visibleLayer.identifyFields.forEach(function (property) {
132942
+ if (result.attributes[property]) {
132943
+ reducedProperties[property] = result.attributes[property];
132944
+ }
132945
+ });
132946
+ result.attributes = reducedProperties;
132947
+ };
132948
+
132949
+ for (var _i = 0, _Object$entries = Object.entries(result.attributes); _i < _Object$entries.length; _i++) {
132950
+ _loop();
132951
+ }
132952
+ }
132953
+ });
132954
+ } // Column Renaming
132955
+
132956
+
132957
+ if (visibleLayer.identifyRenameColums) {
132958
+ data.results.forEach(function (result) {
132959
+ if (result.attributes) {
132960
+ for (var _i2 = 0, _Object$entries2 = Object.entries(result.attributes); _i2 < _Object$entries2.length; _i2++) {
132961
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
132962
+ featureKey = _Object$entries2$_i[0],
132963
+ featureValue = _Object$entries2$_i[1];
132964
+
132965
+ for (var _i3 = 0, _Object$entries3 = Object.entries(visibleLayer.identifyRenameColums); _i3 < _Object$entries3.length; _i3++) {
132966
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
132967
+ key = _Object$entries3$_i[0],
132968
+ value = _Object$entries3$_i[1];
132969
+
132970
+ if (featureKey === key) {
132971
+ result.attributes[value] = result.attributes[featureKey];
132972
+ delete result.attributes[featureKey];
132973
+ }
132974
+ }
132975
+ }
132976
+ }
132977
+ });
132978
+ }
132979
+
132930
132980
  cb(null, {
132931
132981
  dataset: visibleLayer.uid,
132932
132982
  layerName: visibleLayer.displayName,
@@ -132946,7 +132996,7 @@ var bundle$1 = {
132946
132996
  })
132947
132997
  });
132948
132998
  } catch (err) {
132949
- cb("Error for ".concat(visibleLayer.displayName));
132999
+ cb("Error for ".concat(visibleLayer.displayName), err);
132950
133000
  }
132951
133001
  }
132952
133002
  });
@@ -142186,6 +142236,13 @@ var bundle$6 = {
142186
142236
  return function (_ref4) {
142187
142237
  var dispatch = _ref4.dispatch,
142188
142238
  store = _ref4.store;
142239
+ var map = store.selectMap(); // https://jira.il2.dso.mil/browse/CWBI-16638
142240
+
142241
+ map.interactions.array_.forEach(function (mapItem) {
142242
+ if (mapItem.ol_uid == "43") {
142243
+ mapItem.values_.active = false;
142244
+ }
142245
+ });
142189
142246
  e.preventDefault();
142190
142247
  e.stopPropagation();
142191
142248
  var selectBy = e.currentTarget.dataset.selectby;
@@ -142386,7 +142443,13 @@ var bundle$6 = {
142386
142443
  } // close identify menu
142387
142444
 
142388
142445
 
142389
- store.doBasicToolbarDeactivate();
142446
+ store.doBasicToolbarDeactivate(); // https://jira.il2.dso.mil/browse/CWBI-16638
142447
+
142448
+ map.interactions.array_.forEach(function (mapItem) {
142449
+ if (mapItem.ol_uid == "43") {
142450
+ mapItem.values_.active = true;
142451
+ }
142452
+ });
142390
142453
  dispatch({
142391
142454
  type: "IDENTIFY_UI_STOPPED",
142392
142455
  payload: {
@@ -162591,7 +162654,56 @@ var bundle$e = {
162591
162654
  dataProjection: "EPSG:4326"
162592
162655
  });
162593
162656
  if (!booleanDisjoint(identifyFeature, geoJsonFeature)) outFeatures.push(geoJsonFeature);
162594
- });
162657
+ }); //Column Filtering
162658
+
162659
+ if (layers[0].identifyFields) {
162660
+ outFeatures.forEach(function (feature) {
162661
+ if (feature.properties) {
162662
+ var _loop = function _loop() {
162663
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
162664
+ key = _Object$entries$_i[0],
162665
+ value = _Object$entries$_i[1];
162666
+
162667
+ var reducedProperties = {};
162668
+ layers[0].identifyFields.forEach(function (property) {
162669
+ if (feature.properties[property]) {
162670
+ reducedProperties[property] = feature.properties[property];
162671
+ }
162672
+ });
162673
+ feature.properties = reducedProperties;
162674
+ };
162675
+
162676
+ for (var _i = 0, _Object$entries = Object.entries(feature.properties); _i < _Object$entries.length; _i++) {
162677
+ _loop();
162678
+ }
162679
+ }
162680
+ });
162681
+ } //Column Renaming
162682
+
162683
+
162684
+ if (layers[0].identifyRenameColums) {
162685
+ outFeatures.forEach(function (feature) {
162686
+ if (feature.properties) {
162687
+ for (var _i2 = 0, _Object$entries2 = Object.entries(feature.properties); _i2 < _Object$entries2.length; _i2++) {
162688
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
162689
+ featureKey = _Object$entries2$_i[0],
162690
+ featureValue = _Object$entries2$_i[1];
162691
+
162692
+ for (var _i3 = 0, _Object$entries3 = Object.entries(layers[0].identifyRenameColums); _i3 < _Object$entries3.length; _i3++) {
162693
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
162694
+ key = _Object$entries3$_i[0],
162695
+ value = _Object$entries3$_i[1];
162696
+
162697
+ if (featureKey === key) {
162698
+ feature.properties[value] = feature.properties[featureKey];
162699
+ delete feature.properties[featureKey];
162700
+ }
162701
+ }
162702
+ }
162703
+ }
162704
+ });
162705
+ }
162706
+
162595
162707
  out.push({
162596
162708
  dataset: lyr.uid,
162597
162709
  layerName: lyr.displayName,
package/lib/prod.js CHANGED
@@ -79368,6 +79368,7 @@ var createNode$1 = function createNode(options, map) {
79368
79368
  info: options.info,
79369
79369
  identifyType: options.identifyType,
79370
79370
  identifyFields: options.identifyFields,
79371
+ identifyRenameColums: options.identifyRenameColums,
79371
79372
  legend: options.legend,
79372
79373
  passFilter: true,
79373
79374
  zoomTo: !!options.zoomTo,
@@ -106445,7 +106446,7 @@ var config = {
106445
106446
  };
106446
106447
 
106447
106448
  var name = "@corpsmap/corpsmap";
106448
- var version$1 = "3.1.10";
106449
+ var version$1 = "3.1.11";
106449
106450
  var description = "CorpsMap as React Components";
106450
106451
  var main = "index.js";
106451
106452
  var scripts = {
@@ -132840,7 +132841,56 @@ var bundle$1 = {
132840
132841
  cb("Error for ".concat(visibleLayer.displayName));
132841
132842
  } else {
132842
132843
  try {
132843
- var data = JSON.parse(body);
132844
+ var data = JSON.parse(body); //Column Filtering
132845
+
132846
+ if (visibleLayer.identifyFields) {
132847
+ data.results.forEach(function (result) {
132848
+ if (result.attributes) {
132849
+ var _loop = function _loop() {
132850
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
132851
+ key = _Object$entries$_i[0],
132852
+ value = _Object$entries$_i[1];
132853
+
132854
+ var reducedProperties = {};
132855
+ visibleLayer.identifyFields.forEach(function (property) {
132856
+ if (result.attributes[property]) {
132857
+ reducedProperties[property] = result.attributes[property];
132858
+ }
132859
+ });
132860
+ result.attributes = reducedProperties;
132861
+ };
132862
+
132863
+ for (var _i = 0, _Object$entries = Object.entries(result.attributes); _i < _Object$entries.length; _i++) {
132864
+ _loop();
132865
+ }
132866
+ }
132867
+ });
132868
+ } // Column Renaming
132869
+
132870
+
132871
+ if (visibleLayer.identifyRenameColums) {
132872
+ data.results.forEach(function (result) {
132873
+ if (result.attributes) {
132874
+ for (var _i2 = 0, _Object$entries2 = Object.entries(result.attributes); _i2 < _Object$entries2.length; _i2++) {
132875
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
132876
+ featureKey = _Object$entries2$_i[0],
132877
+ featureValue = _Object$entries2$_i[1];
132878
+
132879
+ for (var _i3 = 0, _Object$entries3 = Object.entries(visibleLayer.identifyRenameColums); _i3 < _Object$entries3.length; _i3++) {
132880
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
132881
+ key = _Object$entries3$_i[0],
132882
+ value = _Object$entries3$_i[1];
132883
+
132884
+ if (featureKey === key) {
132885
+ result.attributes[value] = result.attributes[featureKey];
132886
+ delete result.attributes[featureKey];
132887
+ }
132888
+ }
132889
+ }
132890
+ }
132891
+ });
132892
+ }
132893
+
132844
132894
  cb(null, {
132845
132895
  dataset: visibleLayer.uid,
132846
132896
  layerName: visibleLayer.displayName,
@@ -132860,7 +132910,7 @@ var bundle$1 = {
132860
132910
  })
132861
132911
  });
132862
132912
  } catch (err) {
132863
- cb("Error for ".concat(visibleLayer.displayName));
132913
+ cb("Error for ".concat(visibleLayer.displayName), err);
132864
132914
  }
132865
132915
  }
132866
132916
  });
@@ -142100,6 +142150,13 @@ var bundle$6 = {
142100
142150
  return function (_ref4) {
142101
142151
  var dispatch = _ref4.dispatch,
142102
142152
  store = _ref4.store;
142153
+ var map = store.selectMap(); // https://jira.il2.dso.mil/browse/CWBI-16638
142154
+
142155
+ map.interactions.array_.forEach(function (mapItem) {
142156
+ if (mapItem.ol_uid == "43") {
142157
+ mapItem.values_.active = false;
142158
+ }
142159
+ });
142103
142160
  e.preventDefault();
142104
142161
  e.stopPropagation();
142105
142162
  var selectBy = e.currentTarget.dataset.selectby;
@@ -142300,7 +142357,13 @@ var bundle$6 = {
142300
142357
  } // close identify menu
142301
142358
 
142302
142359
 
142303
- store.doBasicToolbarDeactivate();
142360
+ store.doBasicToolbarDeactivate(); // https://jira.il2.dso.mil/browse/CWBI-16638
142361
+
142362
+ map.interactions.array_.forEach(function (mapItem) {
142363
+ if (mapItem.ol_uid == "43") {
142364
+ mapItem.values_.active = true;
142365
+ }
142366
+ });
142304
142367
  dispatch({
142305
142368
  type: "IDENTIFY_UI_STOPPED",
142306
142369
  payload: {
@@ -162505,7 +162568,56 @@ var bundle$e = {
162505
162568
  dataProjection: "EPSG:4326"
162506
162569
  });
162507
162570
  if (!booleanDisjoint(identifyFeature, geoJsonFeature)) outFeatures.push(geoJsonFeature);
162508
- });
162571
+ }); //Column Filtering
162572
+
162573
+ if (layers[0].identifyFields) {
162574
+ outFeatures.forEach(function (feature) {
162575
+ if (feature.properties) {
162576
+ var _loop = function _loop() {
162577
+ var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
162578
+ key = _Object$entries$_i[0],
162579
+ value = _Object$entries$_i[1];
162580
+
162581
+ var reducedProperties = {};
162582
+ layers[0].identifyFields.forEach(function (property) {
162583
+ if (feature.properties[property]) {
162584
+ reducedProperties[property] = feature.properties[property];
162585
+ }
162586
+ });
162587
+ feature.properties = reducedProperties;
162588
+ };
162589
+
162590
+ for (var _i = 0, _Object$entries = Object.entries(feature.properties); _i < _Object$entries.length; _i++) {
162591
+ _loop();
162592
+ }
162593
+ }
162594
+ });
162595
+ } //Column Renaming
162596
+
162597
+
162598
+ if (layers[0].identifyRenameColums) {
162599
+ outFeatures.forEach(function (feature) {
162600
+ if (feature.properties) {
162601
+ for (var _i2 = 0, _Object$entries2 = Object.entries(feature.properties); _i2 < _Object$entries2.length; _i2++) {
162602
+ var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i2], 2),
162603
+ featureKey = _Object$entries2$_i[0],
162604
+ featureValue = _Object$entries2$_i[1];
162605
+
162606
+ for (var _i3 = 0, _Object$entries3 = Object.entries(layers[0].identifyRenameColums); _i3 < _Object$entries3.length; _i3++) {
162607
+ var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i3], 2),
162608
+ key = _Object$entries3$_i[0],
162609
+ value = _Object$entries3$_i[1];
162610
+
162611
+ if (featureKey === key) {
162612
+ feature.properties[value] = feature.properties[featureKey];
162613
+ delete feature.properties[featureKey];
162614
+ }
162615
+ }
162616
+ }
162617
+ }
162618
+ });
162619
+ }
162620
+
162509
162621
  out.push({
162510
162622
  dataset: lyr.uid,
162511
162623
  layerName: lyr.displayName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpsmap/corpsmap",
3
- "version": "3.1.10",
3
+ "version": "3.1.11",
4
4
  "description": "CorpsMap as React Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -41,6 +41,7 @@ const createNode = (options, map) => {
41
41
  info: options.info,
42
42
  identifyType: options.identifyType,
43
43
  identifyFields: options.identifyFields,
44
+ identifyRenameColums: options.identifyRenameColums,
44
45
  legend: options.legend,
45
46
  passFilter: true,
46
47
  zoomTo: !!options.zoomTo,
@@ -184,6 +184,13 @@ export default {
184
184
  doStartIdentify:
185
185
  (e) =>
186
186
  ({ dispatch, store }) => {
187
+ const map = store.selectMap();
188
+ // https://jira.il2.dso.mil/browse/CWBI-16638
189
+ map.interactions.array_.forEach((mapItem) =>{
190
+ if (mapItem.ol_uid == "43" ){
191
+ mapItem.values_.active = false
192
+ }
193
+ });
187
194
  e.preventDefault();
188
195
  e.stopPropagation();
189
196
  const selectBy = e.currentTarget.dataset.selectby;
@@ -373,6 +380,13 @@ export default {
373
380
  // close identify menu
374
381
  store.doBasicToolbarDeactivate();
375
382
 
383
+ // https://jira.il2.dso.mil/browse/CWBI-16638
384
+ map.interactions.array_.forEach((mapItem) =>{
385
+ if (mapItem.ol_uid == "43" ){
386
+ mapItem.values_.active = true
387
+ }
388
+ });
389
+
376
390
  dispatch({ type: "IDENTIFY_UI_STOPPED", payload: { selectBy: null } });
377
391
  },
378
392
 
@@ -1,5 +1,5 @@
1
1
  import async from "async";
2
- import { formatArcgisrest } from "../../openlayers-utils/format-utilities";
2
+ import { formatArcgisrest} from "../../openlayers-utils/format-utilities";
3
3
 
4
4
  function formatUrl(options) {
5
5
  let url = `${options.root}/identify?`;
@@ -91,8 +91,40 @@ export default {
91
91
  cb(`Error for ${visibleLayer.displayName}`);
92
92
  } else {
93
93
  try {
94
- const data = JSON.parse(body);
95
- cb(null, {
94
+ const data = JSON.parse(body);
95
+ //Column Filtering
96
+ if (visibleLayer.identifyFields) {
97
+ data.results.forEach((result) => {
98
+ if(result.attributes){
99
+ for (const [key, value] of Object.entries(result.attributes)) {
100
+ let reducedProperties = {};
101
+ visibleLayer.identifyFields.forEach((property) => {
102
+ if (result.attributes[property]) {
103
+ reducedProperties[property] =
104
+ result.attributes[property];
105
+ }
106
+ });
107
+ result.attributes = reducedProperties;
108
+ }
109
+ }
110
+ })
111
+ }
112
+ // Column Renaming
113
+ if (visibleLayer.identifyRenameColums) {
114
+ data.results.forEach((result) => {
115
+ if(result.attributes){
116
+ for (const [featureKey, featureValue] of Object.entries(result.attributes)) {
117
+ for (const [key, value] of Object.entries(visibleLayer.identifyRenameColums)){
118
+ if (featureKey === key) {
119
+ result.attributes[value] = result.attributes[featureKey];
120
+ delete result.attributes[featureKey];
121
+ }
122
+ }
123
+ }
124
+ }
125
+ })
126
+ }
127
+ cb(null, {
96
128
  dataset: visibleLayer.uid,
97
129
  layerName: visibleLayer.displayName,
98
130
  err: null,
@@ -113,7 +145,8 @@ export default {
113
145
  },
114
146
  });
115
147
  } catch (err) {
116
- cb(`Error for ${visibleLayer.displayName}`);
148
+
149
+ cb(`Error for ${visibleLayer.displayName}`,err);
117
150
  }
118
151
  }
119
152
  });
@@ -77,7 +77,38 @@ export default {
77
77
  if (!disjoint(identifyFeature, geoJsonFeature))
78
78
  outFeatures.push(geoJsonFeature);
79
79
  });
80
-
80
+ //Column Filtering
81
+ if (layers[0].identifyFields) {
82
+ outFeatures.forEach((feature) => {
83
+ if(feature.properties){
84
+ for (const [key, value] of Object.entries(feature.properties)) {
85
+ let reducedProperties = {};
86
+ layers[0].identifyFields.forEach((property) => {
87
+ if (feature.properties[property]) {
88
+ reducedProperties[property] =
89
+ feature.properties[property];
90
+ }
91
+ });
92
+ feature.properties = reducedProperties;
93
+ }
94
+ }
95
+ })
96
+ }
97
+ //Column Renaming
98
+ if (layers[0].identifyRenameColums) {
99
+ outFeatures.forEach((feature) => {
100
+ if(feature.properties){
101
+ for (const [featureKey, featureValue] of Object.entries(feature.properties)) {
102
+ for (const [key, value] of Object.entries(layers[0].identifyRenameColums)){
103
+ if (featureKey === key) {
104
+ feature.properties[value] = feature.properties[featureKey];
105
+ delete feature.properties[featureKey];
106
+ }
107
+ }
108
+ }
109
+ }
110
+ })
111
+ }
81
112
  out.push({
82
113
  dataset: lyr.uid,
83
114
  layerName: lyr.displayName,