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

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 (126) 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.cjs2.js +1 -1
  6. package/dist/index.cjs2.js.map +1 -1
  7. package/dist/index.cjs205.js +1 -1
  8. package/dist/index.cjs215.js +1 -1
  9. package/dist/index.cjs216.js +1 -1
  10. package/dist/index.cjs217.js +1 -1
  11. package/dist/index.cjs235.js +1 -1
  12. package/dist/index.cjs242.js +1 -1
  13. package/dist/index.cjs242.js.map +1 -1
  14. package/dist/index.cjs243.js +1 -1
  15. package/dist/index.cjs243.js.map +1 -1
  16. package/dist/index.cjs244.js +1 -1
  17. package/dist/index.cjs244.js.map +1 -1
  18. package/dist/index.cjs245.js +1 -1
  19. package/dist/index.cjs245.js.map +1 -1
  20. package/dist/index.cjs246.js +1 -1
  21. package/dist/index.cjs246.js.map +1 -1
  22. package/dist/index.cjs252.js +1 -1
  23. package/dist/index.cjs254.js +1 -1
  24. package/dist/index.cjs258.js +1 -1
  25. package/dist/index.cjs259.js +1 -1
  26. package/dist/index.cjs262.js +1 -1
  27. package/dist/index.cjs265.js +1 -1
  28. package/dist/index.cjs265.js.map +1 -1
  29. package/dist/index.cjs266.js +1 -1
  30. package/dist/index.cjs266.js.map +1 -1
  31. package/dist/index.cjs267.js +1 -1
  32. package/dist/index.cjs267.js.map +1 -1
  33. package/dist/index.cjs268.js +1 -1
  34. package/dist/index.cjs268.js.map +1 -1
  35. package/dist/index.cjs29.js +1 -1
  36. package/dist/index.cjs32.js +1 -1
  37. package/dist/index.cjs34.js +1 -1
  38. package/dist/index.cjs35.js +1 -1
  39. package/dist/index.cjs39.js +1 -1
  40. package/dist/index.cjs73.js +1 -1
  41. package/dist/index.cjs73.js.map +1 -1
  42. package/dist/index.cjs74.js +1 -1
  43. package/dist/index.cjs75.js +9 -1
  44. package/dist/index.cjs75.js.map +1 -1
  45. package/dist/index.cjs76.js +17 -1
  46. package/dist/index.cjs76.js.map +1 -1
  47. package/dist/index.cjs77.js +743 -1
  48. package/dist/index.cjs77.js.map +1 -1
  49. package/dist/index.cjs78.js +1 -9
  50. package/dist/index.cjs78.js.map +1 -1
  51. package/dist/index.cjs79.js +1 -17
  52. package/dist/index.cjs79.js.map +1 -1
  53. package/dist/index.cjs80.js +1 -1
  54. package/dist/index.cjs80.js.map +1 -1
  55. package/dist/index.cjs81.js +1 -1
  56. package/dist/index.cjs81.js.map +1 -1
  57. package/dist/index.cjs82.js +1 -743
  58. package/dist/index.cjs82.js.map +1 -1
  59. package/dist/index.cjs83.js +1 -1
  60. package/dist/index.cjs83.js.map +1 -1
  61. package/dist/index.es13.js +62 -49
  62. package/dist/index.es13.js.map +1 -1
  63. package/dist/index.es15.js +1 -1
  64. package/dist/index.es191.js +1 -1
  65. package/dist/index.es2.js +7 -7
  66. package/dist/index.es2.js.map +1 -1
  67. package/dist/index.es205.js +2 -2
  68. package/dist/index.es215.js +1 -1
  69. package/dist/index.es216.js +1 -1
  70. package/dist/index.es217.js +1 -1
  71. package/dist/index.es235.js +1 -1
  72. package/dist/index.es242.js +3 -21
  73. package/dist/index.es242.js.map +1 -1
  74. package/dist/index.es243.js +20 -22
  75. package/dist/index.es243.js.map +1 -1
  76. package/dist/index.es244.js +22 -7
  77. package/dist/index.es244.js.map +1 -1
  78. package/dist/index.es245.js +6 -3
  79. package/dist/index.es245.js.map +1 -1
  80. package/dist/index.es246.js +6 -4
  81. package/dist/index.es246.js.map +1 -1
  82. package/dist/index.es252.js +1 -1
  83. package/dist/index.es254.js +1 -1
  84. package/dist/index.es258.js +1 -1
  85. package/dist/index.es259.js +2 -2
  86. package/dist/index.es262.js +1 -1
  87. package/dist/index.es265.js +2 -69
  88. package/dist/index.es265.js.map +1 -1
  89. package/dist/index.es266.js +15 -4
  90. package/dist/index.es266.js.map +1 -1
  91. package/dist/index.es267.js +4 -15
  92. package/dist/index.es267.js.map +1 -1
  93. package/dist/index.es268.js +69 -2
  94. package/dist/index.es268.js.map +1 -1
  95. package/dist/index.es29.js +2 -2
  96. package/dist/index.es32.js +2 -2
  97. package/dist/index.es34.js +2 -2
  98. package/dist/index.es35.js +2 -2
  99. package/dist/index.es39.js +1 -1
  100. package/dist/index.es73.js +7 -1992
  101. package/dist/index.es73.js.map +1 -1
  102. package/dist/index.es74.js +2 -6
  103. package/dist/index.es74.js.map +1 -1
  104. package/dist/index.es75.js +26 -2
  105. package/dist/index.es75.js.map +1 -1
  106. package/dist/index.es76.js +588 -7
  107. package/dist/index.es76.js.map +1 -1
  108. package/dist/index.es77.js +21352 -2
  109. package/dist/index.es77.js.map +1 -1
  110. package/dist/index.es78.js +2 -26
  111. package/dist/index.es78.js.map +1 -1
  112. package/dist/index.es79.js +1960 -556
  113. package/dist/index.es79.js.map +1 -1
  114. package/dist/index.es80.js +5 -105
  115. package/dist/index.es80.js.map +1 -1
  116. package/dist/index.es81.js +2 -10
  117. package/dist/index.es81.js.map +1 -1
  118. package/dist/index.es82.js +104 -21350
  119. package/dist/index.es82.js.map +1 -1
  120. package/dist/index.es83.js +10 -2
  121. package/dist/index.es83.js.map +1 -1
  122. package/package.json +1 -1
  123. package/src/components/CertaintyLayer.js +10 -4
  124. package/src/utils/Map.js +35 -36
  125. package/types/components/CertaintyLayer.js.flow +10 -4
  126. package/types/utils/Map.js.flow +35 -36
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e={exports:{}};exports.__module=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");var t={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},n=e.createContext&&e.createContext(t);exports.DefaultContext=t;exports.IconContext=n;
2
2
  //# sourceMappingURL=index.cjs83.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs83.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.cjs83.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":"yGACU,IAACA,EAAiB,CAC1B,MAAO,OACP,KAAM,OACN,UAAW,OACX,MAAO,OACP,KAAM,MACR,EACWC,EAAcC,EAAM,eAA8BA,EAAM,cAAcF,CAAc","x_google_ignoreList":[0]}
