@corpsmap/corpsmap 3.2.36 → 3.2.39
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 +91 -26
- package/lib/prod.js +91 -26
- package/package.json +1 -1
- package/src/config/default-config.js +25 -25
- package/src/core-plugins/legend/bundle.js +65 -2
- package/src/openlayers-utils/format-utilities.js +141 -138
package/lib/dev.js
CHANGED
|
@@ -106247,27 +106247,32 @@ var config = {
|
|
|
106247
106247
|
subdomains: "abcd",
|
|
106248
106248
|
accessToken: mapboxToken,
|
|
106249
106249
|
visible: false
|
|
106250
|
-
}, {
|
|
106251
|
-
|
|
106252
|
-
|
|
106253
|
-
|
|
106254
|
-
|
|
106255
|
-
|
|
106256
|
-
|
|
106257
|
-
|
|
106258
|
-
|
|
106259
|
-
|
|
106260
|
-
|
|
106261
|
-
|
|
106262
|
-
|
|
106263
|
-
|
|
106264
|
-
|
|
106265
|
-
|
|
106266
|
-
|
|
106267
|
-
|
|
106268
|
-
|
|
106269
|
-
|
|
106270
|
-
|
|
106250
|
+
}, // {
|
|
106251
|
+
// id: "StamenToner",
|
|
106252
|
+
// name: "Stamen Toner",
|
|
106253
|
+
// url: "https://stamen-tiles-{a-d}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png",
|
|
106254
|
+
// attributions:
|
|
106255
|
+
// 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
|
106256
|
+
// subdomains: "abcd",
|
|
106257
|
+
// minZoom: 0,
|
|
106258
|
+
// maxZoom: 20,
|
|
106259
|
+
// ext: "png",
|
|
106260
|
+
// visible: false
|
|
106261
|
+
// },
|
|
106262
|
+
// {
|
|
106263
|
+
// id: "StamenWatercolor",
|
|
106264
|
+
// name: "Stamen Watercolor",
|
|
106265
|
+
// url:
|
|
106266
|
+
// "https://stamen-tiles-{a-d}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg",
|
|
106267
|
+
// attributions:
|
|
106268
|
+
// 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
|
106269
|
+
// subdomains: "abcd",
|
|
106270
|
+
// minZoom: 1,
|
|
106271
|
+
// maxZoom: 16,
|
|
106272
|
+
// ext: "png",
|
|
106273
|
+
// visible: false
|
|
106274
|
+
// },
|
|
106275
|
+
{
|
|
106271
106276
|
id: "EsriWorldStreetMap",
|
|
106272
106277
|
name: "ESRI Streetmap",
|
|
106273
106278
|
url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",
|
|
@@ -106568,7 +106573,7 @@ var config = {
|
|
|
106568
106573
|
};
|
|
106569
106574
|
|
|
106570
106575
|
var name = "@corpsmap/corpsmap";
|
|
106571
|
-
var version$1 = "3.2.
|
|
106576
|
+
var version$1 = "3.2.39";
|
|
106572
106577
|
var description = "CorpsMap as React Components";
|
|
106573
106578
|
var main = "index.js";
|
|
106574
106579
|
var scripts = {
|
|
@@ -132987,6 +132992,10 @@ var formatColumns = function formatColumns(value, formatType) {
|
|
|
132987
132992
|
}
|
|
132988
132993
|
|
|
132989
132994
|
if (formatType === "UNIXDATE") {
|
|
132995
|
+
if (value === null || value === "null") {
|
|
132996
|
+
return null;
|
|
132997
|
+
}
|
|
132998
|
+
|
|
132990
132999
|
var unixTimestamp = value;
|
|
132991
133000
|
var milliseconds = unixTimestamp; // * 1000 in some cases.
|
|
132992
133001
|
|
|
@@ -159417,6 +159426,7 @@ var bundle$8 = {
|
|
|
159417
159426
|
break;
|
|
159418
159427
|
|
|
159419
159428
|
case "EsriFeatureService":
|
|
159429
|
+
// debugger
|
|
159420
159430
|
if (legendOverride === true) {
|
|
159421
159431
|
src = "".concat(src, "/legend?f=pjson");
|
|
159422
159432
|
} else {
|
|
@@ -159449,6 +159459,7 @@ var bundle$8 = {
|
|
|
159449
159459
|
if (legendOverride === true) {
|
|
159450
159460
|
store.doGenerateArcImages(data, lyr);
|
|
159451
159461
|
} else {
|
|
159462
|
+
// debugger
|
|
159452
159463
|
store.doGenerateEsriImages(data, lyr);
|
|
159453
159464
|
}
|
|
159454
159465
|
} else {
|
|
@@ -159571,6 +159582,7 @@ var bundle$8 = {
|
|
|
159571
159582
|
switch (data.geometryType) {
|
|
159572
159583
|
case "esriGeometryPolygon":
|
|
159573
159584
|
if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSFS" && drawingInfo.renderer.symbol.style === "esriSFSSolid") {
|
|
159585
|
+
// debugger
|
|
159574
159586
|
var img = new Image();
|
|
159575
159587
|
var outlineColor = drawingInfo.renderer.symbol.outline.color;
|
|
159576
159588
|
var fillColor = drawingInfo.renderer.symbol.color;
|
|
@@ -159669,10 +159681,15 @@ var bundle$8 = {
|
|
|
159669
159681
|
});
|
|
159670
159682
|
} //____________________________________________________________________________________________________________________________________
|
|
159671
159683
|
else if (drawingInfo.renderer.type === "uniqueValue" && drawingInfo.renderer.uniqueValueInfos) {
|
|
159684
|
+
// Compare
|
|
159672
159685
|
drawingInfo.renderer.uniqueValueInfos.forEach(function (val) {
|
|
159673
159686
|
var img = new Image();
|
|
159674
|
-
|
|
159687
|
+
console.log(val.value);
|
|
159688
|
+
|
|
159689
|
+
if (val.value === 'BOEM') ;
|
|
159690
|
+
|
|
159675
159691
|
var fillColor = val.symbol.color;
|
|
159692
|
+
var outlineColor = val.symbol.outline && val.symbol.outline.color ? val.symbol.outline.color : fillColor;
|
|
159676
159693
|
var canvas = document.createElement("canvas");
|
|
159677
159694
|
var ctx = canvas.getContext("2d");
|
|
159678
159695
|
var labelWidth = Number(ctx.measureText(val.label).width); //set canvas width & height
|
|
@@ -159815,6 +159832,7 @@ var bundle$8 = {
|
|
|
159815
159832
|
|
|
159816
159833
|
case "esriGeometryPoint":
|
|
159817
159834
|
if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriPMS") {
|
|
159835
|
+
// debugger
|
|
159818
159836
|
var _img3 = new Image();
|
|
159819
159837
|
|
|
159820
159838
|
_img3.src = "data:image/png;base64,".concat(data.drawingInfo.renderer.symbol.imageData);
|
|
@@ -159849,7 +159867,8 @@ var bundle$8 = {
|
|
|
159849
159867
|
dispatch({
|
|
159850
159868
|
type: "LEGEND_LAYERS_UPDATED",
|
|
159851
159869
|
payload: {
|
|
159852
|
-
legendLayers: legendLayers
|
|
159870
|
+
legendLayers: legendLayers,
|
|
159871
|
+
loading: false
|
|
159853
159872
|
}
|
|
159854
159873
|
});
|
|
159855
159874
|
} else if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSMS") {
|
|
@@ -160004,8 +160023,8 @@ var bundle$8 = {
|
|
|
160004
160023
|
img.src = canvas.toDataURL(); //set src using data URI from canvas
|
|
160005
160024
|
|
|
160006
160025
|
img.alt = "Style for ".concat(displayName);
|
|
160007
|
-
img.crossOrigin = "anonymous";
|
|
160008
|
-
|
|
160026
|
+
img.crossOrigin = "anonymous"; // debugger
|
|
160027
|
+
|
|
160009
160028
|
legendCanvases[uid].canvas.push(canvas);
|
|
160010
160029
|
dispatch({
|
|
160011
160030
|
type: "LEGEND_CANVAS_ADDED",
|
|
@@ -160035,6 +160054,52 @@ var bundle$8 = {
|
|
|
160035
160054
|
});
|
|
160036
160055
|
}
|
|
160037
160056
|
|
|
160057
|
+
break;
|
|
160058
|
+
|
|
160059
|
+
case "esriGeometryMultipoint":
|
|
160060
|
+
// debugger
|
|
160061
|
+
if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriPMS") {
|
|
160062
|
+
// debugger
|
|
160063
|
+
var _img5 = new Image();
|
|
160064
|
+
|
|
160065
|
+
_img5.src = "data:image/png;base64,".concat(data.drawingInfo.renderer.symbol.imageData);
|
|
160066
|
+
|
|
160067
|
+
_img5.addEventListener("load", function () {
|
|
160068
|
+
var canvas = document.createElement("canvas");
|
|
160069
|
+
var ctx = canvas.getContext("2d");
|
|
160070
|
+
canvas.width = drawingInfo.renderer.symbol.width;
|
|
160071
|
+
canvas.height = drawingInfo.renderer.symbol.height; //store width & height for larger canvas calculation
|
|
160072
|
+
|
|
160073
|
+
legendCanvases[uid].widths.push(canvas.width);
|
|
160074
|
+
legendCanvases[uid].heights.push(canvas.height); //set background
|
|
160075
|
+
|
|
160076
|
+
ctx.fillStyle = "white";
|
|
160077
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
160078
|
+
ctx.drawImage(_img5, 0, 0); //add image to canvas
|
|
160079
|
+
|
|
160080
|
+
legendCanvases[uid].canvas.push(canvas);
|
|
160081
|
+
dispatch({
|
|
160082
|
+
type: "LEGEND_CANVAS_ADDED",
|
|
160083
|
+
payload: {
|
|
160084
|
+
legendCanvases: legendCanvases,
|
|
160085
|
+
loading: false
|
|
160086
|
+
}
|
|
160087
|
+
});
|
|
160088
|
+
}, false);
|
|
160089
|
+
|
|
160090
|
+
_img5.alt = "Style for ".concat(displayName);
|
|
160091
|
+
_img5.crossOrigin = "anonymous";
|
|
160092
|
+
legendLayers[uid] = [_img5]; //TODO: Update to possibly push multiple images into array
|
|
160093
|
+
|
|
160094
|
+
dispatch({
|
|
160095
|
+
type: "LEGEND_LAYERS_UPDATED",
|
|
160096
|
+
payload: {
|
|
160097
|
+
legendLayers: legendLayers,
|
|
160098
|
+
loading: false
|
|
160099
|
+
}
|
|
160100
|
+
});
|
|
160101
|
+
}
|
|
160102
|
+
|
|
160038
160103
|
break;
|
|
160039
160104
|
}
|
|
160040
160105
|
};
|
package/lib/prod.js
CHANGED
|
@@ -106161,27 +106161,32 @@ var config = {
|
|
|
106161
106161
|
subdomains: "abcd",
|
|
106162
106162
|
accessToken: mapboxToken,
|
|
106163
106163
|
visible: false
|
|
106164
|
-
}, {
|
|
106165
|
-
|
|
106166
|
-
|
|
106167
|
-
|
|
106168
|
-
|
|
106169
|
-
|
|
106170
|
-
|
|
106171
|
-
|
|
106172
|
-
|
|
106173
|
-
|
|
106174
|
-
|
|
106175
|
-
|
|
106176
|
-
|
|
106177
|
-
|
|
106178
|
-
|
|
106179
|
-
|
|
106180
|
-
|
|
106181
|
-
|
|
106182
|
-
|
|
106183
|
-
|
|
106184
|
-
|
|
106164
|
+
}, // {
|
|
106165
|
+
// id: "StamenToner",
|
|
106166
|
+
// name: "Stamen Toner",
|
|
106167
|
+
// url: "https://stamen-tiles-{a-d}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png",
|
|
106168
|
+
// attributions:
|
|
106169
|
+
// 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
|
106170
|
+
// subdomains: "abcd",
|
|
106171
|
+
// minZoom: 0,
|
|
106172
|
+
// maxZoom: 20,
|
|
106173
|
+
// ext: "png",
|
|
106174
|
+
// visible: false
|
|
106175
|
+
// },
|
|
106176
|
+
// {
|
|
106177
|
+
// id: "StamenWatercolor",
|
|
106178
|
+
// name: "Stamen Watercolor",
|
|
106179
|
+
// url:
|
|
106180
|
+
// "https://stamen-tiles-{a-d}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg",
|
|
106181
|
+
// attributions:
|
|
106182
|
+
// 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
|
106183
|
+
// subdomains: "abcd",
|
|
106184
|
+
// minZoom: 1,
|
|
106185
|
+
// maxZoom: 16,
|
|
106186
|
+
// ext: "png",
|
|
106187
|
+
// visible: false
|
|
106188
|
+
// },
|
|
106189
|
+
{
|
|
106185
106190
|
id: "EsriWorldStreetMap",
|
|
106186
106191
|
name: "ESRI Streetmap",
|
|
106187
106192
|
url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",
|
|
@@ -106482,7 +106487,7 @@ var config = {
|
|
|
106482
106487
|
};
|
|
106483
106488
|
|
|
106484
106489
|
var name = "@corpsmap/corpsmap";
|
|
106485
|
-
var version$1 = "3.2.
|
|
106490
|
+
var version$1 = "3.2.39";
|
|
106486
106491
|
var description = "CorpsMap as React Components";
|
|
106487
106492
|
var main = "index.js";
|
|
106488
106493
|
var scripts = {
|
|
@@ -132901,6 +132906,10 @@ var formatColumns = function formatColumns(value, formatType) {
|
|
|
132901
132906
|
}
|
|
132902
132907
|
|
|
132903
132908
|
if (formatType === "UNIXDATE") {
|
|
132909
|
+
if (value === null || value === "null") {
|
|
132910
|
+
return null;
|
|
132911
|
+
}
|
|
132912
|
+
|
|
132904
132913
|
var unixTimestamp = value;
|
|
132905
132914
|
var milliseconds = unixTimestamp; // * 1000 in some cases.
|
|
132906
132915
|
|
|
@@ -159331,6 +159340,7 @@ var bundle$8 = {
|
|
|
159331
159340
|
break;
|
|
159332
159341
|
|
|
159333
159342
|
case "EsriFeatureService":
|
|
159343
|
+
// debugger
|
|
159334
159344
|
if (legendOverride === true) {
|
|
159335
159345
|
src = "".concat(src, "/legend?f=pjson");
|
|
159336
159346
|
} else {
|
|
@@ -159363,6 +159373,7 @@ var bundle$8 = {
|
|
|
159363
159373
|
if (legendOverride === true) {
|
|
159364
159374
|
store.doGenerateArcImages(data, lyr);
|
|
159365
159375
|
} else {
|
|
159376
|
+
// debugger
|
|
159366
159377
|
store.doGenerateEsriImages(data, lyr);
|
|
159367
159378
|
}
|
|
159368
159379
|
} else {
|
|
@@ -159485,6 +159496,7 @@ var bundle$8 = {
|
|
|
159485
159496
|
switch (data.geometryType) {
|
|
159486
159497
|
case "esriGeometryPolygon":
|
|
159487
159498
|
if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSFS" && drawingInfo.renderer.symbol.style === "esriSFSSolid") {
|
|
159499
|
+
// debugger
|
|
159488
159500
|
var img = new Image();
|
|
159489
159501
|
var outlineColor = drawingInfo.renderer.symbol.outline.color;
|
|
159490
159502
|
var fillColor = drawingInfo.renderer.symbol.color;
|
|
@@ -159583,10 +159595,15 @@ var bundle$8 = {
|
|
|
159583
159595
|
});
|
|
159584
159596
|
} //____________________________________________________________________________________________________________________________________
|
|
159585
159597
|
else if (drawingInfo.renderer.type === "uniqueValue" && drawingInfo.renderer.uniqueValueInfos) {
|
|
159598
|
+
// Compare
|
|
159586
159599
|
drawingInfo.renderer.uniqueValueInfos.forEach(function (val) {
|
|
159587
159600
|
var img = new Image();
|
|
159588
|
-
|
|
159601
|
+
console.log(val.value);
|
|
159602
|
+
|
|
159603
|
+
if (val.value === 'BOEM') ;
|
|
159604
|
+
|
|
159589
159605
|
var fillColor = val.symbol.color;
|
|
159606
|
+
var outlineColor = val.symbol.outline && val.symbol.outline.color ? val.symbol.outline.color : fillColor;
|
|
159590
159607
|
var canvas = document.createElement("canvas");
|
|
159591
159608
|
var ctx = canvas.getContext("2d");
|
|
159592
159609
|
var labelWidth = Number(ctx.measureText(val.label).width); //set canvas width & height
|
|
@@ -159729,6 +159746,7 @@ var bundle$8 = {
|
|
|
159729
159746
|
|
|
159730
159747
|
case "esriGeometryPoint":
|
|
159731
159748
|
if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriPMS") {
|
|
159749
|
+
// debugger
|
|
159732
159750
|
var _img3 = new Image();
|
|
159733
159751
|
|
|
159734
159752
|
_img3.src = "data:image/png;base64,".concat(data.drawingInfo.renderer.symbol.imageData);
|
|
@@ -159763,7 +159781,8 @@ var bundle$8 = {
|
|
|
159763
159781
|
dispatch({
|
|
159764
159782
|
type: "LEGEND_LAYERS_UPDATED",
|
|
159765
159783
|
payload: {
|
|
159766
|
-
legendLayers: legendLayers
|
|
159784
|
+
legendLayers: legendLayers,
|
|
159785
|
+
loading: false
|
|
159767
159786
|
}
|
|
159768
159787
|
});
|
|
159769
159788
|
} else if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSMS") {
|
|
@@ -159918,8 +159937,8 @@ var bundle$8 = {
|
|
|
159918
159937
|
img.src = canvas.toDataURL(); //set src using data URI from canvas
|
|
159919
159938
|
|
|
159920
159939
|
img.alt = "Style for ".concat(displayName);
|
|
159921
|
-
img.crossOrigin = "anonymous";
|
|
159922
|
-
|
|
159940
|
+
img.crossOrigin = "anonymous"; // debugger
|
|
159941
|
+
|
|
159923
159942
|
legendCanvases[uid].canvas.push(canvas);
|
|
159924
159943
|
dispatch({
|
|
159925
159944
|
type: "LEGEND_CANVAS_ADDED",
|
|
@@ -159949,6 +159968,52 @@ var bundle$8 = {
|
|
|
159949
159968
|
});
|
|
159950
159969
|
}
|
|
159951
159970
|
|
|
159971
|
+
break;
|
|
159972
|
+
|
|
159973
|
+
case "esriGeometryMultipoint":
|
|
159974
|
+
// debugger
|
|
159975
|
+
if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriPMS") {
|
|
159976
|
+
// debugger
|
|
159977
|
+
var _img5 = new Image();
|
|
159978
|
+
|
|
159979
|
+
_img5.src = "data:image/png;base64,".concat(data.drawingInfo.renderer.symbol.imageData);
|
|
159980
|
+
|
|
159981
|
+
_img5.addEventListener("load", function () {
|
|
159982
|
+
var canvas = document.createElement("canvas");
|
|
159983
|
+
var ctx = canvas.getContext("2d");
|
|
159984
|
+
canvas.width = drawingInfo.renderer.symbol.width;
|
|
159985
|
+
canvas.height = drawingInfo.renderer.symbol.height; //store width & height for larger canvas calculation
|
|
159986
|
+
|
|
159987
|
+
legendCanvases[uid].widths.push(canvas.width);
|
|
159988
|
+
legendCanvases[uid].heights.push(canvas.height); //set background
|
|
159989
|
+
|
|
159990
|
+
ctx.fillStyle = "white";
|
|
159991
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
159992
|
+
ctx.drawImage(_img5, 0, 0); //add image to canvas
|
|
159993
|
+
|
|
159994
|
+
legendCanvases[uid].canvas.push(canvas);
|
|
159995
|
+
dispatch({
|
|
159996
|
+
type: "LEGEND_CANVAS_ADDED",
|
|
159997
|
+
payload: {
|
|
159998
|
+
legendCanvases: legendCanvases,
|
|
159999
|
+
loading: false
|
|
160000
|
+
}
|
|
160001
|
+
});
|
|
160002
|
+
}, false);
|
|
160003
|
+
|
|
160004
|
+
_img5.alt = "Style for ".concat(displayName);
|
|
160005
|
+
_img5.crossOrigin = "anonymous";
|
|
160006
|
+
legendLayers[uid] = [_img5]; //TODO: Update to possibly push multiple images into array
|
|
160007
|
+
|
|
160008
|
+
dispatch({
|
|
160009
|
+
type: "LEGEND_LAYERS_UPDATED",
|
|
160010
|
+
payload: {
|
|
160011
|
+
legendLayers: legendLayers,
|
|
160012
|
+
loading: false
|
|
160013
|
+
}
|
|
160014
|
+
});
|
|
160015
|
+
}
|
|
160016
|
+
|
|
159952
160017
|
break;
|
|
159953
160018
|
}
|
|
159954
160019
|
};
|
package/package.json
CHANGED
|
@@ -64,31 +64,31 @@ const config = {
|
|
|
64
64
|
accessToken: mapboxToken,
|
|
65
65
|
visible: false
|
|
66
66
|
},
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
67
|
+
// {
|
|
68
|
+
// id: "StamenToner",
|
|
69
|
+
// name: "Stamen Toner",
|
|
70
|
+
// url: "https://stamen-tiles-{a-d}.a.ssl.fastly.net/toner/{z}/{x}/{y}.png",
|
|
71
|
+
// attributions:
|
|
72
|
+
// 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
|
73
|
+
// subdomains: "abcd",
|
|
74
|
+
// minZoom: 0,
|
|
75
|
+
// maxZoom: 20,
|
|
76
|
+
// ext: "png",
|
|
77
|
+
// visible: false
|
|
78
|
+
// },
|
|
79
|
+
// {
|
|
80
|
+
// id: "StamenWatercolor",
|
|
81
|
+
// name: "Stamen Watercolor",
|
|
82
|
+
// url:
|
|
83
|
+
// "https://stamen-tiles-{a-d}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg",
|
|
84
|
+
// attributions:
|
|
85
|
+
// 'Map tiles by <a href="https://stamen.com">Stamen Design</a>, <a href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',
|
|
86
|
+
// subdomains: "abcd",
|
|
87
|
+
// minZoom: 1,
|
|
88
|
+
// maxZoom: 16,
|
|
89
|
+
// ext: "png",
|
|
90
|
+
// visible: false
|
|
91
|
+
// },
|
|
92
92
|
{
|
|
93
93
|
id: "EsriWorldStreetMap",
|
|
94
94
|
name: "ESRI Streetmap",
|
|
@@ -58,6 +58,7 @@ export default {
|
|
|
58
58
|
src = `${src}/legend?bandIds=&renderingRule=&f=pjson`;
|
|
59
59
|
break;
|
|
60
60
|
case "EsriFeatureService":
|
|
61
|
+
// debugger
|
|
61
62
|
if (legendOverride === true) {
|
|
62
63
|
src = `${src}/legend?f=pjson`;
|
|
63
64
|
}
|
|
@@ -91,6 +92,7 @@ export default {
|
|
|
91
92
|
if (legendOverride === true) {
|
|
92
93
|
store.doGenerateArcImages(data, lyr);
|
|
93
94
|
} else {
|
|
95
|
+
// debugger
|
|
94
96
|
store.doGenerateEsriImages(data, lyr);
|
|
95
97
|
}
|
|
96
98
|
} else {
|
|
@@ -218,6 +220,7 @@ export default {
|
|
|
218
220
|
drawingInfo.renderer.symbol.type === "esriSFS" &&
|
|
219
221
|
drawingInfo.renderer.symbol.style === "esriSFSSolid"
|
|
220
222
|
) {
|
|
223
|
+
// debugger
|
|
221
224
|
let img = new Image();
|
|
222
225
|
const outlineColor = drawingInfo.renderer.symbol.outline.color;
|
|
223
226
|
const fillColor = drawingInfo.renderer.symbol.color;
|
|
@@ -325,10 +328,17 @@ export default {
|
|
|
325
328
|
drawingInfo.renderer.type === "uniqueValue" &&
|
|
326
329
|
drawingInfo.renderer.uniqueValueInfos
|
|
327
330
|
) {
|
|
331
|
+
// Compare
|
|
328
332
|
drawingInfo.renderer.uniqueValueInfos.forEach((val) => {
|
|
329
333
|
let img = new Image();
|
|
330
|
-
|
|
334
|
+
console.log(val.value)
|
|
335
|
+
if (val.value === 'BOEM') {
|
|
336
|
+
// debugger
|
|
337
|
+
}
|
|
338
|
+
|
|
331
339
|
const fillColor = val.symbol.color;
|
|
340
|
+
const outlineColor = val.symbol.outline && val.symbol.outline.color ? val.symbol.outline.color : fillColor;
|
|
341
|
+
|
|
332
342
|
|
|
333
343
|
let canvas = document.createElement("canvas");
|
|
334
344
|
let ctx = canvas.getContext("2d");
|
|
@@ -487,6 +497,7 @@ export default {
|
|
|
487
497
|
break;
|
|
488
498
|
case "esriGeometryPoint":
|
|
489
499
|
if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriPMS") {
|
|
500
|
+
// debugger
|
|
490
501
|
let img = new Image();
|
|
491
502
|
img.src = `data:image/png;base64,${data.drawingInfo.renderer.symbol.imageData}`;
|
|
492
503
|
img.addEventListener(
|
|
@@ -528,6 +539,7 @@ export default {
|
|
|
528
539
|
type: "LEGEND_LAYERS_UPDATED",
|
|
529
540
|
payload: {
|
|
530
541
|
legendLayers: legendLayers,
|
|
542
|
+
loading: false,
|
|
531
543
|
},
|
|
532
544
|
});
|
|
533
545
|
} else if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSMS") {
|
|
@@ -702,7 +714,7 @@ export default {
|
|
|
702
714
|
img.src = canvas.toDataURL(); //set src using data URI from canvas
|
|
703
715
|
img.alt = `Style for ${displayName}`;
|
|
704
716
|
img.crossOrigin = "anonymous";
|
|
705
|
-
debugger
|
|
717
|
+
// debugger
|
|
706
718
|
|
|
707
719
|
legendCanvases[uid].canvas.push(canvas);
|
|
708
720
|
dispatch({
|
|
@@ -735,6 +747,57 @@ export default {
|
|
|
735
747
|
});
|
|
736
748
|
}
|
|
737
749
|
break;
|
|
750
|
+
case "esriGeometryMultipoint" :
|
|
751
|
+
// debugger
|
|
752
|
+
if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriPMS") {
|
|
753
|
+
// debugger
|
|
754
|
+
let img = new Image();
|
|
755
|
+
img.src = `data:image/png;base64,${data.drawingInfo.renderer.symbol.imageData}`;
|
|
756
|
+
img.addEventListener(
|
|
757
|
+
"load",
|
|
758
|
+
function () {
|
|
759
|
+
let canvas = document.createElement("canvas");
|
|
760
|
+
let ctx = canvas.getContext("2d");
|
|
761
|
+
|
|
762
|
+
canvas.width = drawingInfo.renderer.symbol.width;
|
|
763
|
+
canvas.height = drawingInfo.renderer.symbol.height;
|
|
764
|
+
|
|
765
|
+
//store width & height for larger canvas calculation
|
|
766
|
+
legendCanvases[uid].widths.push(canvas.width);
|
|
767
|
+
legendCanvases[uid].heights.push(canvas.height);
|
|
768
|
+
|
|
769
|
+
//set background
|
|
770
|
+
ctx.fillStyle = "white";
|
|
771
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
772
|
+
|
|
773
|
+
ctx.drawImage(img, 0, 0); //add image to canvas
|
|
774
|
+
|
|
775
|
+
legendCanvases[uid].canvas.push(canvas);
|
|
776
|
+
|
|
777
|
+
dispatch({
|
|
778
|
+
type: "LEGEND_CANVAS_ADDED",
|
|
779
|
+
payload: {
|
|
780
|
+
legendCanvases: legendCanvases,
|
|
781
|
+
loading: false,
|
|
782
|
+
},
|
|
783
|
+
});
|
|
784
|
+
},
|
|
785
|
+
false
|
|
786
|
+
);
|
|
787
|
+
|
|
788
|
+
img.alt = `Style for ${displayName}`;
|
|
789
|
+
img.crossOrigin = "anonymous";
|
|
790
|
+
legendLayers[uid] = [img]; //TODO: Update to possibly push multiple images into array
|
|
791
|
+
dispatch({
|
|
792
|
+
type: "LEGEND_LAYERS_UPDATED",
|
|
793
|
+
payload: {
|
|
794
|
+
legendLayers: legendLayers,
|
|
795
|
+
loading: false,
|
|
796
|
+
},
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
break;
|
|
800
|
+
|
|
738
801
|
default:
|
|
739
802
|
break;
|
|
740
803
|
}
|
|
@@ -1,139 +1,142 @@
|
|
|
1
|
-
const formatArcgisrest = function (attributes) {
|
|
2
|
-
for (const [key, value] of Object.entries(attributes)) {
|
|
3
|
-
const result =
|
|
4
|
-
String(value).includes("https:") || String(value).includes("http:")
|
|
5
|
-
? value
|
|
6
|
-
: null;
|
|
7
|
-
|
|
8
|
-
if (result) {
|
|
9
|
-
attributes[key] = `<a href="${value}" target="_new" > ${value} </a>`;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return attributes;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const formatArcgisVector = function (results) {
|
|
16
|
-
results.map((feat) => {
|
|
17
|
-
for (const [key, value] of Object.entries(feat.properties)) {
|
|
18
|
-
const result =
|
|
19
|
-
String(value).includes("https:") || String(value).includes("http:")
|
|
20
|
-
? value
|
|
21
|
-
: null;
|
|
22
|
-
|
|
23
|
-
if (result) {
|
|
24
|
-
feat.properties[
|
|
25
|
-
key
|
|
26
|
-
] = `<a href="${value}" target="_new" > ${value} </a>`;
|
|
27
|
-
}
|
|
28
|
-
// Format UNIX Date
|
|
29
|
-
|
|
30
|
-
// if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
|
|
31
|
-
// const unixTimestamp = feat.properties[key];
|
|
32
|
-
// const milliseconds = unixTimestamp // * 1000 in some cases.
|
|
33
|
-
// const dateObject = new Date(milliseconds);
|
|
34
|
-
// feat.properties[key] = dateObject.toLocaleString();
|
|
35
|
-
// }
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
return results;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const identifyColumnsArcgisrest = function (data, excludedColumns) {
|
|
43
|
-
data.results.forEach((result) => {
|
|
44
|
-
if(result.attributes){
|
|
45
|
-
excludedColumns.forEach((column) => {
|
|
46
|
-
delete result.attributes[column];
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return result.attributes;
|
|
50
|
-
});
|
|
51
|
-
return data;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const identifyExcludeColumnsArcgisvector = function (data, excludedColumns) {
|
|
55
|
-
data.forEach((feature) => {
|
|
56
|
-
if(feature.properties){
|
|
57
|
-
excludedColumns.forEach((column) => {
|
|
58
|
-
delete feature.properties[column];
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return feature.properties
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
return data;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const identifyIncludeColumnsArcgisvector = function (data, identifyFields) {
|
|
68
|
-
data.forEach((feature) => {
|
|
69
|
-
console.log(feature, feature.properties)
|
|
70
|
-
if(feature.properties){
|
|
71
|
-
for (const [key, value] of Object.entries(feature.properties)) {
|
|
72
|
-
let reducedProperties = {};
|
|
73
|
-
identifyFields.forEach((property) => {
|
|
74
|
-
if (feature.properties[property]) {
|
|
75
|
-
reducedProperties[property] =
|
|
76
|
-
feature.properties[property];
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
feature.properties = reducedProperties;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
})
|
|
83
|
-
|
|
84
|
-
return data;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const identifyRenameColumnsArcgisvector = function (data, identifyRenameColums) {
|
|
88
|
-
|
|
89
|
-
data.forEach((feature) => {
|
|
90
|
-
if(feature.properties){
|
|
91
|
-
let wkData = {};
|
|
92
|
-
for (const [featureKey, featureValue] of Object.entries(feature.properties)) {
|
|
93
|
-
for (const [key, value] of Object.entries(identifyRenameColums)){
|
|
94
|
-
if (featureKey === key) {
|
|
95
|
-
// feature.properties[value] = feature.properties[featureKey];
|
|
96
|
-
wkData[value] = feature.properties[featureKey];
|
|
97
|
-
delete feature.properties[featureKey];
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
feature.properties = Object.assign(wkData, feature.properties)
|
|
102
|
-
}
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
return data;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const identifyFormatColumnsArcgisvector = function (data, identifyFormatColumns) {
|
|
109
|
-
data.forEach((feature) => {
|
|
110
|
-
if(feature.properties){
|
|
111
|
-
for (const [key, value] of Object.entries(identifyFormatColumns)){
|
|
112
|
-
console.log(key, value);
|
|
113
|
-
if(feature.properties.hasOwnProperty(key)){
|
|
114
|
-
feature.properties[key] = formatColumns(feature.properties[key], value)
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
})
|
|
119
|
-
|
|
120
|
-
return data;
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const formatColumns = function (value, formatType) {
|
|
124
|
-
if (formatType === "PERCENT") {
|
|
125
|
-
value = (value * 100).toFixed(0) + '%'
|
|
126
|
-
}
|
|
127
|
-
if (formatType === "BOOLEAN") {
|
|
128
|
-
value = value === 0 ? "No" : "Yes"
|
|
129
|
-
}
|
|
130
|
-
if (formatType === "UNIXDATE") {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
1
|
+
const formatArcgisrest = function (attributes) {
|
|
2
|
+
for (const [key, value] of Object.entries(attributes)) {
|
|
3
|
+
const result =
|
|
4
|
+
String(value).includes("https:") || String(value).includes("http:")
|
|
5
|
+
? value
|
|
6
|
+
: null;
|
|
7
|
+
|
|
8
|
+
if (result) {
|
|
9
|
+
attributes[key] = `<a href="${value}" target="_new" > ${value} </a>`;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return attributes;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const formatArcgisVector = function (results) {
|
|
16
|
+
results.map((feat) => {
|
|
17
|
+
for (const [key, value] of Object.entries(feat.properties)) {
|
|
18
|
+
const result =
|
|
19
|
+
String(value).includes("https:") || String(value).includes("http:")
|
|
20
|
+
? value
|
|
21
|
+
: null;
|
|
22
|
+
|
|
23
|
+
if (result) {
|
|
24
|
+
feat.properties[
|
|
25
|
+
key
|
|
26
|
+
] = `<a href="${value}" target="_new" > ${value} </a>`;
|
|
27
|
+
}
|
|
28
|
+
// Format UNIX Date
|
|
29
|
+
|
|
30
|
+
// if ((key === "fromdate" || key === "todate" || key === "referencedate") && Number.isInteger(feat.properties[key])) {
|
|
31
|
+
// const unixTimestamp = feat.properties[key];
|
|
32
|
+
// const milliseconds = unixTimestamp // * 1000 in some cases.
|
|
33
|
+
// const dateObject = new Date(milliseconds);
|
|
34
|
+
// feat.properties[key] = dateObject.toLocaleString();
|
|
35
|
+
// }
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
return results;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const identifyColumnsArcgisrest = function (data, excludedColumns) {
|
|
43
|
+
data.results.forEach((result) => {
|
|
44
|
+
if(result.attributes){
|
|
45
|
+
excludedColumns.forEach((column) => {
|
|
46
|
+
delete result.attributes[column];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return result.attributes;
|
|
50
|
+
});
|
|
51
|
+
return data;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const identifyExcludeColumnsArcgisvector = function (data, excludedColumns) {
|
|
55
|
+
data.forEach((feature) => {
|
|
56
|
+
if(feature.properties){
|
|
57
|
+
excludedColumns.forEach((column) => {
|
|
58
|
+
delete feature.properties[column];
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return feature.properties
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
return data;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const identifyIncludeColumnsArcgisvector = function (data, identifyFields) {
|
|
68
|
+
data.forEach((feature) => {
|
|
69
|
+
console.log(feature, feature.properties)
|
|
70
|
+
if(feature.properties){
|
|
71
|
+
for (const [key, value] of Object.entries(feature.properties)) {
|
|
72
|
+
let reducedProperties = {};
|
|
73
|
+
identifyFields.forEach((property) => {
|
|
74
|
+
if (feature.properties[property]) {
|
|
75
|
+
reducedProperties[property] =
|
|
76
|
+
feature.properties[property];
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
feature.properties = reducedProperties;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
return data;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const identifyRenameColumnsArcgisvector = function (data, identifyRenameColums) {
|
|
88
|
+
|
|
89
|
+
data.forEach((feature) => {
|
|
90
|
+
if(feature.properties){
|
|
91
|
+
let wkData = {};
|
|
92
|
+
for (const [featureKey, featureValue] of Object.entries(feature.properties)) {
|
|
93
|
+
for (const [key, value] of Object.entries(identifyRenameColums)){
|
|
94
|
+
if (featureKey === key) {
|
|
95
|
+
// feature.properties[value] = feature.properties[featureKey];
|
|
96
|
+
wkData[value] = feature.properties[featureKey];
|
|
97
|
+
delete feature.properties[featureKey];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
feature.properties = Object.assign(wkData, feature.properties)
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
return data;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const identifyFormatColumnsArcgisvector = function (data, identifyFormatColumns) {
|
|
109
|
+
data.forEach((feature) => {
|
|
110
|
+
if(feature.properties){
|
|
111
|
+
for (const [key, value] of Object.entries(identifyFormatColumns)){
|
|
112
|
+
console.log(key, value);
|
|
113
|
+
if(feature.properties.hasOwnProperty(key)){
|
|
114
|
+
feature.properties[key] = formatColumns(feature.properties[key], value)
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
return data;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const formatColumns = function (value, formatType) {
|
|
124
|
+
if (formatType === "PERCENT") {
|
|
125
|
+
value = (value * 100).toFixed(0) + '%'
|
|
126
|
+
}
|
|
127
|
+
if (formatType === "BOOLEAN") {
|
|
128
|
+
value = value === 0 ? "No" : "Yes"
|
|
129
|
+
}
|
|
130
|
+
if (formatType === "UNIXDATE") {
|
|
131
|
+
if (value === null || value === "null") {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
const unixTimestamp = value;
|
|
135
|
+
const milliseconds = unixTimestamp // * 1000 in some cases.
|
|
136
|
+
const dateObject = new Date(milliseconds);
|
|
137
|
+
value = dateObject.toLocaleString();
|
|
138
|
+
}
|
|
139
|
+
return value;
|
|
140
|
+
};
|
|
141
|
+
|
|
139
142
|
export { formatArcgisVector, formatArcgisrest, identifyColumnsArcgisrest, identifyExcludeColumnsArcgisvector, identifyIncludeColumnsArcgisvector, identifyRenameColumnsArcgisvector, identifyFormatColumnsArcgisvector };
|