@performant-software/geospatial 3.1.17 → 3.1.18-beta.1

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.
Files changed (104) hide show
  1. package/dist/index.cjs13.js +1 -1
  2. package/dist/index.cjs13.js.map +1 -1
  3. package/dist/index.cjs15.js +1 -1
  4. package/dist/index.cjs191.js +1 -1
  5. package/dist/index.cjs215.js +1 -1
  6. package/dist/index.cjs216.js +1 -1
  7. package/dist/index.cjs217.js +1 -1
  8. package/dist/index.cjs235.js +1 -1
  9. package/dist/index.cjs244.js +1 -1
  10. package/dist/index.cjs244.js.map +1 -1
  11. package/dist/index.cjs245.js +1 -1
  12. package/dist/index.cjs245.js.map +1 -1
  13. package/dist/index.cjs246.js +1 -1
  14. package/dist/index.cjs246.js.map +1 -1
  15. package/dist/index.cjs254.js +1 -1
  16. package/dist/index.cjs258.js +1 -1
  17. package/dist/index.cjs259.js +1 -1
  18. package/dist/index.cjs262.js +1 -1
  19. package/dist/index.cjs265.js +1 -1
  20. package/dist/index.cjs265.js.map +1 -1
  21. package/dist/index.cjs266.js +1 -1
  22. package/dist/index.cjs266.js.map +1 -1
  23. package/dist/index.cjs267.js +1 -1
  24. package/dist/index.cjs267.js.map +1 -1
  25. package/dist/index.cjs29.js +1 -1
  26. package/dist/index.cjs32.js +1 -1
  27. package/dist/index.cjs34.js +1 -1
  28. package/dist/index.cjs35.js +1 -1
  29. package/dist/index.cjs39.js +1 -1
  30. package/dist/index.cjs73.js +1 -1
  31. package/dist/index.cjs73.js.map +1 -1
  32. package/dist/index.cjs74.js +1 -1
  33. package/dist/index.cjs75.js +1 -9
  34. package/dist/index.cjs75.js.map +1 -1
  35. package/dist/index.cjs76.js +1 -17
  36. package/dist/index.cjs76.js.map +1 -1
  37. package/dist/index.cjs77.js +1 -743
  38. package/dist/index.cjs77.js.map +1 -1
  39. package/dist/index.cjs78.js +9 -1
  40. package/dist/index.cjs78.js.map +1 -1
  41. package/dist/index.cjs79.js +17 -1
  42. package/dist/index.cjs79.js.map +1 -1
  43. package/dist/index.cjs80.js +1 -1
  44. package/dist/index.cjs80.js.map +1 -1
  45. package/dist/index.cjs81.js +1 -1
  46. package/dist/index.cjs81.js.map +1 -1
  47. package/dist/index.cjs82.js +743 -1
  48. package/dist/index.cjs82.js.map +1 -1
  49. package/dist/index.cjs83.js +1 -1
  50. package/dist/index.cjs83.js.map +1 -1
  51. package/dist/index.es13.js +45 -35
  52. package/dist/index.es13.js.map +1 -1
  53. package/dist/index.es15.js +1 -1
  54. package/dist/index.es191.js +1 -1
  55. package/dist/index.es215.js +1 -1
  56. package/dist/index.es216.js +1 -1
  57. package/dist/index.es217.js +1 -1
  58. package/dist/index.es235.js +1 -1
  59. package/dist/index.es244.js +6 -4
  60. package/dist/index.es244.js.map +1 -1
  61. package/dist/index.es245.js +3 -8
  62. package/dist/index.es245.js.map +1 -1
  63. package/dist/index.es246.js +6 -3
  64. package/dist/index.es246.js.map +1 -1
  65. package/dist/index.es254.js +1 -1
  66. package/dist/index.es258.js +1 -1
  67. package/dist/index.es259.js +2 -2
  68. package/dist/index.es262.js +1 -1
  69. package/dist/index.es265.js +69 -15
  70. package/dist/index.es265.js.map +1 -1
  71. package/dist/index.es266.js +4 -69
  72. package/dist/index.es266.js.map +1 -1
  73. package/dist/index.es267.js +15 -4
  74. package/dist/index.es267.js.map +1 -1
  75. package/dist/index.es29.js +2 -2
  76. package/dist/index.es32.js +2 -2
  77. package/dist/index.es34.js +2 -2
  78. package/dist/index.es35.js +2 -2
  79. package/dist/index.es39.js +1 -1
  80. package/dist/index.es73.js +1992 -7
  81. package/dist/index.es73.js.map +1 -1
  82. package/dist/index.es74.js +6 -2
  83. package/dist/index.es74.js.map +1 -1
  84. package/dist/index.es75.js +2 -26
  85. package/dist/index.es75.js.map +1 -1
  86. package/dist/index.es76.js +7 -588
  87. package/dist/index.es76.js.map +1 -1
  88. package/dist/index.es77.js +2 -21352
  89. package/dist/index.es77.js.map +1 -1
  90. package/dist/index.es78.js +26 -2
  91. package/dist/index.es78.js.map +1 -1
  92. package/dist/index.es79.js +556 -1960
  93. package/dist/index.es79.js.map +1 -1
  94. package/dist/index.es80.js +105 -5
  95. package/dist/index.es80.js.map +1 -1
  96. package/dist/index.es81.js +10 -2
  97. package/dist/index.es81.js.map +1 -1
  98. package/dist/index.es82.js +21350 -104
  99. package/dist/index.es82.js.map +1 -1
  100. package/dist/index.es83.js +2 -10
  101. package/dist/index.es83.js.map +1 -1
  102. package/package.json +1 -1
  103. package/src/utils/Map.js +28 -18
  104. package/types/utils/Map.js.flow +28 -18
