@corpsmap/corpsmap 3.2.35 → 3.2.36

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
@@ -106568,7 +106568,7 @@ var config = {
106568
106568
  };
106569
106569
 
106570
106570
  var name = "@corpsmap/corpsmap";
106571
- var version$1 = "3.2.35";
106571
+ var version$1 = "3.2.36";
106572
106572
  var description = "CorpsMap as React Components";
106573
106573
  var main = "index.js";
106574
106574
  var scripts = {
@@ -159609,8 +159609,7 @@ var bundle$8 = {
159609
159609
  loading: false
159610
159610
  }
159611
159611
  });
159612
- } //__________________________________________________________________________________________________________________________________
159613
- else if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSFS" && drawingInfo.renderer.symbol.style === "esriSFSBackwardDiagonal") {
159612
+ } else if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSFS" && drawingInfo.renderer.symbol.style === "esriSFSBackwardDiagonal") {
159614
159613
  // debugger
159615
159614
  var _img = new Image();
159616
159615
 
@@ -159978,6 +159977,52 @@ var bundle$8 = {
159978
159977
  }
159979
159978
  });
159980
159979
  });
159980
+ } else if (drawingInfo.renderer.classBreakInfos) {
159981
+ drawingInfo.renderer.classBreakInfos.forEach(function (val) {
159982
+ var img = new Image();
159983
+ var outlineColor = val.symbol.outline.color;
159984
+ var outlineWidth = val.symbol.outline.width;
159985
+ var fillColor = val.symbol.color;
159986
+ var size = val.symbol.size;
159987
+ var canvas = document.createElement("canvas");
159988
+ var ctx = canvas.getContext("2d");
159989
+ canvas.width = 20 * 2.5;
159990
+ canvas.height = 20;
159991
+ legendCanvases[uid].widths.push(canvas.width);
159992
+ legendCanvases[uid].heights.push(canvas.height); //text
159993
+
159994
+ ctx.font = "11px Arial";
159995
+ ctx.fillText(val.label, size * 3, size * 2, 30); // circle
159996
+
159997
+ ctx.beginPath();
159998
+ ctx.strokeStyle = "rgba(".concat(outlineColor.join(), ")");
159999
+ ctx.lineWidth = outlineWidth;
160000
+ ctx.arc(size, size * 1.5, size / 1.5, 0, Math.PI * 2);
160001
+ ctx.fillStyle = "rgba(".concat(fillColor.join(), ")");
160002
+ ctx.fill();
160003
+ ctx.stroke();
160004
+ img.src = canvas.toDataURL(); //set src using data URI from canvas
160005
+
160006
+ img.alt = "Style for ".concat(displayName);
160007
+ img.crossOrigin = "anonymous";
160008
+ debugger;
160009
+ legendCanvases[uid].canvas.push(canvas);
160010
+ dispatch({
160011
+ type: "LEGEND_CANVAS_ADDED",
160012
+ payload: {
160013
+ legendCanvases: legendCanvases,
160014
+ loading: false
160015
+ }
160016
+ });
160017
+ legendLayers[uid].push(img);
160018
+ dispatch({
160019
+ type: "LEGEND_LAYERS_UPDATED",
160020
+ payload: {
160021
+ legendLayers: legendLayers,
160022
+ loading: false
160023
+ }
160024
+ });
160025
+ });
159981
160026
  } else {
159982
160027
  legendLayers[uid] = ["Legend not available!"];
159983
160028
  dispatch({
package/lib/prod.js CHANGED
@@ -106482,7 +106482,7 @@ var config = {
106482
106482
  };
106483
106483
 
106484
106484
  var name = "@corpsmap/corpsmap";
106485
- var version$1 = "3.2.35";
106485
+ var version$1 = "3.2.36";
106486
106486
  var description = "CorpsMap as React Components";
106487
106487
  var main = "index.js";
106488
106488
  var scripts = {
@@ -159523,8 +159523,7 @@ var bundle$8 = {
159523
159523
  loading: false
159524
159524
  }
159525
159525
  });
159526
- } //__________________________________________________________________________________________________________________________________
159527
- else if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSFS" && drawingInfo.renderer.symbol.style === "esriSFSBackwardDiagonal") {
159526
+ } else if (drawingInfo.renderer.symbol && drawingInfo.renderer.symbol.type === "esriSFS" && drawingInfo.renderer.symbol.style === "esriSFSBackwardDiagonal") {
159528
159527
  // debugger
159529
159528
  var _img = new Image();
159530
159529
 
@@ -159892,6 +159891,52 @@ var bundle$8 = {
159892
159891
  }
159893
159892
  });
159894
159893
  });
