@react-fabric/map 1.0.0-beta.63 → 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 (67) hide show
  1. package/dist/cjs/index.js +24 -18
  2. package/dist/cjs/layers/Json.js +3 -3
  3. package/dist/cjs/layers/Marker.js +3 -3
  4. package/dist/cjs/markers/Fill.js +10 -9
  5. package/dist/cjs/markers/Pin.js +7 -7
  6. package/dist/cjs/markers/context.js +1 -1
  7. package/dist/cjs/renderers/Heatmap.js +2 -2
  8. package/dist/cjs/renderers/Simple.js +5 -4
  9. package/dist/cjs/tools/BasemapGallery.js +6 -7
  10. package/dist/cjs/tools/Home.js +17 -18
  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 +3 -4
  14. package/dist/cjs/viewer/Provider.js +9 -13
  15. package/dist/cjs/viewer/Viewer.js +2 -2
  16. package/dist/cjs/viewer/context.js +1 -1
  17. package/dist/esm/index.js +23 -19
  18. package/dist/esm/layers/Json.js +3 -3
  19. package/dist/esm/layers/Marker.js +3 -3
  20. package/dist/esm/markers/Fill.js +11 -10
  21. package/dist/esm/markers/Pin.js +7 -7
  22. package/dist/esm/markers/context.js +2 -2
  23. package/dist/esm/renderers/Heatmap.js +2 -2
  24. package/dist/esm/renderers/Simple.js +5 -4
  25. package/dist/esm/tools/BasemapGallery.js +6 -7
  26. package/dist/esm/tools/Home.js +17 -18
  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 +3 -4
  30. package/dist/esm/viewer/Provider.js +9 -13
  31. package/dist/esm/viewer/Viewer.js +3 -3
  32. package/dist/esm/viewer/context.js +2 -2
  33. package/dist/types/index.d.ts +48 -63
  34. package/dist/types/layers/Json.d.ts +1 -1
  35. package/dist/types/layers/Marker.d.ts +2 -2
  36. package/dist/types/markers/Fill.d.ts +2 -2
  37. package/dist/types/markers/Pin.d.ts +2 -2
  38. package/dist/types/markers/context.d.ts +1 -1
  39. package/dist/types/renderers/Cluster.d.ts +1 -1
  40. package/dist/types/renderers/Heatmap.d.ts +1 -1
  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 +1 -1
  48. package/dist/types/viewer/Viewer.d.ts +1 -1
  49. package/dist/types/viewer/context.d.ts +10 -17
  50. package/package.json +14 -20
  51. package/src/index.ts +23 -18
  52. package/src/layers/Json.tsx +2 -2
  53. package/src/layers/Marker.tsx +4 -4
  54. package/src/markers/Fill.tsx +17 -18
  55. package/src/markers/Pin.tsx +11 -11
  56. package/src/markers/context.ts +3 -3
  57. package/src/renderers/Cluster.tsx +2 -2
  58. package/src/renderers/Heatmap.tsx +2 -2
  59. package/src/renderers/Simple.tsx +6 -6
  60. package/src/tools/BasemapGallery.tsx +10 -9
  61. package/src/tools/Home.tsx +24 -21
  62. package/src/tools/LayerList.tsx +7 -13
  63. package/src/tools/ScaleBar.tsx +5 -4
  64. package/src/tools/Zoom.tsx +5 -4
  65. package/src/viewer/Provider.tsx +14 -13
  66. package/src/viewer/Viewer.tsx +3 -3
  67. package/src/viewer/context.ts +11 -9
package/dist/cjs/index.js CHANGED
@@ -14,30 +14,34 @@ var Heatmap = require('./renderers/Heatmap.js');
14
14
  var Simple = require('./renderers/Simple.js');
15
15
  var Viewer = require('./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
  };
@@ -66,4 +70,6 @@ exports.MapRenderers = void 0;
66
70
  })(exports.MapRenderers || (exports.MapRenderers = {}));
67
71
 
68
72
  exports.MapViewer = Viewer.MapViewer;