@@ -1,13 +1,5 @@
1
- import e from "react";
2
- var t = {
3
- color: void 0,
4
- size: void 0,
5
- className: void 0,
6
- style: void 0,
7
- attr: void 0
8
- }, d = e.createContext && /* @__PURE__ */ e.createContext(t);
1
+ var e = { exports: {} };
9
2
  export {
10
- t as DefaultContext,
11
- d as IconContext
3
+ e as __module
12
4
  };
13
5
  //# sourceMappingURL=index.es83.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es83.js","sources":["../../../node_modules/react-icons/lib/iconContext.mjs"],"sourcesContent":["import React from \"react\";\nexport var DefaultContext = {\n color: undefined,\n size: undefined,\n className: undefined,\n style: undefined,\n attr: undefined\n};\nexport var IconContext = React.createContext && /*#__PURE__*/React.createContext(DefaultContext);"],"names":["DefaultContext","IconContext","React"],"mappings":";AACU,IAACA,IAAiB;AAAA,EAC1B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AACR,GACWC,IAAcC,EAAM,iBAA8BA,gBAAAA,EAAM,cAAcF,CAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es83.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@performant-software/geospatial",
3
- "version": "3.1.17",
3
+ "version": "3.1.18-beta.1",
4
4
  "description": "A package of components for all things map-related.",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs.js",
package/src/utils/Map.js CHANGED
@@ -26,32 +26,41 @@ const buildCircle = (point, radius) => (
26
26
  circle(point.coordinates, radius, { units: 'kilometers', steps: 32 })
27
27
  );
28
28
 
29
+ const getCertaintyCircle = (item, getCertaintyRadius: (item: any) => number | undefined) => {
30
+ const certaintyRadius = getCertaintyRadius(item);
31
+
32
+ if (certaintyRadius) {
33
+ if (item.geometry?.type === 'FeatureCollection') {
34
+ for (const childFeature of item.geometry.features) {
35
+ if (childFeature.geometry?.type === 'Point') {
36
+ return buildCircle(childFeature.geometry, certaintyRadius);
37
+ }
38
+ }
39
+ } else if (item.geometry?.type === 'GeometryCollection') {
40
+ for (const geometry of item.geometry.geometries) {
41
+ if (geometry.type === 'Point') {
42
+ return buildCircle(geometry, certaintyRadius);
43
+ }
44
+ }
45
+ } else if (item.geometry?.type === 'Point') {
46
+ return buildCircle(item.geometry, certaintyRadius);
47
+ }
48
+ }
49
+ };
50
+
29
51
  /**
30
52
  * Returns a GeoJSON feature collection containing circles for each item in the given array.
31
53
  */
