@react-fabric/map 1.0.0-beta.62 → 1.0.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 (68) hide show
  1. package/dist/cjs/index.js +24 -18
  2. package/dist/cjs/layers/Json.js +6 -6
  3. package/dist/cjs/layers/Marker.js +6 -10
  4. package/dist/cjs/markers/Fill.js +14 -14
  5. package/dist/cjs/markers/Pin.js +11 -11
  6. package/dist/cjs/markers/context.js +34 -0
  7. package/dist/cjs/renderers/Heatmap.js +9 -9
  8. package/dist/cjs/renderers/Simple.js +5 -4
  9. package/dist/cjs/tools/BasemapGallery.js +8 -9
  10. package/dist/cjs/tools/Home.js +21 -22
  11. package/dist/cjs/tools/LayerList.js +4 -5
  12. package/dist/cjs/tools/ScaleBar.js +3 -4
  13. package/dist/cjs/tools/Zoom.js +5 -6
  14. package/dist/cjs/viewer/{Context.js → Provider.js} +10 -18
  15. package/dist/cjs/viewer/Viewer.js +4 -4
  16. package/dist/cjs/viewer/context.js +34 -0
  17. package/dist/esm/index.js +23 -19
  18. package/dist/esm/layers/Json.js +5 -5
  19. package/dist/esm/layers/Marker.js +7 -10
  20. package/dist/esm/markers/Fill.js +13 -13
  21. package/dist/esm/markers/Pin.js +9 -9
  22. package/dist/esm/markers/context.js +33 -0
  23. package/dist/esm/renderers/Heatmap.js +9 -9
  24. package/dist/esm/renderers/Simple.js +5 -4
  25. package/dist/esm/tools/BasemapGallery.js +7 -8
  26. package/dist/esm/tools/Home.js +20 -21
  27. package/dist/esm/tools/LayerList.js +4 -5
  28. package/dist/esm/tools/ScaleBar.js +3 -4
  29. package/dist/esm/tools/Zoom.js +4 -5
  30. package/dist/esm/viewer/{Context.js → Provider.js} +12 -19
  31. package/dist/esm/viewer/Viewer.js +4 -4
  32. package/dist/esm/viewer/context.js +33 -0
  33. package/dist/types/index.d.ts +48 -63
  34. package/dist/types/layers/Json.d.ts +2 -1
  35. package/dist/types/layers/Marker.d.ts +3 -4
  36. package/dist/types/markers/Fill.d.ts +3 -2
  37. package/dist/types/markers/Pin.d.ts +3 -2
  38. package/dist/types/markers/context.d.ts +3 -0
  39. package/dist/types/renderers/Cluster.d.ts +4 -4
  40. package/dist/types/renderers/Heatmap.d.ts +4 -4
  41. package/dist/types/renderers/Simple.d.ts +1 -1
  42. package/dist/types/tools/BasemapGallery.d.ts +1 -1
  43. package/dist/types/tools/Home.d.ts +3 -3
  44. package/dist/types/tools/LayerList.d.ts +1 -1
  45. package/dist/types/tools/ScaleBar.d.ts +1 -1
  46. package/dist/types/tools/Zoom.d.ts +1 -1
  47. package/dist/types/viewer/Provider.d.ts +5 -0
  48. package/dist/types/viewer/Viewer.d.ts +1 -1
  49. package/dist/types/viewer/context.d.ts +18 -0
  50. package/package.json +16 -22
  51. package/src/index.ts +23 -18
  52. package/src/layers/Json.tsx +5 -5
  53. package/src/layers/Marker.tsx +9 -22
  54. package/src/markers/Fill.tsx +23 -33
  55. package/src/markers/Pin.tsx +15 -22
  56. package/src/markers/context.ts +29 -0
  57. package/src/renderers/Cluster.tsx +12 -16
  58. package/src/renderers/Heatmap.tsx +12 -16
  59. package/src/renderers/Simple.tsx +6 -6
  60. package/src/tools/BasemapGallery.tsx +11 -28
  61. package/src/tools/Home.tsx +25 -30
  62. package/src/tools/LayerList.tsx +7 -13
  63. package/src/tools/ScaleBar.tsx +5 -4
  64. package/src/tools/Zoom.tsx +6 -5
  65. package/src/viewer/{Context.tsx → Provider.tsx} +25 -39
  66. package/src/viewer/Viewer.tsx +4 -4
  67. package/src/viewer/context.ts +44 -0
  68. package/dist/types/viewer/Context.d.ts +0 -16