73
+ exports.MAP_PACKAGE = MAP_PACKAGE;
74
+ exports.MAP_VERSION = MAP_VERSION;
69
75
  exports.setArcgisAssetsPath = setArcgisAssetsPath;
@@ -6,8 +6,8 @@ var react = require('react');
6
6
  var context = require('../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 = context.useMap(),
12
12
  map = _useMap.map,
13
13
  view = _useMap.view;
@@ -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
  exports.JsonLayer = JsonLayer;
@@ -12,7 +12,7 @@ var _excluded = ["children"];
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 = context.useMap(),
@@ -34,10 +34,10 @@ var MarkerLayer = function MarkerLayer(_ref) {
34
34
  };
35
35
  }
36
36
  }, [layer, map, view]);
37
- return /*#__PURE__*/jsxRuntime.jsx(context$1.MarkerContext.Provider, {
37
+ return /*#__PURE__*/jsxRuntime.jsx(context$1.MarkerContext, {
38
38
  value: layer,
39
39
  children: children
40
40
  });
41
- };
41
+ }
42
42
 
43
43
  exports.MarkerLayer = MarkerLayer;
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
3
4
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
5
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
5
6
  var Polygon = require('@arcgis/core/geometry/Polygon');
@@ -13,12 +14,12 @@ var context = require('./context.js');
13
14
 
14
15
  var _excluded = ["coords", "style", "color", "borderWidth", "borderColor", "animate"];
15
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; }
16
- 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; }
17
18
 
18
19
  /**
19
20
  * Fill graphic for displaying a fill polygon on the map.
20
21
  */