159894
+ } else if (drawingInfo.renderer.classBreakInfos) {
159895
+ drawingInfo.renderer.classBreakInfos.forEach(function (val) {
159896
+ var img = new Image();
159897
+ var outlineColor = val.symbol.outline.color;
159898
+ var outlineWidth = val.symbol.outline.width;
159899
+ var fillColor = val.symbol.color;
159900
+ var size = val.symbol.size;
159901
+ var canvas = document.createElement("canvas");
159902
+ var ctx = canvas.getContext("2d");
159903
+ canvas.width = 20 * 2.5;
159904
+ canvas.height = 20;
159905
+ legendCanvases[uid].widths.push(canvas.width);
159906
+ legendCanvases[uid].heights.push(canvas.height); //text
159907
+
159908
+ ctx.font = "11px Arial";
159909
+ ctx.fillText(val.label, size * 3, size * 2, 30); // circle
159910
+
159911
+ ctx.beginPath();
159912
+ ctx.strokeStyle = "rgba(".concat(outlineColor.join(), ")");
159913
+ ctx.lineWidth = outlineWidth;
159914
+ ctx.arc(size, size * 1.5, size / 1.5, 0, Math.PI * 2);
159915
+ ctx.fillStyle = "rgba(".concat(fillColor.join(), ")");
159916
+ ctx.fill();
159917
+ ctx.stroke();
159918
+ img.src = canvas.toDataURL(); //set src using data URI from canvas
159919
+
159920
+ img.alt = "Style for ".concat(displayName);
159921
+ img.crossOrigin = "anonymous";
159922
+ debugger;
159923
+ legendCanvases[uid].canvas.push(canvas);
159924
+ dispatch({
159925
+ type: "LEGEND_CANVAS_ADDED",
159926
+ payload: {
159927
+ legendCanvases: legendCanvases,
159928
+ loading: false
159929
+ }
159930
+ });
159931
+ legendLayers[uid].push(img);
159932
+ dispatch({
159933
+ type: "LEGEND_LAYERS_UPDATED",
159934
+ payload: {
159935
+ legendLayers: legendLayers,
159936
+ loading: false
159937
+ }
159938
+ });
159939
+ });
159895
159940
  } else {
159896
159941
  legendLayers[uid] = ["Legend not available!"];
159897
159942
  dispatch({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corpsmap/corpsmap",
3
- "version": "3.2.35",
3
+ "version": "3.2.36",
4
4
  "description": "CorpsMap as React Components",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -264,7 +264,6 @@ export default {
264
264
  },
265
265
  });
266
266
  }
267
- //__________________________________________________________________________________________________________________________________
268
267
  else if(
269
268
  drawingInfo.renderer.symbol &&
270
269
  drawingInfo.renderer.symbol.type === "esriSFS" &&
@@ -655,36 +654,76 @@ export default {
655
654
 
656
655
  });
657
656
  result.forEach((item) => {
658
-
659
657
  item.image.alt = `Style for ${lyr.displayName}`;
660
-
661
658
  legendCanvases[lyr.uid].widths.push(item.canvas.width);
662
-
663
659
  legendCanvases[lyr.uid].heights.push(item.canvas.height);
664
-
665
660
  legendCanvases[lyr.uid].canvas.push(item.canvas);
666
-
667
661
  legendLayers[lyr.uid].push(item.image);
668
662
 
663
+ dispatch({
664
+ type: "LEGEND_CANVAS_ADDED",
665
+ payload: {
666
+ legendCanvases: legendCanvases,
667
+ loading: false,
668
+ },
669
+ });
670
+ });
671
+ }
672
+
673
+ else if (drawingInfo.renderer.classBreakInfos){
674
+ drawingInfo.renderer.classBreakInfos.forEach((val) => {
675
+ let img = new Image();
676
+ const outlineColor = val.symbol.outline.color;
677
+ const outlineWidth = val.symbol.outline.width;
678
+ const fillColor = val.symbol.color;
679
+ const size = val.symbol.size;
680
+ let canvas = document.createElement("canvas");
681
+ let ctx = canvas.getContext("2d");
669
682
 
683
+ canvas.width = 20 * 2.5;
684
+ canvas.height = 20;
670
685
 
671
- dispatch({
686
+ legendCanvases[uid].widths.push(canvas.width);
687
+ legendCanvases[uid].heights.push(canvas.height);
688
+
689
+ //text
690
+ ctx.font = "11px Arial";
691
+ ctx.fillText(val.label ,size * 3 , size * 2 , 30);
672
692
 
673
- type: "LEGEND_CANVAS_ADDED",
693
+ // circle
694
+ ctx.beginPath();
695
+ ctx.strokeStyle = `rgba(${outlineColor.join()})`;
696
+ ctx.lineWidth = outlineWidth;
697
+ ctx.arc(size, size * 1.5, size/1.5, 0, Math.PI * 2);
698
+ ctx.fillStyle = `rgba(${fillColor.join()})`;
699
+ ctx.fill();
700
+ ctx.stroke();
674
701
 
675
- payload: {
702
+ img.src = canvas.toDataURL(); //set src using data URI from canvas
703
+ img.alt = `Style for ${displayName}`;
704
+ img.crossOrigin = "anonymous";
705
+ debugger
676
706
 
707
+ legendCanvases[uid].canvas.push(canvas);
708
+ dispatch({
709
+ type: "LEGEND_CANVAS_ADDED",
710
+ payload: {
677
711
  legendCanvases: legendCanvases,
678
-
679
712
  loading: false,
680
-
681
713
  },
714
+ });
682
715
 
716
+ legendLayers[uid].push(img);
717
+ dispatch({
718
+ type: "LEGEND_LAYERS_UPDATED",
719
+ payload: {
720
+ legendLayers: legendLayers,
721
+ loading: false,
722
+ },
683
723
  });
684
724
  });
685
725
  }
686
726
  else {
687
-
688
727
  legendLayers[uid] = ["Legend not available!"];
689
728
  dispatch({
690
729
  type: "LEGEND_LAYERS_UPDATE_ERROR",