32
- const getCertaintyCircles = (
54
+ const getCertaintyCircleFeatureCollection = (
33
55
  items,
34
56
  getCertaintyRadius: (item: any) => number | undefined
35
57
  ) => {
36
58
  const features = [];
37
59
 
38
60
  for (const item of items) {
39
- if (getCertaintyRadius(item)) {
40
- if (item.geometry?.type === 'FeatureCollection') {
41
- for (const childFeature of item.geometry.features) {
42
- if (childFeature.geometry?.type === 'Point') {
43
- features.push(buildCircle(childFeature.geometry, getCertaintyRadius(item)));
44
- }
45
- }
46
- } else if (item.geometry.type === 'GeometryCollection') {
47
- for (const geometry of item.geometry.geometries) {
48
- if (geometry.type === 'Point') {
49
- features.push(buildCircle(geometry, getCertaintyRadius(item)));
50
- }
51
- }
52
- } else if (item.geometry?.type === 'Point') {
53
- features.push(buildCircle(item.geometry, getCertaintyRadius(item)));
54
- }
61
+ const circle = getCertaintyCircle(item, getCertaintyRadius);
62
+ if (circle) {
63
+ features.push(circle);
55
64
  }
56
65
  }
57
66
 
@@ -204,7 +213,8 @@ const validateCoordinates = (coordinates) => {
204
213
 
205
214
  export default {
206
215
  addGeoreferenceLayer,
207
- getCertaintyCircles,
216
+ getCertaintyCircle,
217
+ getCertaintyCircleFeatureCollection,
208
218
  getBoundingBox,
209
219
  removeLayer,
210
220
  toFeature,
@@ -26,32 +26,41 @@ const buildCircle = (point, radius) => (
26
26
  circle(point.coordinates, radius, { units: 'kilometers', steps: 32 })
27
27
  );
28
28
 
29
+ const getCertaintyCircle = (item, getCertaintyRadius: (item: any) => number | undefined) => {
30
+ const certaintyRadius = getCertaintyRadius(item);
31
+
32
+ if (certaintyRadius) {
33
+ if (item.geometry?.type === 'FeatureCollection') {
34
+ for (const childFeature of item.geometry.features) {
35
+ if (childFeature.geometry?.type === 'Point') {
36
+ return buildCircle(childFeature.geometry, certaintyRadius);
37
+ }
38
+ }
39
+ } else if (item.geometry?.type === 'GeometryCollection') {
40
+ for (const geometry of item.geometry.geometries) {
41
+ if (geometry.type === 'Point') {
42
+ return buildCircle(geometry, certaintyRadius);
43
+ }
44
+ }
45
+ } else if (item.geometry?.type === 'Point') {
46
+ return buildCircle(item.geometry, certaintyRadius);
47
+ }
48
+ }
49
+ };
50
+
29
51
  /**
30
52
  * Returns a GeoJSON feature collection containing circles for each item in the given array.
31
53
  */
32
- const getCertaintyCircles = (
54
+ const getCertaintyCircleFeatureCollection = (
33
55
  items,
34
56
  getCertaintyRadius: (item: any) => number | undefined
35
57
  ) => {
36
58
  const features = [];
37
59
 
38
60
  for (const item of items) {
39
- if (getCertaintyRadius(item)) {
40
- if (item.geometry?.type === 'FeatureCollection') {
41
- for (const childFeature of item.geometry.features) {
42
- if (childFeature.geometry?.type === 'Point') {
43
- features.push(buildCircle(childFeature.geometry, getCertaintyRadius(item)));
44
- }
45
- }
46
- } else if (item.geometry.type === 'GeometryCollection') {
47
- for (const geometry of item.geometry.geometries) {
48
- if (geometry.type === 'Point') {
49
- features.push(buildCircle(geometry, getCertaintyRadius(item)));
50
- }
51
- }
52
- } else if (item.geometry?.type === 'Point') {
53
- features.push(buildCircle(item.geometry, getCertaintyRadius(item)));
54
- }
61
+ const circle = getCertaintyCircle(item, getCertaintyRadius);
62
+ if (circle) {
63
+ features.push(circle);
55
64
  }
56
65
  }
57
66
 
@@ -204,7 +213,8 @@ const validateCoordinates = (coordinates) => {
204
213
 
205
214
  export default {
206
215
  addGeoreferenceLayer,
207
- getCertaintyCircles,
216
+ getCertaintyCircle,
217
+ getCertaintyCircleFeatureCollection,
208
218
  getBoundingBox,
209
219
  removeLayer,
210
220
  toFeature,