@@ -1,10 +1,10 @@
1
- import { WarpedMapLayer as u } from "./index.es68.js";
1
+ import { WarpedMapLayer as c } from "./index.es68.js";
2
2
  import { bbox as m } from "./index.es69.js";
3
- import { bboxPolygon as y } from "./index.es70.js";
4
- import { buffer as d } from "./index.es71.js";
5
- import g from "./index.es72.js";
6
- import { featureCollection as a, feature as C } from "./index.es67.js";
7
- import p from "./index.es36.js";
3
+ import { bboxPolygon as u } from "./index.es70.js";
4
+ import { buffer as y } from "./index.es71.js";
5
+ import f from "./index.es72.js";
6
+ import { featureCollection as d, feature as g } from "./index.es67.js";
7
+ import l from "./index.es36.js";
8
8
  import "./index.es37.js";
9
9
  import "./index.es38.js";
10
10
  import "./index.es39.js";
@@ -32,38 +32,52 @@ import "./index.es60.js";
32
32
  import "./index.es61.js";
33
33
  import "./index.es62.js";
34
34
  import "./index.es63.js";
35
- const _ = -90, L = 90, I = -180, M = 180, n = (t, r) => g(t.coordinates, r, { units: "kilometers", steps: 32 }), s = (t, r) => {
36
- const e = r(t);
37
- if (e) {
38
- if (t.geometry?.type === "FeatureCollection") {
39
- for (const o of t.geometry.features)
40
- if (o.geometry?.type === "Point")
41
- return n(o.geometry, e);
42
- } else if (t.geometry?.type === "GeometryCollection") {
43
- for (const o of t.geometry.geometries)
44
- if (o.type === "Point")
45
- return n(o, e);
46
- } else if (t.geometry?.type === "Point")
47
- return n(t.geometry, e);
35
+ const _ = -90, L = 90, C = -180, G = 180, p = (t, r) => f(t.coordinates, r, { units: "kilometers", steps: 32 }), I = (t, r) => {
36
+ if (t.geometry?.type === "FeatureCollection") {
37
+ let e = [];
38
+ for (const o of t.geometry.features)
39
+ if (o.geometry?.type === "Point") {
40
+ const { geometry: i, type: n } = p(o.geometry, r);
41
+ e.push({
42
+ ...o,
43
+ geometry: i,
44
+ type: n
45
+ });
46
+ }
47
+ return {
48
+ ...t,
49
+ geometry: {
50
+ type: "GeometryCollection",
51
+ geometries: e
52
+ }
53
+ };
54
+ } else {
55
+ if (t?.type === "GeometryCollection")
56
+ return {
57
+ ...t,
58
+ geometries: t.geometries.map((e) => e.type === "Point" ? p(e, r) : e)
59
+ };
60
+ if (t.geometry?.type === "Point") {
61
+ const { geometry: e, type: o } = p(t.geometry, r);
62
+ return {
63
+ ...t,
64
+ geometry: e,
65
+ type: o
66
+ };
67
+ }
48
68
  }
49
- }, b = (t, r) => {
50
- const e = [];
51
- for (const o of t) {
52
- const i = s(o, r);
53
- i && e.push(i);
54
- }
55
- return a(e);
56
- }, v = (t, r, e = {}) => {
57
- const o = new u(r);
69
+ return t;
70
+ }, M = (t, r, e = {}) => {
71
+ const o = new c(r);
58
72
  t.addLayer(o), e.url ? o.addGeoreferenceAnnotationByUrl(e.url) : e.manifest && o.addGeoreferenceAnnotation(e.manifest), e.opacity && o.setOpacity(e.opacity);
59
- }, x = (t, r = null) => {
73
+ }, b = (t, r = null) => {
60
74
  const e = m(t);
61
- if (!l(e))
75
+ if (!a(e))
62
76
  return null;
63
- const o = y(e);
77
+ const o = u(e);
64
78
  let i;
65
- return r ? i = d(o, r, { units: "miles" }) : i = o, m(i);
66
- }, A = (t, r) => t && t.removeLayer(r), B = (t, r, e, o) => {
79
+ return r ? i = y(o, r, { units: "miles" }) : i = o, m(i);
80
+ }, v = (t, r) => t && t.removeLayer(r), x = (t, r, e, o) => {
67
81
  const i = {
68
82
  id: t.record_id,
69
83
  ccode: [],
@@ -71,32 +85,31 @@ const _ = -90, L = 90, I = -180, M = 180, n = (t, r) => g(t.coordinates, r, { un
71
85
  uuid: t.uuid,
72
86
  record_id: t.record_id,
73
87
  name: t.name,
74
- names: t.names?.map((f) => ({ toponym: f })),
88
+ names: t.names?.map((s) => ({ toponym: s })),
75
89
  type: t.type,
76
90
  items: [r],
77
91
  url: t.url,
78
92
  originalProperties: o || {}
79
- }, c = parseInt(t.record_id, 10);
80
- return C(e, i, { id: c });
81
- }, F = (t) => a(t), l = (t) => p.every(t, p.isFinite), G = (t) => {
93
+ }, n = parseInt(t.record_id, 10);
94
+ return g(e, i, { id: n });
95
+ }, A = (t) => d(t), a = (t) => l.every(t, l.isFinite), B = (t) => {
82
96
  let r = !1;
83
97
  if (t) {
84
98
  const [e, o] = t;
85
- r = e >= _ && e <= L && o >= I && o <= M;
99
+ r = e >= _ && e <= L && o >= C && o <= G;
86
100
  }
87
101
  return r;
88
- }, st = {
89
- addGeoreferenceLayer: v,
90
- getCertaintyCircle: s,
91
- getCertaintyCircleFeatureCollection: b,
92
- getBoundingBox: x,
93
- removeLayer: A,
94
- toFeature: B,
95
- toFeatureCollection: F,
96
- validateBoundingBox: l,
97
- validateCoordinates: G
102
+ }, lt = {
103
+ addGeoreferenceLayer: M,
104
+ toCertaintyCircle: I,
105
+ getBoundingBox: b,
106
+ removeLayer: v,
107
+ toFeature: x,
108
+ toFeatureCollection: A,
109
+ validateBoundingBox: a,
110
+ validateCoordinates: B
98
111
  };
99
112
  export {
100
- st as default
113
+ lt as default
101
114
  };
102
115
  //# sourceMappingURL=index.es13.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es13.js","sources":["../src/utils/Map.js"],"sourcesContent":["// @flow\n\nimport { WarpedMapLayer } from '@allmaps/maplibre';\nimport {\n bbox,\n bboxPolygon,\n buffer,\n feature,\n featureCollection\n} from '@turf/turf';\nimport _ from 'underscore';\nimport circle from '@turf/circle';\n\nconst MIN_LATITUDE = -90;\nconst MAX_LATITUDE = 90;\nconst MIN_LONGITUDE = -180;\nconst MAX_LONGITUDE = 180;\n\n/**\n * Returns a GeoJSON circle feature with the given center point and radius.\n * @param point - The center point of the circle.\n * @param radius - The radius of the circle in kilometers.\n * @returns {Feature<Geometry, Properties>} - The GeoJSON circle feature.\n */\nconst buildCircle = (point, radius) => (\n circle(point.coordinates, radius, { units: 'kilometers', steps: 32 })\n);\n\nconst getCertaintyCircle = (item, getCertaintyRadius: (item: any) => number | undefined) => {\n const certaintyRadius = getCertaintyRadius(item);\n\n if (certaintyRadius) {\n if (item.geometry?.type === 'FeatureCollection') {\n for (const childFeature of item.geometry.features) {\n if (childFeature.geometry?.type === 'Point') {\n return buildCircle(childFeature.geometry, certaintyRadius);\n }\n }\n } else if (item.geometry?.type === 'GeometryCollection') {\n for (const geometry of item.geometry.geometries) {\n if (geometry.type === 'Point') {\n return buildCircle(geometry, certaintyRadius);\n }\n }\n } else if (item.geometry?.type === 'Point') {\n return buildCircle(item.geometry, certaintyRadius);\n }\n }\n};\n\n/**\n * Returns a GeoJSON feature collection containing circles for each item in the given array.\n */\nconst getCertaintyCircleFeatureCollection = (\n items,\n getCertaintyRadius: (item: any) => number | undefined\n) => {\n const features = [];\n\n for (const item of items) {\n const circle = getCertaintyCircle(item, getCertaintyRadius);\n if (circle) {\n features.push(circle);\n }\n }\n\n return featureCollection(features);\n};\n\n/**\n * Adds the geo-referenced image layer to the passed map.\n *\n * @param map\n * @param layerId\n * @param options\n */\nconst addGeoreferenceLayer = (map, layerId, options = {}) => {\n const warpedMapLayer = new WarpedMapLayer(layerId);\n map.addLayer(warpedMapLayer);\n\n if (options.url) {\n warpedMapLayer.addGeoreferenceAnnotationByUrl(options.url);\n } else if (options.manifest) {\n warpedMapLayer.addGeoreferenceAnnotation(options.manifest);\n }\n\n if (options.opacity) {\n warpedMapLayer.setOpacity(options.opacity);\n }\n};\n\n/**\n * Returns a bounding box for the passed geometry (with optional buffer).\n *\n * @param data\n * @param bufferDistance\n *\n * @returns {BBox}\n */\nconst getBoundingBox = (data, bufferDistance = null) => {\n // Convert the GeoJSON into a bounding box\n const box = bbox(data);\n\n if (!validateBoundingBox(box)) {\n return null;\n }\n\n // Convert the bounding box to a polygon\n const polygon = bboxPolygon(box);\n\n // Create a buffer around the polygon (if a distance is provided)\n let polygonBuffer;\n\n if (bufferDistance) {\n polygonBuffer = buffer(polygon, bufferDistance, { units: 'miles' });\n } else {\n polygonBuffer = polygon;\n }\n\n // Convert the buffer to a bounding box\n return bbox(polygonBuffer);\n};\n\n/**\n * Removes a layer from the passed map.\n *\n * @param map\n * @param layerId\n *\n * @returns {*}\n */\nconst removeLayer = (map, layerId) => map && map.removeLayer(layerId);\n\n/**\n * Wraps the passed record in a feature.\n *\n * @param record\n * @param item\n * @param geometry\n * @param originalProperties\n *\n * @returns {Feature<Geometry, {\n * id: *,\n * ccode: [],\n * title: *,\n * uuid: *,\n * record_id: *,\n * name: *,\n * names: *,\n * type: *,\n * items: [*],\n * url: *\n * }>}\n */\nconst toFeature = (record: any, item: any, geometry: any, originalProperties?: any) => {\n const properties = {\n id: record.record_id,\n ccode: [],\n title: record.name,\n uuid: record.uuid,\n record_id: record.record_id,\n name: record.name,\n names: record.names?.map((toponym: string) => ({ toponym })),\n type: record.type,\n items: [item],\n url: record.url,\n originalProperties: originalProperties || {}\n };\n\n const id = parseInt(record.record_id, 10);\n return feature(geometry, properties, { id });\n};\n\n/**\n * Returns a feature collection for the passed set of features.\n *\n * @param features\n *\n * @returns {FeatureCollection<Geometry, GeoJsonProperties>}\n */\nconst toFeatureCollection = (features: Array<any>) => featureCollection(features);\n\n/**\n * Validates that the passed bounding box contains finite coordinates.\n *\n * @param boundingBox\n *\n * @returns {*}\n */\nconst validateBoundingBox = (boundingBox: Array<number>) => _.every(boundingBox, _.isFinite);\n\n/**\n * Returns true if the passed coordinates are valid.\n *\n * @param coordinates\n *\n * @returns {boolean}\n */\nconst validateCoordinates = (coordinates) => {\n let valid = false;\n\n if (coordinates) {\n const [latitude, longitude] = coordinates;\n\n valid = latitude >= MIN_LATITUDE\n && latitude <= MAX_LATITUDE\n && longitude >= MIN_LONGITUDE\n && longitude <= MAX_LONGITUDE;\n }\n\n return valid;\n};\n\nexport default {\n addGeoreferenceLayer,\n getCertaintyCircle,\n getCertaintyCircleFeatureCollection,\n getBoundingBox,\n removeLayer,\n toFeature,\n toFeatureCollection,\n validateBoundingBox,\n validateCoordinates\n};\n"],"names":["MIN_LATITUDE","MAX_LATITUDE","MIN_LONGITUDE","MAX_LONGITUDE","buildCircle","point","radius","circle","getCertaintyCircle","item","getCertaintyRadius","certaintyRadius","childFeature","geometry","getCertaintyCircleFeatureCollection","items","features","featureCollection","addGeoreferenceLayer","map","layerId","options","warpedMapLayer","WarpedMapLayer","getBoundingBox","data","bufferDistance","box","bbox","validateBoundingBox","polygon","bboxPolygon","polygonBuffer","buffer","removeLayer","toFeature","record","originalProperties","properties","toponym","id","feature","toFeatureCollection","boundingBox","_","validateCoordinates","coordinates","valid","latitude","longitude","MapUtils"],"mappings":"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"}
1
+ {"version":3,"file":"index.es13.js","sources":["../src/utils/Map.js"],"sourcesContent":["// @flow\n\nimport { WarpedMapLayer } from '@allmaps/maplibre';\nimport {\n bbox,\n bboxPolygon,\n buffer,\n feature,\n featureCollection\n} from '@turf/turf';\nimport _ from 'underscore';\nimport circle from '@turf/circle';\n\nconst MIN_LATITUDE = -90;\nconst MAX_LATITUDE = 90;\nconst MIN_LONGITUDE = -180;\nconst MAX_LONGITUDE = 180;\n\n/**\n * Returns a GeoJSON circle feature with the given center point and radius.\n * @param point - The center point of the circle.\n * @param radius - The radius of the circle in kilometers.\n * @returns {Feature<Geometry, Properties>} - The GeoJSON circle feature.\n */\nconst buildCircle = (point, radius) => (\n circle(point.coordinates, radius, { units: 'kilometers', steps: 32 })\n);\n\nconst toCertaintyCircle = (item, radius: number) => {\n if (item.geometry?.type === 'FeatureCollection') {\n let children = [];\n\n for (const childFeature of item.geometry.features) {\n if (childFeature.geometry?.type === 'Point') {\n const { geometry, type } = buildCircle(childFeature.geometry, radius);\n children.push({\n ...childFeature,\n geometry,\n type\n });\n }\n }\n\n return {\n ...item,\n geometry: {\n type: 'GeometryCollection',\n geometries: children\n }\n };\n } else if (item?.type === 'GeometryCollection') {\n return {\n ...item,\n geometries: item.geometries.map((geometry) => geometry.type === 'Point'\n ? buildCircle(geometry, radius)\n : geometry)\n };\n } else if (item.geometry?.type === 'Point') {\n const { geometry, type } = buildCircle(item.geometry, radius);\n return {\n ...item,\n geometry,\n type\n };\n }\n\n return item;\n};\n\n/**\n * Adds the geo-referenced image layer to the passed map.\n *\n * @param map\n * @param layerId\n * @param options\n */\nconst addGeoreferenceLayer = (map, layerId, options = {}) => {\n const warpedMapLayer = new WarpedMapLayer(layerId);\n map.addLayer(warpedMapLayer);\n\n if (options.url) {\n warpedMapLayer.addGeoreferenceAnnotationByUrl(options.url);\n } else if (options.manifest) {\n warpedMapLayer.addGeoreferenceAnnotation(options.manifest);\n }\n\n if (options.opacity) {\n warpedMapLayer.setOpacity(options.opacity);\n }\n};\n\n/**\n * Returns a bounding box for the passed geometry (with optional buffer).\n *\n * @param data\n * @param bufferDistance\n *\n * @returns {BBox}\n */\nconst getBoundingBox = (data, bufferDistance = null) => {\n // Convert the GeoJSON into a bounding box\n const box = bbox(data);\n\n if (!validateBoundingBox(box)) {\n return null;\n }\n\n // Convert the bounding box to a polygon\n const polygon = bboxPolygon(box);\n\n // Create a buffer around the polygon (if a distance is provided)\n let polygonBuffer;\n\n if (bufferDistance) {\n polygonBuffer = buffer(polygon, bufferDistance, { units: 'miles' });\n } else {\n polygonBuffer = polygon;\n }\n\n // Convert the buffer to a bounding box\n return bbox(polygonBuffer);\n};\n\n/**\n * Removes a layer from the passed map.\n *\n * @param map\n * @param layerId\n *\n * @returns {*}\n */\nconst removeLayer = (map, layerId) => map && map.removeLayer(layerId);\n\n/**\n * Wraps the passed record in a feature.\n *\n * @param record\n * @param item\n * @param geometry\n * @param originalProperties\n *\n * @returns {Feature<Geometry, {\n * id: *,\n * ccode: [],\n * title: *,\n * uuid: *,\n * record_id: *,\n * name: *,\n * names: *,\n * type: *,\n * items: [*],\n * url: *\n * }>}\n */\nconst toFeature = (record: any, item: any, geometry: any, originalProperties?: any) => {\n const properties = {\n id: record.record_id,\n ccode: [],\n title: record.name,\n uuid: record.uuid,\n record_id: record.record_id,\n name: record.name,\n names: record.names?.map((toponym: string) => ({ toponym })),\n type: record.type,\n items: [item],\n url: record.url,\n originalProperties: originalProperties || {}\n };\n\n const id = parseInt(record.record_id, 10);\n return feature(geometry, properties, { id });\n};\n\n/**\n * Returns a feature collection for the passed set of features.\n *\n * @param features\n *\n * @returns {FeatureCollection<Geometry, GeoJsonProperties>}\n */\nconst toFeatureCollection = (features: Array<any>) => featureCollection(features);\n\n/**\n * Validates that the passed bounding box contains finite coordinates.\n *\n * @param boundingBox\n *\n * @returns {*}\n */\nconst validateBoundingBox = (boundingBox: Array<number>) => _.every(boundingBox, _.isFinite);\n\n/**\n * Returns true if the passed coordinates are valid.\n *\n * @param coordinates\n *\n * @returns {boolean}\n */\nconst validateCoordinates = (coordinates) => {\n let valid = false;\n\n if (coordinates) {\n const [latitude, longitude] = coordinates;\n\n valid = latitude >= MIN_LATITUDE\n && latitude <= MAX_LATITUDE\n && longitude >= MIN_LONGITUDE\n && longitude <= MAX_LONGITUDE;\n }\n\n return valid;\n};\n\nexport default {\n addGeoreferenceLayer,\n toCertaintyCircle,\n getBoundingBox,\n removeLayer,\n toFeature,\n toFeatureCollection,\n validateBoundingBox,\n validateCoordinates\n};\n"],"names":["MIN_LATITUDE","MAX_LATITUDE","MIN_LONGITUDE","MAX_LONGITUDE","buildCircle","point","radius","circle","toCertaintyCircle","item","children","childFeature","geometry","type","addGeoreferenceLayer","map","layerId","options","warpedMapLayer","WarpedMapLayer","getBoundingBox","data","bufferDistance","box","bbox","validateBoundingBox","polygon","bboxPolygon","polygonBuffer","buffer","removeLayer","toFeature","record","originalProperties","properties","toponym","id","feature","toFeatureCollection","features","featureCollection","boundingBox","_","validateCoordinates","coordinates","valid","latitude","longitude","MapUtils"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- import { __require as r } from "./index.es76.js";
1
+ import { __require as r } from "./index.es73.js";
2
2
  var i = r();
3
3
  export {
4
4
  i as j
@@ -1,4 +1,4 @@
1
- import { getDefaultExportFromCjs as r } from "./index.es74.js";
1
+ import { getDefaultExportFromCjs as r } from "./index.es80.js";
2
2
  import { __require as t } from "./index.es240.js";
3
3
  var s = t();
4
4
  const m = /* @__PURE__ */ r(s);
package/dist/index.es2.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { j as r } from "./index.es15.js";
2
- import "react";
2
+ import { useMemo as e } from "react";
3
3
  import "./index.es16.js";
4
4
  import "./index.es17.js";
5
5
  import "./index.es18.js";
@@ -11,19 +11,19 @@ import "./index.es23.js";
11
11
  import "./index.es24.js";
12
12
  import "./index.es25.js";
13
13
  import { Source as m } from "./index.es26.js";
14
- import { Layer as p } from "./index.es27.js";
14
+ import { Layer as a } from "./index.es27.js";
15
15
  import "./index.es28.js";
16
16
  import i from "./index.es14.js";
17
- import e from "./index.es13.js";
18
- const h = (t) => {
19
- const o = e.getCertaintyCircles([t.geometry], () => t.certaintyRadius);
17
+ import p from "./index.es13.js";
18
+ const E = (t) => {
19
+ const o = e(() => t.geometry ? p.toCertaintyCircle(t.geometry, t.certaintyRadius) : {}, [t.geometry, t.certaintyRadius]);
20
20
  return /* @__PURE__ */ r.jsx(
21
21
  m,
22
22
  {
23
23
  data: o,
24
24
  type: "geojson",
25
25
  children: /* @__PURE__ */ r.jsx(
26
- p,
26
+ a,
27
27
  {
28
28
  ...i.fill,
29
29
  id: "certainty-layer",
@@ -36,6 +36,6 @@ const h = (t) => {
36
36
  );
37
37
  };
38
38
  export {
39
- h as default
39
+ E as default
40
40
  };
41
41
  //# sourceMappingURL=index.es2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es2.js","sources":["../src/components/CertaintyLayer.js"],"sourcesContent":["// @flow\n\nimport React from 'react';\nimport { Layer, Source } from 'react-map-gl/maplibre';\nimport MapStyles from '../utils/MapStyles';\nimport MapUtils from '../utils/Map';\n\ntype Props = {\n geometry?: any,\n certaintyRadius: number\n};\n\n/**\n * Renders circles with the given certainty_radius circumference around all points in a new layer.\n */\nconst CertaintyLayer = (props: Props) => {\n const circles = MapUtils.getCertaintyCircles([props.geometry], () => props.certaintyRadius);\n\n return (\n <Source\n data={circles}\n type='geojson'\n >\n <Layer\n {...MapStyles.fill}\n id='certainty-layer'\n paint={{\n ...MapStyles.fill.paint,\n }}\n />\n </Source>\n );\n};\n\nexport default CertaintyLayer;\n\n"],"names":["CertaintyLayer","props","circles","MapUtils","jsx","Source","Layer","MapStyles"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAMA,IAAiB,CAACC,MAAiB;AACvC,QAAMC,IAAUC,EAAS,oBAAoB,CAACF,EAAM,QAAQ,GAAG,MAAMA,EAAM,eAAe;AAE1F,SACEG,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMH;AAAA,MACN,MAAK;AAAA,MAEL,UAAAE,gBAAAA,EAAAA;AAAAA,QAACE;AAAA,QAAA;AAAA,UACE,GAAGC,EAAU;AAAA,UACd,IAAG;AAAA,UACH,OAAO;AAAA,YACL,GAAGA,EAAU,KAAK;AAAA,UAAA;AAAA,QACpB;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"index.es2.js","sources":["../src/components/CertaintyLayer.js"],"sourcesContent":["// @flow\n\nimport React, { useMemo } from 'react';\nimport { Layer, Source } from 'react-map-gl/maplibre';\nimport MapStyles from '../utils/MapStyles';\nimport MapUtils from '../utils/Map';\n\ntype Props = {\n geometry?: any,\n certaintyRadius: number\n};\n\n/**\n * Renders circles with the given certainty_radius circumference around all points in a new layer.\n */\nconst CertaintyLayer = (props: Props) => {\n const data = useMemo(() => {\n if (props.geometry) {\n return MapUtils.toCertaintyCircle(props.geometry, props.certaintyRadius);\n } else {\n return {};\n }\n }, [props.geometry, props.certaintyRadius]);\n\n return (\n <Source\n data={data}\n type='geojson'\n >\n <Layer\n {...MapStyles.fill}\n id='certainty-layer'\n paint={{\n ...MapStyles.fill.paint\n }}\n />\n </Source>\n );\n};\n\nexport default CertaintyLayer;\n\n"],"names":["CertaintyLayer","props","data","useMemo","MapUtils","jsx","Source","Layer","MapStyles"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAMA,IAAiB,CAACC,MAAiB;AACvC,QAAMC,IAAOC,EAAQ,MACfF,EAAM,WACDG,EAAS,kBAAkBH,EAAM,UAAUA,EAAM,eAAe,IAEhE,CAAA,GAER,CAACA,EAAM,UAAUA,EAAM,eAAe,CAAC;AAE1C,SACEI,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAJ;AAAA,MACA,MAAK;AAAA,MAEL,UAAAG,gBAAAA,EAAAA;AAAAA,QAACE;AAAA,QAAA;AAAA,UACE,GAAGC,EAAU;AAAA,UACd,IAAG;AAAA,UACH,OAAO;AAAA,YACL,GAAGA,EAAU,KAAK;AAAA,UAAA;AAAA,QACpB;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
@@ -1,5 +1,5 @@
1
- import { transformToViewState as d, applyViewStateToTransform as p } from "./index.es242.js";
2
- import { normalizeStyle as l } from "./index.es243.js";
1
+ import { transformToViewState as d, applyViewStateToTransform as p } from "./index.es243.js";
2
+ import { normalizeStyle as l } from "./index.es244.js";
3
3
  import { deepEqual as i } from "./index.es210.js";
4
4
  const u = { version: 8, sources: {}, layers: [] }, h = {
5
5
  mousedown: "onMouseDown",
@@ -1,4 +1,4 @@
1
- import e from "./index.es244.js";
1
+ import e from "./index.es246.js";
2
2
  import t from "./index.es217.js";
3
3
  const f = e(t);
4
4
  export {
@@ -1,4 +1,4 @@
1
- import t from "./index.es246.js";
1
+ import t from "./index.es245.js";
2
2
  const o = t("length");
3
3
  export {
4
4
  o as default
@@ -1,4 +1,4 @@
1
- import t from "./index.es246.js";
1
+ import t from "./index.es245.js";
2
2
  const o = t("byteLength");
3
3
  export {
4
4
  o as default
@@ -1,4 +1,4 @@
1
- import e from "./index.es244.js";
1
+ import e from "./index.es246.js";
2
2
  import r from "./index.es216.js";
3
3
  const i = e(r);
4
4
  export {
@@ -1,24 +1,6 @@
1
- import { deepEqual as a } from "./index.es210.js";
2
- function g(i) {
3
- return {
4
- longitude: i.center.lng,
5
- latitude: i.center.lat,
6
- zoom: i.zoom,
7
- pitch: i.pitch,
8
- bearing: i.bearing,
9
- padding: i.padding
10
- };
11
- }
12
- function c(i, t) {
13
- const n = t.viewState || t, e = {};
14
- if ("longitude" in n && "latitude" in n && (n.longitude !== i.center.lng || n.latitude !== i.center.lat)) {
15
- const o = i.center.constructor;
16
- e.center = new o(n.longitude, n.latitude);
17
- }
18
- return "zoom" in n && n.zoom !== i.zoom && (e.zoom = n.zoom), "bearing" in n && n.bearing !== i.bearing && (e.bearing = n.bearing), "pitch" in n && n.pitch !== i.pitch && (e.pitch = n.pitch), n.padding && i.padding && !a(n.padding, i.padding) && (e.padding = n.padding), e;
19
- }
1
+ import t from "./index.es213.js";
2
+ const a = t("Object");
20
3
  export {
21
- c as applyViewStateToTransform,
22
- g as transformToViewState
4
+ a as default
23
5
  };
24
6
  //# sourceMappingURL=index.es242.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es242.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/utils/transform.js"],"sourcesContent":["import { deepEqual } from \"./deep-equal.js\";\n/**\n * Capture a transform's current state\n * @param transform\n * @returns descriptor of the view state\n */\nexport function transformToViewState(tr) {\n return {\n longitude: tr.center.lng,\n latitude: tr.center.lat,\n zoom: tr.zoom,\n pitch: tr.pitch,\n bearing: tr.bearing,\n padding: tr.padding\n };\n}\n/* eslint-disable complexity */\n/**\n * Applies requested view state to a transform\n * @returns an object containing detected changes\n */\nexport function applyViewStateToTransform(\n/** An object that describes Maplibre's camera state */\ntr, \n/** Props from Map component */\nprops) {\n const v = props.viewState || props;\n const changes = {};\n if ('longitude' in v &&\n 'latitude' in v &&\n (v.longitude !== tr.center.lng || v.latitude !== tr.center.lat)) {\n const LngLat = tr.center.constructor;\n // @ts-expect-error we should not import LngLat class from maplibre-gl because we don't know the source of mapLib\n changes.center = new LngLat(v.longitude, v.latitude);\n }\n if ('zoom' in v && v.zoom !== tr.zoom) {\n changes.zoom = v.zoom;\n }\n if ('bearing' in v && v.bearing !== tr.bearing) {\n changes.bearing = v.bearing;\n }\n if ('pitch' in v && v.pitch !== tr.pitch) {\n changes.pitch = v.pitch;\n }\n if (v.padding && tr.padding && !deepEqual(v.padding, tr.padding)) {\n changes.padding = v.padding;\n }\n return changes;\n}\n//# sourceMappingURL=transform.js.map"],"names":["transformToViewState","tr","applyViewStateToTransform","props","v","changes","LngLat","deepEqual"],"mappings":";AAMO,SAASA,EAAqBC,GAAI;AACrC,SAAO;AAAA,IACH,WAAWA,EAAG,OAAO;AAAA,IACrB,UAAUA,EAAG,OAAO;AAAA,IACpB,MAAMA,EAAG;AAAA,IACT,OAAOA,EAAG;AAAA,IACV,SAASA,EAAG;AAAA,IACZ,SAASA,EAAG;AAAA,EAAA;AAEpB;AAMO,SAASC,EAEhBD,GAEAE,GAAO;AACH,QAAMC,IAAID,EAAM,aAAaA,GACvBE,IAAU,CAAA;AAChB,MAAI,eAAeD,KACf,cAAcA,MACbA,EAAE,cAAcH,EAAG,OAAO,OAAOG,EAAE,aAAaH,EAAG,OAAO,MAAM;AACjE,UAAMK,IAASL,EAAG,OAAO;AAEzB,IAAAI,EAAQ,SAAS,IAAIC,EAAOF,EAAE,WAAWA,EAAE,QAAQ;AAAA,EACvD;AACA,SAAI,UAAUA,KAAKA,EAAE,SAASH,EAAG,SAC7BI,EAAQ,OAAOD,EAAE,OAEjB,aAAaA,KAAKA,EAAE,YAAYH,EAAG,YACnCI,EAAQ,UAAUD,EAAE,UAEpB,WAAWA,KAAKA,EAAE,UAAUH,EAAG,UAC/BI,EAAQ,QAAQD,EAAE,QAElBA,EAAE,WAAWH,EAAG,WAAW,CAACM,EAAUH,EAAE,SAASH,EAAG,OAAO,MAC3DI,EAAQ,UAAUD,EAAE,UAEjBC;AACX;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es242.js","sources":["../node_modules/underscore/modules/_hasObjectTag.js"],"sourcesContent":["import tagTester from './_tagTester.js';\n\nexport default tagTester('Object');\n"],"names":["hasObjectTag","tagTester"],"mappings":";AAEA,MAAAA,IAAeC,EAAU,QAAQ;","x_google_ignoreList":[0]}
@@ -1,26 +1,24 @@
1
- const a = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
2
- function c(r) {
3
- if (!r)
4
- return null;
5
- if (typeof r == "string" || ("toJS" in r && (r = r.toJS()), !r.layers))
6
- return r;
7
- const t = {};
8
- for (const e of r.layers)
9
- t[e.id] = e;
10
- const f = r.layers.map((e) => {
11
- let n = null;
12
- "interactive" in e && (n = Object.assign({}, e), delete n.interactive);
13
- const o = t[e.ref];
14
- if (o) {
15
- n = n || Object.assign({}, e), delete n.ref;
16
- for (const i of a)
17
- i in o && (n[i] = o[i]);
18
- }
19
- return n || e;
20
- });
21
- return { ...r, layers: f };
1
+ import { deepEqual as a } from "./index.es210.js";
2
+ function g(i) {
3
+ return {
4
+ longitude: i.center.lng,
5
+ latitude: i.center.lat,
6
+ zoom: i.zoom,
7
+ pitch: i.pitch,
8
+ bearing: i.bearing,
9
+ padding: i.padding
10
+ };
11
+ }
12
+ function c(i, t) {
13
+ const n = t.viewState || t, e = {};
14
+ if ("longitude" in n && "latitude" in n && (n.longitude !== i.center.lng || n.latitude !== i.center.lat)) {
15
+ const o = i.center.constructor;
16
+ e.center = new o(n.longitude, n.latitude);
17
+ }
18
+ return "zoom" in n && n.zoom !== i.zoom && (e.zoom = n.zoom), "bearing" in n && n.bearing !== i.bearing && (e.bearing = n.bearing), "pitch" in n && n.pitch !== i.pitch && (e.pitch = n.pitch), n.padding && i.padding && !a(n.padding, i.padding) && (e.padding = n.padding), e;
22
19
  }
23
20
  export {
24
- c as normalizeStyle
21
+ c as applyViewStateToTransform,
22
+ g as transformToViewState
25
23
  };
26
24
  //# sourceMappingURL=index.es243.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es243.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js"],"sourcesContent":["const refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(style) {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n const layers = style.layers.map(layer => {\n let normalizedLayer = null;\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n return normalizedLayer || layer;\n });\n // Do not mutate the style object provided by the user\n return { ...style, layers };\n}\n//# sourceMappingURL=style-utils.js.map"],"names":["refProps","normalizeStyle","style","layerIndex","layer","layers","normalizedLayer","layerRef","propName"],"mappings":"AAAA,MAAMA,IAAW,CAAC,QAAQ,UAAU,gBAAgB,WAAW,WAAW,UAAU,QAAQ;AAIrF,SAASC,EAAeC,GAAO;AAClC,MAAI,CAACA;AACD,WAAO;AAQX,MANI,OAAOA,KAAU,aAGjB,UAAUA,MACVA,IAAQA,EAAM,KAAA,IAEd,CAACA,EAAM;AACP,WAAOA;AAEX,QAAMC,IAAa,CAAA;AACnB,aAAWC,KAASF,EAAM;AACtB,IAAAC,EAAWC,EAAM,EAAE,IAAIA;AAE3B,QAAMC,IAASH,EAAM,OAAO,IAAI,CAAAE,MAAS;AACrC,QAAIE,IAAkB;AACtB,IAAI,iBAAiBF,MACjBE,IAAkB,OAAO,OAAO,CAAA,GAAIF,CAAK,GAGzC,OAAOE,EAAgB;AAI3B,UAAMC,IAAWJ,EAAWC,EAAM,GAAG;AACrC,QAAIG,GAAU;AACV,MAAAD,IAAkBA,KAAmB,OAAO,OAAO,CAAA,GAAIF,CAAK,GAE5D,OAAOE,EAAgB;AAEvB,iBAAWE,KAAYR;AACnB,QAAIQ,KAAYD,MACZD,EAAgBE,CAAQ,IAAID,EAASC,CAAQ;AAAA,IAGzD;AACA,WAAOF,KAAmBF;AAAA,EAC9B,CAAC;AAED,SAAO,EAAE,GAAGF,GAAO,QAAAG,EAAA;AACvB;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es243.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/utils/transform.js"],"sourcesContent":["import { deepEqual } from \"./deep-equal.js\";\n/**\n * Capture a transform's current state\n * @param transform\n * @returns descriptor of the view state\n */\nexport function transformToViewState(tr) {\n return {\n longitude: tr.center.lng,\n latitude: tr.center.lat,\n zoom: tr.zoom,\n pitch: tr.pitch,\n bearing: tr.bearing,\n padding: tr.padding\n };\n}\n/* eslint-disable complexity */\n/**\n * Applies requested view state to a transform\n * @returns an object containing detected changes\n */\nexport function applyViewStateToTransform(\n/** An object that describes Maplibre's camera state */\ntr, \n/** Props from Map component */\nprops) {\n const v = props.viewState || props;\n const changes = {};\n if ('longitude' in v &&\n 'latitude' in v &&\n (v.longitude !== tr.center.lng || v.latitude !== tr.center.lat)) {\n const LngLat = tr.center.constructor;\n // @ts-expect-error we should not import LngLat class from maplibre-gl because we don't know the source of mapLib\n changes.center = new LngLat(v.longitude, v.latitude);\n }\n if ('zoom' in v && v.zoom !== tr.zoom) {\n changes.zoom = v.zoom;\n }\n if ('bearing' in v && v.bearing !== tr.bearing) {\n changes.bearing = v.bearing;\n }\n if ('pitch' in v && v.pitch !== tr.pitch) {\n changes.pitch = v.pitch;\n }\n if (v.padding && tr.padding && !deepEqual(v.padding, tr.padding)) {\n changes.padding = v.padding;\n }\n return changes;\n}\n//# sourceMappingURL=transform.js.map"],"names":["transformToViewState","tr","applyViewStateToTransform","props","v","changes","LngLat","deepEqual"],"mappings":";AAMO,SAASA,EAAqBC,GAAI;AACrC,SAAO;AAAA,IACH,WAAWA,EAAG,OAAO;AAAA,IACrB,UAAUA,EAAG,OAAO;AAAA,IACpB,MAAMA,EAAG;AAAA,IACT,OAAOA,EAAG;AAAA,IACV,SAASA,EAAG;AAAA,IACZ,SAASA,EAAG;AAAA,EAAA;AAEpB;AAMO,SAASC,EAEhBD,GAEAE,GAAO;AACH,QAAMC,IAAID,EAAM,aAAaA,GACvBE,IAAU,CAAA;AAChB,MAAI,eAAeD,KACf,cAAcA,MACbA,EAAE,cAAcH,EAAG,OAAO,OAAOG,EAAE,aAAaH,EAAG,OAAO,MAAM;AACjE,UAAMK,IAASL,EAAG,OAAO;AAEzB,IAAAI,EAAQ,SAAS,IAAIC,EAAOF,EAAE,WAAWA,EAAE,QAAQ;AAAA,EACvD;AACA,SAAI,UAAUA,KAAKA,EAAE,SAASH,EAAG,SAC7BI,EAAQ,OAAOD,EAAE,OAEjB,aAAaA,KAAKA,EAAE,YAAYH,EAAG,YACnCI,EAAQ,UAAUD,EAAE,UAEpB,WAAWA,KAAKA,EAAE,UAAUH,EAAG,UAC/BI,EAAQ,QAAQD,EAAE,QAElBA,EAAE,WAAWH,EAAG,WAAW,CAACM,EAAUH,EAAE,SAASH,EAAG,OAAO,MAC3DI,EAAQ,UAAUD,EAAE,UAEjBC;AACX;","x_google_ignoreList":[0]}
@@ -1,11 +1,26 @@
1
- import { MAX_ARRAY_INDEX as o } from "./index.es37.js";
2
- function u(e) {
3
- return function(t) {
4
- var r = e(t);
5
- return typeof r == "number" && r >= 0 && r <= o;
6
- };
1
+ const a = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"];
2
+ function c(r) {
3
+ if (!r)
4
+ return null;
5
+ if (typeof r == "string" || ("toJS" in r && (r = r.toJS()), !r.layers))
6
+ return r;
7
+ const t = {};
8
+ for (const e of r.layers)
9
+ t[e.id] = e;
10
+ const f = r.layers.map((e) => {
11
+ let n = null;
12
+ "interactive" in e && (n = Object.assign({}, e), delete n.interactive);
13
+ const o = t[e.ref];
14
+ if (o) {
15
+ n = n || Object.assign({}, e), delete n.ref;
16
+ for (const i of a)
17
+ i in o && (n[i] = o[i]);
18
+ }
19
+ return n || e;
20
+ });
21
+ return { ...r, layers: f };
7
22
  }
8
23
  export {
9
- u as default
24
+ c as normalizeStyle
10
25
  };
11
26
  //# sourceMappingURL=index.es244.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es244.js","sources":["../node_modules/underscore/modules/_createSizePropertyCheck.js"],"sourcesContent":["import { MAX_ARRAY_INDEX } from './_setup.js';\n\n// Common internal logic for `isArrayLike` and `isBufferLike`.\nexport default function createSizePropertyCheck(getSizeProperty) {\n return function(collection) {\n var sizeProperty = getSizeProperty(collection);\n return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n }\n}\n"],"names":["createSizePropertyCheck","getSizeProperty","collection","sizeProperty","MAX_ARRAY_INDEX"],"mappings":";AAGA,SAAwBA,EAAwBC,GAAiB;AAC/D,SAAO,SAASC,GAAY;AAC1B,QAAIC,IAAeF,EAAgBC,CAAU;AAC7C,WAAO,OAAOC,KAAgB,YAAYA,KAAgB,KAAKA,KAAgBC;AAAA,EACjF;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es244.js","sources":["../../../node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js"],"sourcesContent":["const refProps = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n// Prepare a map style object for diffing\n// If immutable - convert to plain object\n// Work around some issues in older styles that would fail Mapbox's diffing\nexport function normalizeStyle(style) {\n if (!style) {\n return null;\n }\n if (typeof style === 'string') {\n return style;\n }\n if ('toJS' in style) {\n style = style.toJS();\n }\n if (!style.layers) {\n return style;\n }\n const layerIndex = {};\n for (const layer of style.layers) {\n layerIndex[layer.id] = layer;\n }\n const layers = style.layers.map(layer => {\n let normalizedLayer = null;\n if ('interactive' in layer) {\n normalizedLayer = Object.assign({}, layer);\n // Breaks style diffing :(\n // @ts-ignore legacy field not typed\n delete normalizedLayer.interactive;\n }\n // Style diffing doesn't work with refs so expand them out manually before diffing.\n // @ts-ignore legacy field not typed\n const layerRef = layerIndex[layer.ref];\n if (layerRef) {\n normalizedLayer = normalizedLayer || Object.assign({}, layer);\n // @ts-ignore\n delete normalizedLayer.ref;\n // https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/deref.js\n for (const propName of refProps) {\n if (propName in layerRef) {\n normalizedLayer[propName] = layerRef[propName];\n }\n }\n }\n return normalizedLayer || layer;\n });\n // Do not mutate the style object provided by the user\n return { ...style, layers };\n}\n//# sourceMappingURL=style-utils.js.map"],"names":["refProps","normalizeStyle","style","layerIndex","layer","layers","normalizedLayer","layerRef","propName"],"mappings":"AAAA,MAAMA,IAAW,CAAC,QAAQ,UAAU,gBAAgB,WAAW,WAAW,UAAU,QAAQ;AAIrF,SAASC,EAAeC,GAAO;AAClC,MAAI,CAACA;AACD,WAAO;AAQX,MANI,OAAOA,KAAU,aAGjB,UAAUA,MACVA,IAAQA,EAAM,KAAA,IAEd,CAACA,EAAM;AACP,WAAOA;AAEX,QAAMC,IAAa,CAAA;AACnB,aAAWC,KAASF,EAAM;AACtB,IAAAC,EAAWC,EAAM,EAAE,IAAIA;AAE3B,QAAMC,IAASH,EAAM,OAAO,IAAI,CAAAE,MAAS;AACrC,QAAIE,IAAkB;AACtB,IAAI,iBAAiBF,MACjBE,IAAkB,OAAO,OAAO,CAAA,GAAIF,CAAK,GAGzC,OAAOE,EAAgB;AAI3B,UAAMC,IAAWJ,EAAWC,EAAM,GAAG;AACrC,QAAIG,GAAU;AACV,MAAAD,IAAkBA,KAAmB,OAAO,OAAO,CAAA,GAAIF,CAAK,GAE5D,OAAOE,EAAgB;AAEvB,iBAAWE,KAAYR;AACnB,QAAIQ,KAAYD,MACZD,EAAgBE,CAAQ,IAAID,EAASC,CAAQ;AAAA,IAGzD;AACA,WAAOF,KAAmBF;AAAA,EAC9B,CAAC;AAED,SAAO,EAAE,GAAGF,GAAO,QAAAG,EAAA;AACvB;","x_google_ignoreList":[0]}
@@ -1,6 +1,9 @@
1
- import t from "./index.es213.js";
2
- const a = t("Object");
1
+ function t(r) {
2
+ return function(n) {
3
+ return n?.[r];
4
+ };
5
+ }
3
6
  export {
4
- a as default
7
+ t as default
5
8
  };
6
9
  //# sourceMappingURL=index.es245.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es245.js","sources":["../node_modules/underscore/modules/_hasObjectTag.js"],"sourcesContent":["import tagTester from './_tagTester.js';\n\nexport default tagTester('Object');\n"],"names":["hasObjectTag","tagTester"],"mappings":";AAEA,MAAAA,IAAeC,EAAU,QAAQ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es245.js","sources":["../node_modules/underscore/modules/_shallowProperty.js"],"sourcesContent":["// Internal helper to generate a function to obtain property `key` from `obj`.\nexport default function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n}\n"],"names":["shallowProperty","key","obj"],"mappings":"AACA,SAAwBA,EAAgBC,GAAK;AAC3C,SAAO,SAASC,GAAK;AACnB,WAA8BA,IAAID,CAAG;AAAA,EACvC;AACF;","x_google_ignoreList":[0]}
@@ -1,9 +1,11 @@
1
- function t(r) {
2
- return function(n) {
3
- return n?.[r];
1
+ import { MAX_ARRAY_INDEX as o } from "./index.es37.js";
2
+ function u(e) {
3
+ return function(t) {
4
+ var r = e(t);
5
+ return typeof r == "number" && r >= 0 && r <= o;
4
6
  };
5
7
  }
6
8
  export {
7
- t as default
9
+ u as default
8
10
  };
9
11
  //# sourceMappingURL=index.es246.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es246.js","sources":["../node_modules/underscore/modules/_shallowProperty.js"],"sourcesContent":["// Internal helper to generate a function to obtain property `key` from `obj`.\nexport default function shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n}\n"],"names":["shallowProperty","key","obj"],"mappings":"AACA,SAAwBA,EAAgBC,GAAK;AAC3C,SAAO,SAASC,GAAK;AACnB,WAA8BA,IAAID,CAAG;AAAA,EACvC;AACF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es246.js","sources":["../node_modules/underscore/modules/_createSizePropertyCheck.js"],"sourcesContent":["import { MAX_ARRAY_INDEX } from './_setup.js';\n\n// Common internal logic for `isArrayLike` and `isBufferLike`.\nexport default function createSizePropertyCheck(getSizeProperty) {\n return function(collection) {\n var sizeProperty = getSizeProperty(collection);\n return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n }\n}\n"],"names":["createSizePropertyCheck","getSizeProperty","collection","sizeProperty","MAX_ARRAY_INDEX"],"mappings":";AAGA,SAAwBA,EAAwBC,GAAiB;AAC/D,SAAO,SAASC,GAAY;AAC1B,QAAIC,IAAeF,EAAgBC,CAAU;AAC7C,WAAO,OAAOC,KAAgB,YAAYA,KAAgB,KAAKA,KAAgBC;AAAA,EACjF;AACF;","x_google_ignoreList":[0]}
@@ -1,4 +1,4 @@
1
- import o from "./index.es268.js";
1
+ import o from "./index.es265.js";
2
2
  function e() {
3
3
  var n = [], t;
4
4
  return {
@@ -1,4 +1,4 @@
1
- import a from "./index.es266.js";
1
+ import a from "./index.es267.js";
2
2
  function g(f, v, h, o) {
3
3
  this.x = f, this.z = v, this.o = h, this.e = o, this.v = !1, this.n = this.p = null;
4
4
  }
@@ -1,4 +1,4 @@
1
- import L from "./index.es265.js";
1
+ import L from "./index.es268.js";
2
2
  import { pi as f, halfPi as A, abs as N, epsilon as l, atan as P, sin as v, cos as S } from "./index.es250.js";
3
3
  const j = L(
4
4
  function() {
@@ -1,8 +1,8 @@
1
1
  import { cartesian as Q, cartesianCross as T, cartesianDot as R, cartesianScale as g, cartesianAddInPlace as y, spherical as U } from "./index.es249.js";
2
2
  import { circleStream as $ } from "./index.es248.js";
3
3
  import { pi as v, cos as F, epsilon as x, abs as G, sqrt as b } from "./index.es250.js";
4
- import J from "./index.es266.js";
5
- import m from "./index.es265.js";
4
+ import J from "./index.es267.js";
5
+ import m from "./index.es268.js";
6
6
  function fn(S, V) {
7
7
  var A = F(S), C = A > 0, W = G(A) > x;
8
8
  function X(n, i, o, e) {
@@ -1,5 +1,5 @@
1
1
  import c from "./index.es264.js";
2
- import n from "./index.es267.js";
2
+ import n from "./index.es266.js";
3
3
  function S(l, a, r) {
4
4
  var f = a[1][0] - a[0][0], m = a[1][1] - a[0][1], i = l.clipExtent && l.clipExtent();
5
5
  l.scale(150).translate([0, 0]), i != null && l.clipExtent(null), c(r, l.stream(n));