@@ -1,8 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var mapComponentsReact = require('@arcgis/map-components-react');
4
3
  require('@arcgis/map-components/components/arcgis-zoom');
5
- var Context = require('../viewer/Context.js');
4
+ var context = require('../viewer/context.js');
6
5
  var jsxRuntime = require('react/jsx-runtime');
7
6
 
8
7
  /*
@@ -28,13 +27,13 @@ var jsxRuntime = require('react/jsx-runtime');
28
27
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
28
  */
30
29
 
31
- var Zoom = function Zoom() {
32
- var _useMap = Context.useMap(),
30
+ function Zoom() {
31
+ var _useMap = context.useMap(),
33
32
  disableZoom = _useMap.disableZoom;
34
- return !disableZoom && /*#__PURE__*/jsxRuntime.jsx(mapComponentsReact.ArcgisZoom, {
33
+ return !disableZoom && /*#__PURE__*/jsxRuntime.jsx("arcgis-zoom", {
35
34
  slot: "top-left",
36
35
  className: "mb-2"
37
36
  });
38
- };
37
+ }
39
38
 
40
39
  exports.Zoom = Zoom;
@@ -5,18 +5,16 @@ var Basemap = require('@arcgis/core/Basemap');
5
5
  var Point = require('@arcgis/core/geometry/Point');
6
6
  var SpatialReference = require('@arcgis/core/geometry/SpatialReference');
7
7
  var VectorTileLayer = require('@arcgis/core/layers/VectorTileLayer');
8
- var mapComponentsReact = require('@arcgis/map-components-react');
9
8
  require('@arcgis/map-components/components/arcgis-map');
10
9
  require('@arcgis/map-components/components/arcgis-popup');
11
10
  require('@arcgis/map-components/components/arcgis-scene');
12
- var calciteComponentsReact = require('@esri/calcite-components-react');
13
11
  var utilities = require('@react-fabric/utilities');
14
12
  var react = require('react');
15
13
  var index = require('../constants/index.js');
14
+ var context = require('./context.js');
16
15
  var jsxRuntime = require('react/jsx-runtime');
17
16
 
18
- var Context = /*#__PURE__*/react.createContext({});
19
- var MapProvider = function MapProvider(_ref) {
17
+ function MapProvider(_ref) {
20
18
  var children = _ref.children,
21
19
  onClick = _ref.onClick,
22
20
  _ref$basemaps = _ref.basemaps,
@@ -61,7 +59,7 @@ var MapProvider = function MapProvider(_ref) {
61
59
  if (view && onClick) {
62
60
  var handleClick = view.on("click", function (event) {
63
61
  var _event$mapPoint$latit, _event$mapPoint$longi;
64
- event.button === 0 && onClick({
62
+ if (event.button === 0) onClick({
65
63
  latitude: (_event$mapPoint$latit = event.mapPoint.latitude) !== null && _event$mapPoint$latit !== void 0 ? _event$mapPoint$latit : 0,
66
64
  longitude: (_event$mapPoint$longi = event.mapPoint.longitude) !== null && _event$mapPoint$longi !== void 0 ? _event$mapPoint$longi : 0
67
65
  });
@@ -71,10 +69,8 @@ var MapProvider = function MapProvider(_ref) {
71
69
  };
72
70
  }
73
71
  }, [view, onClick]);
74
- var E = react.useMemo(function () {
75
- return enable3D && is3D ? mapComponentsReact.ArcgisScene : mapComponentsReact.ArcgisMap;
76
- }, [is3D, enable3D]);
77
- return /*#__PURE__*/jsxRuntime.jsx(Context.Provider, {
72
+ var E = enable3D && is3D ? "arcgis-scene" : "arcgis-map";
73
+ return /*#__PURE__*/jsxRuntime.jsx(context.MapContext, {
78
74
  value: {
79
75
  map: map,
80
76
  view: view,
@@ -86,9 +82,9 @@ var MapProvider = function MapProvider(_ref) {
86
82
  zoom: zoom
87
83
  },
88
84
  children: /*#__PURE__*/jsxRuntime.jsxs(E, {
89
- onArcgisViewReadyChange: function onArcgisViewReadyChange(e) {
90
- e.target.map && setMap(e.target.map);
91
- e.target.view && setView(e.target.view);
85
+ onarcgisViewReadyChange: function onarcgisViewReadyChange(e) {
86
+ if (e.target.map) setMap(e.target.map);
87
+ if (e.target.view) setView(e.target.view);
92
88
  },
93
89
  className: "area-content overflow-hidden",
94
90
  basemap: new Basemap({
@@ -109,7 +105,7 @@ var MapProvider = function MapProvider(_ref) {
109
105
  spatialReference: new SpatialReference({
110
106
  wkid: 3857
111
107
  }),
112
- children: [enable3D && /*#__PURE__*/jsxRuntime.jsx(calciteComponentsReact.CalciteButton, {
108
+ children: [enable3D && /*#__PURE__*/jsxRuntime.jsx("calcite-button", {
113
109
  appearance: "solid",
114
110
  kind: "neutral",
115
111
  slot: "top-right",
@@ -123,10 +119,6 @@ var MapProvider = function MapProvider(_ref) {
123
119
  }), children]
124
120
  })
125
121
  });
126
- };
127
- var useMap = function useMap() {
128
- return react.useContext(Context);
129
- };
122
+ }
130
123
 
131
124
  exports.MapProvider = MapProvider;
132
- exports.useMap = useMap;
@@ -5,12 +5,12 @@ var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProp
5
5
  require('@arcgis/core/assets/esri/themes/light/main.css');
6
6
  var core = require('@react-fabric/core');
7
7
  var react = require('react');
8
- var Context = require('./Context.js');
8
+ var Provider = require('./Provider.js');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
 
11
11
  var _excluded = ["children"];
12
12
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
14
  var MapViewer = function MapViewer(_ref) {
15
15
  var children = _ref.children,
16
16
  props = _objectWithoutProperties(_ref, _excluded);
@@ -18,9 +18,9 @@ var MapViewer = function MapViewer(_ref) {
18
18
  react.useEffect(function () {
19
19
  document.documentElement.classList.toggle("calcite-mode-dark", isDark);
20
20
  }, [isDark]);
21
- return /*#__PURE__*/jsxRuntime.jsx(core.Section, {
21
+ return /*#__PURE__*/jsxRuntime.jsx(core.Layout, {
22
22
  className: "relative",
23
- children: /*#__PURE__*/jsxRuntime.jsx(Context.MapProvider, _objectSpread(_objectSpread({}, props), {}, {
23
+ children: /*#__PURE__*/jsxRuntime.jsx(Provider.MapProvider, _objectSpread(_objectSpread({}, props), {}, {
24
24
  children: children
25
25
  }))
26
26
  });
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ /*
6
+ * React Fabric
7
+ * @version: 1.0.0
8
+ *
9
+ *
10
+ * The MIT License (MIT)
11
+ * Copyright (c) 2026 Adarsh Pastakia
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
14
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
15
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
16
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
17
+ * subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
20
+ * portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
23
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+ */
27
+
28
+ var MapContext = /*#__PURE__*/react.createContext({});
29
+ var useMap = function useMap() {
30
+ return react.use(MapContext);
31
+ };
32
+
33
+ exports.MapContext = MapContext;
34
+ exports.useMap = useMap;
package/dist/esm/index.js CHANGED
@@ -14,30 +14,34 @@ import { useHeatmapRenderer } from './renderers/Heatmap.js';
14
14
  import { useSimpleRenderer } from './renderers/Simple.js';
15
15
  export { MapViewer } from './viewer/Viewer.js';
16
16
 
17
- /*
17
+ /**
18
18
  * React Fabric
19
- * @version: 1.0.0
19
+ * @version 1.0.0
20
+ * @license MIT
21
+ * @copyright 2024 Adarsh Pastakia
20
22
  *
23
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
24
+ * of this software and associated documentation files (the "Software"), to deal
25
+ * in the Software without restriction, including without limitation the rights
26
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27
+ * copies of the Software, and to permit persons to whom the Software is
28
+ * furnished to do so, subject to the following conditions:
21
29
  *
22
- * The MIT License (MIT)
23
- * Copyright (c) 2025 Adarsh Pastakia
30
+ * The above copyright notice and this permission notice shall be included in all
31
+ * copies or substantial portions of the Software.
24
32
  *
25
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
26
- * and associated documentation files (the "Software"), to deal in the Software without restriction,
27
- * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
28
- * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
29
- * subject to the following conditions:
30
- *
31
- * The above copyright notice and this permission notice shall be included in all copies or substantial
32
- * portions of the Software.
33
- *
34
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
35
- * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
36
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
37
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
39
+ * SOFTWARE.
38
40
  */
39
41
 
40
- esriConfig.assetsPath = "/assets/@arcgis";
42
+ var MAP_PACKAGE = "@react-fabric/map";
43
+ var MAP_VERSION = "1.0.0";
44
+ esriConfig.assetsPath = "./assets/@arcgis";
41
45
  var setArcgisAssetsPath = function setArcgisAssetsPath(path) {
42
46
  esriConfig.assetsPath = path;
43
47
  };
@@ -65,4 +69,4 @@ var MapRenderers;
65
69
  _MapRenderers.useHeatmap = useHeatmapRenderer;
66
70
  })(MapRenderers || (MapRenderers = {}));
67
71
 
68
- export { MapLayers, MapMarkers, MapRenderers, MapTools, setArcgisAssetsPath };
72
+ export { MAP_PACKAGE, MAP_VERSION, MapLayers, MapMarkers, MapRenderers, MapTools, setArcgisAssetsPath };
@@ -3,11 +3,11 @@
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import GeoJSONLayer from '@arcgis/core/layers/GeoJSONLayer';
5
5
  import { useMemo, useEffect } from 'react';
6
- import { useMap } from '../viewer/Context.js';
6
+ import { useMap } from '../viewer/context.js';
7
7
 
8
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
- var JsonLayer = function JsonLayer(props) {
9
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
+ function JsonLayer(props) {
11
11
  var _useMap = useMap(),
12
12
  map = _useMap.map,
13
13
  view = _useMap.view;
@@ -17,7 +17,7 @@ var JsonLayer = function JsonLayer(props) {
17
17
  useEffect(function () {
18
18
  if (map && view) {
19
19
  void layer.when(function () {
20
- void view.goTo(layer.fullExtent);
20
+ void (layer.fullExtent && view.goTo(layer.fullExtent));
21
21
  });
22
22
  map.add(layer);
23
23
  return function () {
@@ -26,6 +26,6 @@ var JsonLayer = function JsonLayer(props) {
26
26
  }
27
27
  }, [map, view, layer]);
28
28
  return null;
29
- };
29
+ }
30
30
 
31
31
  export { JsonLayer };
@@ -3,16 +3,16 @@
3
3
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
4
4
  import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
5
5
  import '@arcgis/map-components/components/arcgis-features';
6
- import { useMemo, useEffect, createContext, useContext } from 'react';
7
- import { useMap } from '../viewer/Context.js';
6
+ import { useMemo, useEffect } from 'react';
7
+ import { MarkerContext } from '../markers/context.js';
8
+ import { useMap } from '../viewer/context.js';
8
9
  import { jsx } from 'react/jsx-runtime';
9
10
 
10
11
  var _excluded = ["children"];
11
- var MarkerContext = /*#__PURE__*/createContext(null);
12
12
  /**
13
13
  * MarkerLayer component for displaying a layer of markers on the map.
14
14
  */
15
- var MarkerLayer = function MarkerLayer(_ref) {
15
+ function MarkerLayer(_ref) {
16
16
  var children = _ref.children,
17
17
  props = _objectWithoutProperties(_ref, _excluded);
18
18
  var _useMap = useMap(),
@@ -34,13 +34,10 @@ var MarkerLayer = function MarkerLayer(_ref) {
34
34
  };
35
35
  }
36
36
  }, [layer, map, view]);
37
- return /*#__PURE__*/jsx(MarkerContext.Provider, {
37
+ return /*#__PURE__*/jsx(MarkerContext, {
38
38
  value: layer,
39
39
  children: children
40
40
  });
41
- };
42
- var useMarkerLayer = function useMarkerLayer() {
43
- return useContext(MarkerContext);
44
- };
41
+ }
45
42
 
46
- export { MarkerLayer, useMarkerLayer };
43
+ export { MarkerLayer };
@@ -6,20 +6,20 @@ import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProper
6
6
  import Polygon from '@arcgis/core/geometry/Polygon';
7
7
  import Graphic from '@arcgis/core/Graphic';
8
8
  import SimpleFillSymbol from '@arcgis/core/symbols/SimpleFillSymbol';
9
- import { convertLatLng } from '@react-fabric/utilities';
9
+ import { convertToLonLat } from '@react-fabric/utilities';
10
+ import chroma from 'chroma-js';
10
11
  import { useMemo, useEffect } from 'react';
11
- import { useMarkerLayer } from '../layers/Marker.js';
12
- import Color from 'color';
13
- import { useMap } from '../viewer/Context.js';
12
+ import { useMap } from '../viewer/context.js';
13
+ import { useMarkerLayer } from './context.js';
14
14
 
15
15
  var _excluded = ["coords", "style", "color", "borderWidth", "borderColor", "animate"];
16
16
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
18
 
19
19
  /**
20
20
  * Fill graphic for displaying a fill polygon on the map.
21
21
  */
22
- var Fill = function Fill(_ref) {
22
+ function Fill(_ref) {
23
23
  var coords = _ref.coords,
24
24
  _ref$style = _ref.style,
25
25
  style = _ref$style === void 0 ? "solid" : _ref$style,
@@ -35,21 +35,21 @@ var Fill = function Fill(_ref) {
35
35
  var graphic = useMemo(function () {
36
36
  return new Graphic(_objectSpread({
37
37
  geometry: new Polygon({
38
- rings: [coords.map(convertLatLng)]
38
+ rings: [coords.map(convertToLonLat)]
39
39
  }),
40
- symbol: new SimpleFillSymbol(Object.assign({
40
+ symbol: new SimpleFillSymbol({
41
41
  style: style,
42
42
  color: color,
43
43
  outline: {
44
44
  color: borderColor,
45
45
  width: borderWidth
46
46
  }
47
- }))
47
+ })
48
48
  }, props));
49
49
  }, [coords, style, color, borderColor, borderWidth, props]);
50
50
  useEffect(function () {
51
51
  if (layer && coords) {
52
- var tmr = null;
52
+ var tmr;
53
53
  void layer.when(function () {
54
54
  layer.add(graphic);
55
55
  if (animate && !is3D) {
@@ -61,7 +61,7 @@ var Fill = function Fill(_ref) {
61
61
  if (sat >= 0.9) up = -0.1;
62
62
  if (sat <= 0.1) up = 0.1;
63
63
  sat += up;
64
- symbol.color = Color.rgb(_toConsumableArray(_color)).darken(sat).rgb().array();
64
+ symbol.color = chroma.rgb.apply(chroma, _toConsumableArray(_color)).darken(sat).rgba();
65
65
  requestAnimationFrame(function () {
66
66
  graphic.symbol = symbol.clone();
67
67
  });
@@ -73,8 +73,8 @@ var Fill = function Fill(_ref) {
73
73
  layer.remove(graphic);
74
74
  };
75
75
  }
76
- }, [layer, graphic, animate, is3D]);
76
+ }, [layer, graphic, animate, is3D, coords]);
77
77
  return null;
78
- };
78
+ }
79
79
 
80
80
  export { Fill };
@@ -7,12 +7,12 @@ import Graphic from '@arcgis/core/Graphic';
7
7
  import SimpleMarkerSymbol from '@arcgis/core/symbols/SimpleMarkerSymbol';
8
8
  import { getLatitudeLongitude } from '@react-fabric/utilities';
9
9
  import { useMemo, useEffect } from 'react';
10
- import { useMarkerLayer } from '../layers/Marker.js';
11
- import { useMap } from '../viewer/Context.js';
10
+ import { useMap } from '../viewer/context.js';
11
+ import { useMarkerLayer } from './context.js';
12
12
 
13
13
  var _excluded = ["coords", "style", "size", "color", "path", "borderWidth", "borderColor", "animate"];
14
14
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
15
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
16
16
  var paths = {
17
17
  marker: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z",
18
18
  "marker-radius": "M12,2C15.31,2 18,4.66 18,7.95C18,12.41 12,19 12,19C12,19 6,12.41 6,7.95C6,4.66 8.69,2 12,2M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M20,19C20,21.21 16.42,23 12,23C7.58,23 4,21.21 4,19C4,17.71 5.22,16.56 7.11,15.83L7.75,16.74C6.67,17.19 6,17.81 6,18.5C6,19.88 8.69,21 12,21C15.31,21 18,19.88 18,18.5C18,17.81 17.33,17.19 16.25,16.74L16.89,15.83C18.78,16.56 20,17.71 20,19Z",
@@ -23,7 +23,7 @@ var paths = {
23
23
  /**
24
24
  * Pin graphic for displaying a pin on the map.
25
25
  */
26
- var Pin = function Pin(_ref) {
26
+ function Pin(_ref) {
27
27
  var coords = _ref.coords,
28
28
  _ref$style = _ref.style,
29
29
  style = _ref$style === void 0 ? "circle" : _ref$style,
@@ -50,8 +50,8 @@ var Pin = function Pin(_ref) {
50
50
  color: borderColor,
51
51
  width: borderWidth
52
52
  }
53
- }, style && style.toString() in paths ? {
54
- path: paths[style.toString()],
53
+ }, style && style in paths ? {
54
+ path: paths[style],
55
55
  style: "path"
56
56
  } : {}, path ? {
57
57
  path: path,
@@ -61,7 +61,7 @@ var Pin = function Pin(_ref) {
61
61
  }, [coords, style, size, color, borderColor, borderWidth, path, props]);
62
62
  useEffect(function () {
63
63
  if (layer && coords) {
64
- var tmr = null;
64
+ var tmr;
65
65
  void layer.when(function () {
66
66
  layer.add(graphic);
67
67
  var symbol = graphic.symbol;
@@ -85,8 +85,8 @@ var Pin = function Pin(_ref) {
85
85
  layer.remove(graphic);
86
86
  };
87
87
  }
88
- }, [layer, graphic, animate, is3D]);
88
+ }, [layer, graphic, animate, is3D, coords]);
89
89
  return null;
90
- };
90
+ }
91
91
 
92
92
  export { Pin };
@@ -0,0 +1,33 @@
1
+ 'use client';
2
+
3
+ import { createContext, use } from 'react';
4
+
5
+ /*
6
+ * React Fabric
7
+ * @version: 1.0.0
8
+ *
9
+ *
10
+ * The MIT License (MIT)
11
+ * Copyright (c) 2026 Adarsh Pastakia
12
+ *
13
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
14
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
15
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
16
+ * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
17
+ * subject to the following conditions:
18
+ *
19
+ * The above copyright notice and this permission notice shall be included in all copies or substantial
20
+ * portions of the Software.
21
+ *
22
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
23
+ * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
+ */
27
+
28
+ var MarkerContext = /*#__PURE__*/createContext(null);
29
+ var useMarkerLayer = function useMarkerLayer() {
30
+ return use(MarkerContext);
31
+ };
32
+
33
+ export { MarkerContext, useMarkerLayer };
@@ -2,24 +2,24 @@
2
2
 
3
3
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
4
4
  import HeatmapRenderer from '@arcgis/core/renderers/HeatmapRenderer';
5
- import Color from 'color';
5
+ import chroma from 'chroma-js';
6
6
  import { useMemo } from 'react';
7
7
 
8
- var useHeatmapRenderer = function useHeatmapRenderer(props) {
8
+ function useHeatmapRenderer(props) {
9
9
  var renderer = useMemo(function () {
10
10
  var _props$colors, _props$colors2, _props$colors3, _props$minDensity, _props$maxDensity;
11
11
  var colorHigh = "#FFE600FF";
12
12
  var colorMid = "#FF8C00FF";
13
13
  var colorLow = "#FF3300FF";
14
14
  if ((props === null || props === void 0 || (_props$colors = props.colors) === null || _props$colors === void 0 ? void 0 : _props$colors.length) === 1) {
15
- colorHigh = Color(props.colors[0]).lightness(95).toString();
16
- colorLow = Color(props.colors[0]).lightness(25).toString();
17
- colorMid = Color(colorHigh).mix(Color(colorLow), 0.5).toString();
15
+ colorHigh = chroma(props.colors[0]).luminance(0.85, "oklab").hex();
16
+ colorLow = chroma(props.colors[0]).luminance(0.25, "oklab").hex();
17
+ colorMid = chroma.mix(colorHigh, colorLow, 0.5).hex();
18
18
  }
19
19
  if ((props === null || props === void 0 || (_props$colors2 = props.colors) === null || _props$colors2 === void 0 ? void 0 : _props$colors2.length) === 2) {
20
20
  colorHigh = props.colors[0];
21
21
  colorLow = props.colors[1];
22
- colorMid = Color(colorHigh).mix(Color(colorLow), 0.5).toString();
22
+ colorMid = chroma.mix(colorHigh, colorLow, 0.5).hex();
23
23
  }
24
24
  if ((props === null || props === void 0 || (_props$colors3 = props.colors) === null || _props$colors3 === void 0 ? void 0 : _props$colors3.length) === 3) {
25
25
  colorHigh = props.colors[0];
@@ -36,14 +36,14 @@ var useHeatmapRenderer = function useHeatmapRenderer(props) {
36
36
  }, function (_, i) {
37
37
  return {
38
38
  ratio: (i + 1) / 12,
39
- color: Color(colorLow).mix(Color(colorMid), i / 6).toString()
39
+ color: chroma.mix(colorLow, colorMid, i / 6).hex()
40
40
  };
41
41
  })), _toConsumableArray(Array.from({
42
42
  length: 6
43
43
  }, function (_, i) {
44
44
  return {
45
45
  ratio: (i + 6) / 12,
46
- color: Color(colorMid).mix(Color(colorHigh), i / 6).toString()
46
+ color: chroma.mix(colorMid, colorHigh, i / 6).hex()
47
47
  };
48
48
  })));
49
49
  return new HeatmapRenderer({
@@ -57,6 +57,6 @@ var useHeatmapRenderer = function useHeatmapRenderer(props) {
57
57
  });
58
58
  }, [props]);
59
59
  return renderer;
60
- };
60
+ }
61
61
 
62
62
  export { useHeatmapRenderer };
@@ -5,13 +5,14 @@ import SimpleRenderer from '@arcgis/core/renderers/SimpleRenderer';
5
5
  import { useMemo } from 'react';
6
6
 
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
- var useSimpleRenderer = function useSimpleRenderer(props) {
8
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
+ function useSimpleRenderer(props) {
10
10
  var renderer = useMemo(function () {
11
11
  var _props$style, _props$color, _props$size, _props$borderColor, _props$borderWidth;
12
12
  var vizVars = [];
13
13
  var styleProps = {
14
- style: (_props$style = props === null || props === void 0 ? void 0 : props.style) !== null && _props$style !== void 0 ? _props$style : "circle"
14
+ style: (_props$style = props === null || props === void 0 ? void 0 : props.style) !== null && _props$style !== void 0 ? _props$style : "circle",
15
+ path: undefined
15
16
  };
16
17
  if (props !== null && props !== void 0 && props.path) {
17
18
  styleProps.style = "path";
@@ -46,6 +47,6 @@ var useSimpleRenderer = function useSimpleRenderer(props) {
46
47
  });
47
48
  }, [props]);
48
49
  return renderer;
49
- };
50
+ }
50
51
 
51
52
  export { useSimpleRenderer };
@@ -3,11 +3,10 @@
3
3
  import Basemap from '@arcgis/core/Basemap';
4
4
  import VectorTileLayer from '@arcgis/core/layers/VectorTileLayer';
5
5
  import LocalBasemapsSource from '@arcgis/core/widgets/BasemapGallery/support/LocalBasemapsSource';
6
- import { ArcgisExpand, ArcgisBasemapGallery, ArcgisBasemapLayerList } from '@arcgis/map-components-react';
7
6
  import '@arcgis/map-components/components/arcgis-basemap-gallery';
8
7
  import '@arcgis/map-components/components/arcgis-basemap-layer-list';
9
8
  import '@arcgis/map-components/components/arcgis-expand';
10
- import { useMap } from '../viewer/Context.js';
9
+ import { useMap } from '../viewer/context.js';
11
10
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
12
11
 
13
12
  /*
@@ -33,20 +32,20 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
33
32
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
34
33
  */
35
34
 
36
- var BasemapGallery = function BasemapGallery() {
35
+ function BasemapGallery() {
37
36
  var _map$basemap$baseLaye, _map$basemap;
38
37
  var _useMap = useMap(),
39
38
  basemaps = _useMap.basemaps,
40
39
  map = _useMap.map;
41
40
  return /*#__PURE__*/jsxs(Fragment, {
42
- children: [/*#__PURE__*/jsx(ArcgisExpand, {
41
+ children: [/*#__PURE__*/jsx("arcgis-expand", {
43
42
  className: "mb-2",
44
43
  expandIcon: "basemap",
45
44
  collapseIcon: "x",
46
45
  mode: "floating",
47
46
  slot: "top-right",
48
47
  autoCollapse: true,
49
- children: /*#__PURE__*/jsx(ArcgisBasemapGallery, {
48
+ children: /*#__PURE__*/jsx("arcgis-basemap-gallery", {
50
49
  source: new LocalBasemapsSource({
51
50
  basemaps: basemaps.map(function (map) {
52
51
  return new Basemap({
@@ -65,16 +64,16 @@ var BasemapGallery = function BasemapGallery() {
65
64
  })
66
65
  })
67
66
  })
68
- }), ((_map$basemap$baseLaye = map === null || map === void 0 || (_map$basemap = map.basemap) === null || _map$basemap === void 0 ? void 0 : _map$basemap.baseLayers.length) !== null && _map$basemap$baseLaye !== void 0 ? _map$basemap$baseLaye : 1) > 1 && /*#__PURE__*/jsx(ArcgisExpand, {
67
+ }), ((_map$basemap$baseLaye = map === null || map === void 0 || (_map$basemap = map.basemap) === null || _map$basemap === void 0 ? void 0 : _map$basemap.baseLayers.length) !== null && _map$basemap$baseLaye !== void 0 ? _map$basemap$baseLaye : 1) > 1 && /*#__PURE__*/jsx("arcgis-expand", {
69
68
  className: "mb-2",
70
69
  expandIcon: "layer-map",
71
70
  collapseIcon: "x",
72
71
  mode: "floating",
73
72
  slot: "top-right",
74
73
  autoCollapse: true,
75
- children: /*#__PURE__*/jsx(ArcgisBasemapLayerList, {})
74
+ children: /*#__PURE__*/jsx("arcgis-basemap-layer-list", {})
76
75
  })]
77
76
  });
78
- };
77
+ }
79
78
 
80
79
  export { BasemapGallery };