21
- var Fill = function Fill(_ref) {
22
+ function Fill(_ref) {
22
23
  var coords = _ref.coords,
23
24
  _ref$style = _ref.style,
24
25
  style = _ref$style === void 0 ? "solid" : _ref$style,
@@ -34,21 +35,21 @@ var Fill = function Fill(_ref) {
34
35
  var graphic = react.useMemo(function () {
35
36
  return new Graphic(_objectSpread({
36
37
  geometry: new Polygon({
37
- rings: [coords.map(utilities.convertLatLng)]
38
+ rings: [coords.map(utilities.convertToLonLat)]
38
39
  }),
39
- symbol: new SimpleFillSymbol(Object.assign({
40
+ symbol: new SimpleFillSymbol({
40
41
  style: style,
41
42
  color: color,
42
43
  outline: {
43
44
  color: borderColor,
44
45
  width: borderWidth
45
46
  }
46
- }))
47
+ })
47
48
  }, props));
48
49
  }, [coords, style, color, borderColor, borderWidth, props]);
49
50
  react.useEffect(function () {
50
51
  if (layer && coords) {
51
- var tmr = null;
52
+ var tmr;
52
53
  void layer.when(function () {
53
54
  layer.add(graphic);
54
55
  if (animate && !is3D) {
@@ -60,7 +61,7 @@ var Fill = function Fill(_ref) {
60
61
  if (sat >= 0.9) up = -0.1;
61
62
  if (sat <= 0.1) up = 0.1;
62
63
  sat += up;
63
- symbol.color = chroma(_color).darken(sat).rgba();
64
+ symbol.color = chroma.rgb.apply(chroma, _toConsumableArray(_color)).darken(sat).rgba();
64
65
  requestAnimationFrame(function () {
65
66
  graphic.symbol = symbol.clone();
66
67
  });
@@ -72,8 +73,8 @@ var Fill = function Fill(_ref) {
72
73
  layer.remove(graphic);
73
74
  };
74
75
  }
75
- }, [layer, graphic, animate, is3D]);
76
+ }, [layer, graphic, animate, is3D, coords]);
76
77
  return null;
77
- };
78
+ }
78
79
 
79
80
  exports.Fill = Fill;
@@ -12,7 +12,7 @@ var context = require('./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
  react.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
  exports.Pin = Pin;
@@ -27,7 +27,7 @@ var react = require('react');
27
27
 
28
28
  var MarkerContext = /*#__PURE__*/react.createContext(null);
29
29
  var useMarkerLayer = function useMarkerLayer() {
30
- return react.useContext(MarkerContext);
30
+ return react.use(MarkerContext);
31
31
  };
32
32
 
33
33
  exports.MarkerContext = MarkerContext;
@@ -5,7 +5,7 @@ var HeatmapRenderer = require('@arcgis/core/renderers/HeatmapRenderer');
5
5
  var chroma = require('chroma-js');
6
6
  var react = require('react');
7
7
 
8
- var useHeatmapRenderer = function useHeatmapRenderer(props) {
8
+ function useHeatmapRenderer(props) {
9
9
  var renderer = react.useMemo(function () {
10
10
  var _props$colors, _props$colors2, _props$colors3, _props$minDensity, _props$maxDensity;
11
11
  var colorHigh = "#FFE600FF";
@@ -57,6 +57,6 @@ var useHeatmapRenderer = function useHeatmapRenderer(props) {
57
57
  });
58
58
  }, [props]);
59
59
  return renderer;
60
- };
60
+ }
61
61
 
62
62
  exports.useHeatmapRenderer = useHeatmapRenderer;
@@ -5,13 +5,14 @@ var SimpleRenderer = require('@arcgis/core/renderers/SimpleRenderer');
5
5
  var react = require('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 = react.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
  exports.useSimpleRenderer = useSimpleRenderer;
@@ -3,7 +3,6 @@
3
3
  var Basemap = require('@arcgis/core/Basemap');
4
4
  var VectorTileLayer = require('@arcgis/core/layers/VectorTileLayer');
5
5
  var LocalBasemapsSource = require('@arcgis/core/widgets/BasemapGallery/support/LocalBasemapsSource');
6
- var mapComponentsReact = require('@arcgis/map-components-react');
7
6
  require('@arcgis/map-components/components/arcgis-basemap-gallery');
8
7
  require('@arcgis/map-components/components/arcgis-basemap-layer-list');
9
8
  require('@arcgis/map-components/components/arcgis-expand');
@@ -33,20 +32,20 @@ var jsxRuntime = require('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 = context.useMap(),
39
38
  basemaps = _useMap.basemaps,
40
39
  map = _useMap.map;
41
40
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
42
- children: [/*#__PURE__*/jsxRuntime.jsx(mapComponentsReact.ArcgisExpand, {
41
+ children: [/*#__PURE__*/jsxRuntime.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__*/jsxRuntime.jsx(mapComponentsReact.ArcgisBasemapGallery, {
48
+ children: /*#__PURE__*/jsxRuntime.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__*/jsxRuntime.jsx(mapComponentsReact.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__*/jsxRuntime.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__*/jsxRuntime.jsx(mapComponentsReact.ArcgisBasemapLayerList, {})
74
+ children: /*#__PURE__*/jsxRuntime.jsx("arcgis-basemap-layer-list", {})
76
75
  })]
77
76
  });
78
- };
77
+ }
79
78
 
80
79
  exports.BasemapGallery = BasemapGallery;
@@ -4,9 +4,7 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
4
  var reactiveUtils = require('@arcgis/core/core/reactiveUtils');
5
5
  var Point = require('@arcgis/core/geometry/Point');
6
6
  var Viewpoint = require('@arcgis/core/Viewpoint');
7
- var mapComponentsReact = require('@arcgis/map-components-react');
8
- require('@arcgis/map-components/components/arcgis-placement');
9
- var calciteComponentsReact = require('@esri/calcite-components-react');
7
+ require('@esri/calcite-components/components/calcite-button');
10
8
  var utilities = require('@react-fabric/utilities');
11
9
  var react = require('react');
12
10
  var context = require('../viewer/context.js');
@@ -31,7 +29,7 @@ function _interopNamespaceDefault(e) {
31
29
 
32
30
  var reactiveUtils__namespace = /*#__PURE__*/_interopNamespaceDefault(reactiveUtils);
33
31
 
34
- var Home = function Home(_ref) {
32
+ function Home(_ref) {
35
33
  var enableHistory = _ref.enableHistory;
36
34
  var _useMap = context.useMap(),
37
35
  map = _useMap.map,
@@ -39,8 +37,8 @@ var Home = function Home(_ref) {
39
37
  disableDrag = _useMap.disableDrag,
40
38
  center = _useMap.center,
41
39
  zoom = _useMap.zoom;
42
- var isNavigatingHistory = react.useRef(false);
43
- var currentIndex = react.useRef(0);
40
+ var isNavigatingHistoryRef = react.useRef(false);
41
+ var currentIndexRef = react.useRef(0);
44
42
  var _useState = react.useState([]),
45
43
  _useState2 = _slicedToArray(_useState, 2),
46
44
  history = _useState2[0],
@@ -50,22 +48,22 @@ var Home = function Home(_ref) {
50
48
  activeIndex = _useState4[0],
51
49
  setActiveIndex = _useState4[1];
52
50
  react.useEffect(function () {
53
- currentIndex.current = activeIndex;
51
+ currentIndexRef.current = activeIndex;
54
52
  }, [activeIndex]);
55
53
  react.useEffect(function () {
56
54
  if (enableHistory && !disableDrag && view) {
57
55
  var addHistory = utilities.debounce(function (viewpoint) {
58
- if (!isNavigatingHistory.current) {
56
+ if (!isNavigatingHistoryRef.current) {
59
57
  setHistory(function (h) {
60
58
  // Keep max 25 history entries
61
- var newHistory = h.slice(0, currentIndex.current + 1).slice(-24);
59
+ var newHistory = h.slice(0, currentIndexRef.current + 1).slice(-24);
62
60
  // Add new viewpoint to history
63
61
  newHistory.push(viewpoint.clone());
64
62
  setActiveIndex(newHistory.length - 1);
65
63
  return newHistory;
66
64
  });
67
65
  }
68
- isNavigatingHistory.current = false;
66
+ isNavigatingHistoryRef.current = false;
69
67
  });
70
68
  var watcher = reactiveUtils__namespace.watch(function () {
71
69
  return view.viewpoint;
@@ -77,17 +75,18 @@ var Home = function Home(_ref) {
77
75
  }, [disableDrag, enableHistory, view]);
78
76
  var navigate = react.useCallback(function (idx) {
79
77
  if (history.length > 0 && history[idx] && view) {
80
- isNavigatingHistory.current = true;
78
+ isNavigatingHistoryRef.current = true;
81
79
  void view.goTo(history[idx]);
82
80
  setActiveIndex(idx);
83
81
  }
84
- }, [history]);
82
+ }, [history, view]);
85
83
  var gotoHome = react.useCallback(function () {
86
84
  if (view) {
87
85
  var _view$tileInfo;
88
- var extent;
86
+ var extent = undefined;
89
87
  map === null || map === void 0 || map.layers.forEach(function (layer) {
90
88
  if (layer.visible && layer.fullExtent) {
89
+ console.log(layer.type, layer.fullExtent);
91
90
  if (extent) {
92
91
  extent = extent.union(layer.fullExtent);
93
92
  } else {
@@ -101,10 +100,10 @@ var Home = function Home(_ref) {
101
100
  }));
102
101
  }
103
102
  }, [center, zoom, view, map]);
104
- return !disableDrag && /*#__PURE__*/jsxRuntime.jsxs(mapComponentsReact.ArcgisPlacement, {
103
+ return !disableDrag && /*#__PURE__*/jsxRuntime.jsxs("div", {
105
104
  slot: "top-left",
106
105
  className: "mb-2 flex flex-col divide-y divide-tint-100",
107
- children: [enableHistory && /*#__PURE__*/jsxRuntime.jsx(calciteComponentsReact.CalciteButton, {
106
+ children: [enableHistory && /*#__PURE__*/jsxRuntime.jsx("calcite-button", {
108
107
  appearance: "solid",
109
108
  kind: "neutral",
110
109
  iconStart: "arrow-left",
@@ -112,14 +111,14 @@ var Home = function Home(_ref) {
112
111
  onClick: function onClick() {
113
112
  return navigate(activeIndex - 1);
114
113
  }
115
- }), /*#__PURE__*/jsxRuntime.jsx(calciteComponentsReact.CalciteButton, {
114
+ }), /*#__PURE__*/jsxRuntime.jsx("calcite-button", {
116
115
  appearance: "solid",
117
116
  kind: "neutral",
118
117
  iconStart: "home",
119
118
  onClick: function onClick() {
120
119
  return gotoHome();
121
120
  }
122
- }), enableHistory && /*#__PURE__*/jsxRuntime.jsx(calciteComponentsReact.CalciteButton, {
121
+ }), enableHistory && /*#__PURE__*/jsxRuntime.jsx("calcite-button", {
123
122
  appearance: "solid",
124
123
  kind: "neutral",
125
124
  iconStart: "arrow-right",
@@ -129,6 +128,6 @@ var Home = function Home(_ref) {
129
128
  }
130
129
  })]
131
130
  });
132
- };
131
+ }
133
132
 
134
133
  exports.Home = Home;
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var mapComponentsReact = require('@arcgis/map-components-react');
4
3
  require('@arcgis/map-components/components/arcgis-expand');
5
4
  require('@arcgis/map-components/components/arcgis-layer-list');
6
5
  var jsxRuntime = require('react/jsx-runtime');
@@ -28,16 +27,16 @@ 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 LayerList = function LayerList() {
32
- return /*#__PURE__*/jsxRuntime.jsx(mapComponentsReact.ArcgisExpand, {
30
+ function LayerList() {
31
+ return /*#__PURE__*/jsxRuntime.jsx("arcgis-expand", {
33
32
  expandIcon: "layers",
34
33
  className: "mb-2",
35
34
  collapseIcon: "x",
36
35
  mode: "floating",
37
36
  slot: "top-right",
38
37
  autoCollapse: true,
39
- children: /*#__PURE__*/jsxRuntime.jsx(mapComponentsReact.ArcgisLayerList, {})
38
+ children: /*#__PURE__*/jsxRuntime.jsx("arcgis-layer-list", {})
40
39
  });
41
- };
40
+ }
42
41
 
43
42
  exports.LayerList = LayerList;
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var mapComponentsReact = require('@arcgis/map-components-react');
4
3
  require('@arcgis/map-components/components/arcgis-scale-bar');
5
4
  var jsxRuntime = require('react/jsx-runtime');
6
5
 
@@ -27,10 +26,10 @@ var jsxRuntime = require('react/jsx-runtime');
27
26
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
27
  */
29
28
 
30
- var ScaleBar = function ScaleBar() {
31
- return /*#__PURE__*/jsxRuntime.jsx(mapComponentsReact.ArcgisScaleBar, {
29
+ function ScaleBar() {
30
+ return /*#__PURE__*/jsxRuntime.jsx("arcgis-scale-bar", {
32
31
  slot: "bottom-left"
33
32
  });
34
- };
33
+ }
35
34
 
36
35
  exports.ScaleBar = ScaleBar;
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var mapComponentsReact = require('@arcgis/map-components-react');
4
3
  require('@arcgis/map-components/components/arcgis-zoom');
5
4
  var context = require('../viewer/context.js');
6
5
  var jsxRuntime = require('react/jsx-runtime');
@@ -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() {
30
+ function Zoom() {
32
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');
16
14
  var context = require('./context.js');
17
15
  var jsxRuntime = require('react/jsx-runtime');
18
16
 
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.MapContext.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,6 +119,6 @@ var MapProvider = function MapProvider(_ref) {
123
119
  }), children]
124
120
  })
125
121
  });
126
- };
122
+ }
127
123
 
128
124
  exports.MapProvider = MapProvider;
@@ -10,7 +10,7 @@ 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,7 +18,7 @@ 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
23
  children: /*#__PURE__*/jsxRuntime.jsx(Provider.MapProvider, _objectSpread(_objectSpread({}, props), {}, {
24
24
  children: children
@@ -27,7 +27,7 @@ var react = require('react');
27
27
 
28
28
  var MapContext = /*#__PURE__*/react.createContext({});
29
29
  var useMap = function useMap() {
30
- return react.useContext(MapContext);
30
+ return react.use(MapContext);
31
31
  };
32
32
 
33
33
  exports.MapContext = MapContext;