@planet/maps 10.3.0 → 11.0.0-dev.1740075628963

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 (92) hide show
  1. package/Map.js +43 -32
  2. package/Overlay.js +4 -6
  3. package/View.js +4 -6
  4. package/control/Attribution.js +4 -6
  5. package/control/Control.js +4 -6
  6. package/control/FullScreen.js +4 -6
  7. package/control/MousePosition.js +4 -6
  8. package/control/OverviewMap.js +4 -6
  9. package/control/Rotate.js +4 -6
  10. package/control/ScaleLine.js +4 -6
  11. package/control/Zoom.js +4 -6
  12. package/control/ZoomSlider.js +4 -6
  13. package/control/ZoomToExtent.js +4 -6
  14. package/interaction/DblClickDragZoom.js +4 -6
  15. package/interaction/DoubleClickZoom.js +4 -6
  16. package/interaction/DragAndDrop.js +4 -6
  17. package/interaction/DragBox.js +4 -6
  18. package/interaction/DragPan.js +4 -6
  19. package/interaction/DragRotate.js +4 -6
  20. package/interaction/DragRotateAndZoom.js +4 -10
  21. package/interaction/DragZoom.js +4 -6
  22. package/interaction/Draw.js +4 -6
  23. package/interaction/Extent.js +4 -6
  24. package/interaction/Interaction.js +4 -6
  25. package/interaction/KeyboardPan.js +4 -6
  26. package/interaction/KeyboardZoom.js +4 -6
  27. package/interaction/Link.js +4 -6
  28. package/interaction/Modify.js +4 -6
  29. package/interaction/MouseWheelZoom.js +4 -6
  30. package/interaction/PinchRotate.js +4 -6
  31. package/interaction/PinchZoom.js +4 -6
  32. package/interaction/Pointer.js +4 -6
  33. package/interaction/Property.js +4 -6
  34. package/interaction/Select.js +4 -6
  35. package/interaction/Snap.js +4 -6
  36. package/interaction/Translate.js +4 -6
  37. package/internal/config.js +1 -0
  38. package/internal/render.js +103 -20
  39. package/internal/update.js +1 -0
  40. package/layer/Base.js +4 -6
  41. package/layer/BaseImage.js +4 -6
  42. package/layer/BaseTile.js +4 -6
  43. package/layer/BaseVector.js +4 -6
  44. package/layer/Flow.js +4 -6
  45. package/layer/Graticule.js +4 -6
  46. package/layer/Group.js +4 -6
  47. package/layer/Heatmap.js +4 -6
  48. package/layer/Image.js +4 -6
  49. package/layer/Layer.js +4 -6
  50. package/layer/MapboxVector.js +4 -10
  51. package/layer/Tile.js +4 -6
  52. package/layer/Vector.js +4 -6
  53. package/layer/VectorImage.js +4 -6
  54. package/layer/VectorTile.js +4 -6
  55. package/layer/WebGLPoints.js +4 -6
  56. package/layer/WebGLTile.js +4 -6
  57. package/layer/WebGLVector.js +4 -6
  58. package/package.json +28 -14
  59. package/source/BingMaps.js +4 -6
  60. package/source/CartoDB.js +4 -6
  61. package/source/Cluster.js +4 -6
  62. package/source/DataTile.js +4 -6
  63. package/source/GeoTIFF.js +4 -6
  64. package/source/Google.js +4 -6
  65. package/source/IIIF.js +4 -6
  66. package/source/Image.js +4 -6
  67. package/source/ImageArcGISRest.js +4 -6
  68. package/source/ImageCanvas.js +4 -6
  69. package/source/ImageMapGuide.js +4 -6
  70. package/source/ImageStatic.js +4 -6
  71. package/source/ImageTile.js +4 -6
  72. package/source/ImageWMS.js +4 -6
  73. package/source/OGCMapTile.js +4 -6
  74. package/source/OGCVectorTile.js +4 -6
  75. package/source/OSM.js +4 -6
  76. package/source/Raster.js +4 -6
  77. package/source/SentinelHub.js +4 -6
  78. package/source/Source.js +4 -6
  79. package/source/StadiaMaps.js +4 -6
  80. package/source/Tile.js +4 -6
  81. package/source/TileArcGISRest.js +4 -6
  82. package/source/TileDebug.js +4 -6
  83. package/source/TileImage.js +4 -6
  84. package/source/TileJSON.js +4 -6
  85. package/source/TileWMS.js +4 -6
  86. package/source/UTFGrid.js +4 -6
  87. package/source/UrlTile.js +4 -6
  88. package/source/Vector.js +4 -6
  89. package/source/VectorTile.js +4 -6
  90. package/source/WMTS.js +4 -6
  91. package/source/XYZ.js +4 -6
  92. package/source/Zoomify.js +4 -6
package/Map.js CHANGED
@@ -15,7 +15,8 @@
15
15
  */
16
16
  import OLMap from 'ol/Map.js';
17
17
  import propTypes from 'prop-types';
18
- import {Component, createElement, createRef, forwardRef} from 'react';
18
+ import {MAP} from './internal/config.js';
19
+ import {createElement, useCallback, useEffect, useRef} from 'react';
19
20
  import {render, updateInstanceFromProps} from './internal/render.js';
20
21
 
21
22
  const defaultDivStyle = {
@@ -23,38 +24,51 @@ const defaultDivStyle = {
23
24
  width: '100%',
24
25
  };
25
26
 
26
- class Map extends Component {
27
- constructor(props) {
28
- super(props);
27
+ export default function Map({
28
+ id,
29
+ style = defaultDivStyle,
30
+ className,
31
+ children,
32
+ ref,
33
+ options,
34
+ ...mapProps
35
+ }) {
36
+ const targetRef = useRef();
37
+ const mapRef = useRef();
29
38
 
30
- this.targetRef = createRef();
39
+ const getMap = useCallback(() => {
40
+ // avoid creating new map when options object is different
41
+ if (mapRef.current) {
42
+ return mapRef.current;
43
+ }
44
+
45
+ const map = new OLMap(options);
46
+ mapRef.current = map;
47
+ return map;
48
+ }, [options]);
31
49
 
32
- const {id, style, className, innerRef, options, ...mapProps} = props;
33
- this.map = new OLMap({...options});
34
- if (innerRef) {
35
- if (typeof innerRef === 'function') {
36
- innerRef(this.map);
50
+ useEffect(() => {
51
+ const map = getMap();
52
+ map.setTarget(targetRef.current);
53
+ }, [getMap]);
54
+
55
+ useEffect(() => {
56
+ const map = getMap();
57
+ if (ref) {
58
+ if (typeof ref === 'function') {
59
+ ref(map);
37
60
  } else {
38
- innerRef.current = this.map;
61
+ ref.current = map;
39
62
  }
40
63
  }
41
- updateInstanceFromProps(this.map, mapProps);
42
- }
43
-
44
- componentDidMount() {
45
- this.map.setTarget(this.targetRef.current);
46
- render(this.props.children, this.map);
47
- }
48
-
49
- componentDidUpdate() {
50
- // TODO: apply map prop changes
51
- render(this.props.children, this.map);
52
- }
64
+ if (!mapRef.current) {
65
+ return;
66
+ }
67
+ updateInstanceFromProps(map, MAP, {}, mapProps);
68
+ render(children, map);
69
+ }, [children, getMap, mapProps, ref]);
53
70
 
54
- render() {
55
- const {id, style = defaultDivStyle, className} = this.props;
56
- return createElement('div', {ref: this.targetRef, id, style, className});
57
- }
71
+ return createElement('div', {ref: targetRef, id, style, className});
58
72
  }
59
73
 
60
74
  Map.propTypes = {
@@ -62,12 +76,9 @@ Map.propTypes = {
62
76
  id: propTypes.string,
63
77
  style: propTypes.object,
64
78
  children: propTypes.node,
65
- innerRef: propTypes.oneOfType([
79
+ options: propTypes.object,
80
+ ref: propTypes.oneOfType([
66
81
  propTypes.func,
67
82
  propTypes.shape({current: propTypes.any}),
68
83
  ]),
69
84
  };
70
-
71
- export default forwardRef((props, ref) =>
72
- createElement(Map, {innerRef: ref, ...props}),
73
- );
package/Overlay.js CHANGED
@@ -15,10 +15,8 @@
15
15
  */
16
16
  import OLOverlay from 'ol/Overlay.js';
17
17
  import {OVERLAY} from './internal/config.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Overlay = forwardRef((props, ref) => {
21
- return createElement(OVERLAY, {cls: OLOverlay, ref, ...props});
22
- });
23
-
24
- export default Overlay;
20
+ export default function Overlay(props) {
21
+ return createElement(OVERLAY, {cls: OLOverlay, ...props});
22
+ }
package/View.js CHANGED
@@ -15,10 +15,8 @@
15
15
  */
16
16
  import OLView from 'ol/View.js';
17
17
  import {VIEW} from './internal/config.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const View = forwardRef((props, ref) => {
21
- return createElement(VIEW, {cls: OLView, ref, ...props});
22
- });
23
-
24
- export default View;
20
+ export default function View(props) {
21
+ return createElement(VIEW, {cls: OLView, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLAttribution from 'ol/control/Attribution.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Attribution = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLAttribution, ref, ...props});
22
- });
23
-
24
- export default Attribution;
20
+ export default function Attribution(props) {
21
+ return createElement('control', {cls: OLAttribution, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLControl from 'ol/control/Control.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Control = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLControl, ref, ...props});
22
- });
23
-
24
- export default Control;
20
+ export default function Control(props) {
21
+ return createElement('control', {cls: OLControl, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLFullScreen from 'ol/control/FullScreen.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const FullScreen = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLFullScreen, ref, ...props});
22
- });
23
-
24
- export default FullScreen;
20
+ export default function FullScreen(props) {
21
+ return createElement('control', {cls: OLFullScreen, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLMousePosition from 'ol/control/MousePosition.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const MousePosition = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLMousePosition, ref, ...props});
22
- });
23
-
24
- export default MousePosition;
20
+ export default function MousePosition(props) {
21
+ return createElement('control', {cls: OLMousePosition, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLOverviewMap from 'ol/control/OverviewMap.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const OverviewMap = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLOverviewMap, ref, ...props});
22
- });
23
-
24
- export default OverviewMap;
20
+ export default function OverviewMap(props) {
21
+ return createElement('control', {cls: OLOverviewMap, ...props});
22
+ }
package/control/Rotate.js CHANGED
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLRotate from 'ol/control/Rotate.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Rotate = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLRotate, ref, ...props});
22
- });
23
-
24
- export default Rotate;
20
+ export default function Rotate(props) {
21
+ return createElement('control', {cls: OLRotate, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLScaleLine from 'ol/control/ScaleLine.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const ScaleLine = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLScaleLine, ref, ...props});
22
- });
23
-
24
- export default ScaleLine;
20
+ export default function ScaleLine(props) {
21
+ return createElement('control', {cls: OLScaleLine, ...props});
22
+ }
package/control/Zoom.js CHANGED
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLZoom from 'ol/control/Zoom.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Zoom = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLZoom, ref, ...props});
22
- });
23
-
24
- export default Zoom;
20
+ export default function Zoom(props) {
21
+ return createElement('control', {cls: OLZoom, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLZoomSlider from 'ol/control/ZoomSlider.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const ZoomSlider = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLZoomSlider, ref, ...props});
22
- });
23
-
24
- export default ZoomSlider;
20
+ export default function ZoomSlider(props) {
21
+ return createElement('control', {cls: OLZoomSlider, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLZoomToExtent from 'ol/control/ZoomToExtent.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const ZoomToExtent = forwardRef((props, ref) => {
21
- return createElement('control', {cls: OLZoomToExtent, ref, ...props});
22
- });
23
-
24
- export default ZoomToExtent;
20
+ export default function ZoomToExtent(props) {
21
+ return createElement('control', {cls: OLZoomToExtent, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDblClickDragZoom from 'ol/interaction/DblClickDragZoom.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const DblClickDragZoom = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLDblClickDragZoom, ref, ...props});
22
- });
23
-
24
- export default DblClickDragZoom;
20
+ export default function DblClickDragZoom(props) {
21
+ return createElement('interaction', {cls: OLDblClickDragZoom, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDoubleClickZoom from 'ol/interaction/DoubleClickZoom.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const DoubleClickZoom = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLDoubleClickZoom, ref, ...props});
22
- });
23
-
24
- export default DoubleClickZoom;
20
+ export default function DoubleClickZoom(props) {
21
+ return createElement('interaction', {cls: OLDoubleClickZoom, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDragAndDrop from 'ol/interaction/DragAndDrop.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const DragAndDrop = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLDragAndDrop, ref, ...props});
22
- });
23
-
24
- export default DragAndDrop;
20
+ export default function DragAndDrop(props) {
21
+ return createElement('interaction', {cls: OLDragAndDrop, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDragBox from 'ol/interaction/DragBox.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const DragBox = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLDragBox, ref, ...props});
22
- });
23
-
24
- export default DragBox;
20
+ export default function DragBox(props) {
21
+ return createElement('interaction', {cls: OLDragBox, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDragPan from 'ol/interaction/DragPan.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const DragPan = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLDragPan, ref, ...props});
22
- });
23
-
24
- export default DragPan;
20
+ export default function DragPan(props) {
21
+ return createElement('interaction', {cls: OLDragPan, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDragRotate from 'ol/interaction/DragRotate.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const DragRotate = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLDragRotate, ref, ...props});
22
- });
23
-
24
- export default DragRotate;
20
+ export default function DragRotate(props) {
21
+ return createElement('interaction', {cls: OLDragRotate, ...props});
22
+ }
@@ -15,14 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDragRotateAndZoom from 'ol/interaction/DragRotateAndZoom.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const DragRotateAndZoom = forwardRef((props, ref) => {
21
- return createElement('interaction', {
22
- cls: OLDragRotateAndZoom,
23
- ref,
24
- ...props,
25
- });
26
- });
27
-
28
- export default DragRotateAndZoom;
20
+ export default function DragRotateAndZoom(props) {
21
+ return createElement('interaction', {cls: OLDragRotateAndZoom, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDragZoom from 'ol/interaction/DragZoom.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const DragZoom = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLDragZoom, ref, ...props});
22
- });
23
-
24
- export default DragZoom;
20
+ export default function DragZoom(props) {
21
+ return createElement('interaction', {cls: OLDragZoom, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLDraw from 'ol/interaction/Draw.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Draw = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLDraw, ref, ...props});
22
- });
23
-
24
- export default Draw;
20
+ export default function Draw(props) {
21
+ return createElement('interaction', {cls: OLDraw, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLExtent from 'ol/interaction/Extent.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Extent = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLExtent, ref, ...props});
22
- });
23
-
24
- export default Extent;
20
+ export default function Extent(props) {
21
+ return createElement('interaction', {cls: OLExtent, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLInteraction from 'ol/interaction/Interaction.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Interaction = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLInteraction, ref, ...props});
22
- });
23
-
24
- export default Interaction;
20
+ export default function Interaction(props) {
21
+ return createElement('interaction', {cls: OLInteraction, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLKeyboardPan from 'ol/interaction/KeyboardPan.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const KeyboardPan = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLKeyboardPan, ref, ...props});
22
- });
23
-
24
- export default KeyboardPan;
20
+ export default function KeyboardPan(props) {
21
+ return createElement('interaction', {cls: OLKeyboardPan, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLKeyboardZoom from 'ol/interaction/KeyboardZoom.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const KeyboardZoom = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLKeyboardZoom, ref, ...props});
22
- });
23
-
24
- export default KeyboardZoom;
20
+ export default function KeyboardZoom(props) {
21
+ return createElement('interaction', {cls: OLKeyboardZoom, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLLink from 'ol/interaction/Link.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Link = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLLink, ref, ...props});
22
- });
23
-
24
- export default Link;
20
+ export default function Link(props) {
21
+ return createElement('interaction', {cls: OLLink, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLModify from 'ol/interaction/Modify.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Modify = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLModify, ref, ...props});
22
- });
23
-
24
- export default Modify;
20
+ export default function Modify(props) {
21
+ return createElement('interaction', {cls: OLModify, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLMouseWheelZoom from 'ol/interaction/MouseWheelZoom.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const MouseWheelZoom = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLMouseWheelZoom, ref, ...props});
22
- });
23
-
24
- export default MouseWheelZoom;
20
+ export default function MouseWheelZoom(props) {
21
+ return createElement('interaction', {cls: OLMouseWheelZoom, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLPinchRotate from 'ol/interaction/PinchRotate.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const PinchRotate = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLPinchRotate, ref, ...props});
22
- });
23
-
24
- export default PinchRotate;
20
+ export default function PinchRotate(props) {
21
+ return createElement('interaction', {cls: OLPinchRotate, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLPinchZoom from 'ol/interaction/PinchZoom.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const PinchZoom = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLPinchZoom, ref, ...props});
22
- });
23
-
24
- export default PinchZoom;
20
+ export default function PinchZoom(props) {
21
+ return createElement('interaction', {cls: OLPinchZoom, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLPointer from 'ol/interaction/Pointer.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Pointer = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLPointer, ref, ...props});
22
- });
23
-
24
- export default Pointer;
20
+ export default function Pointer(props) {
21
+ return createElement('interaction', {cls: OLPointer, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLProperty from 'ol/interaction/Property.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Property = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLProperty, ref, ...props});
22
- });
23
-
24
- export default Property;
20
+ export default function Property(props) {
21
+ return createElement('interaction', {cls: OLProperty, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLSelect from 'ol/interaction/Select.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Select = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLSelect, ref, ...props});
22
- });
23
-
24
- export default Select;
20
+ export default function Select(props) {
21
+ return createElement('interaction', {cls: OLSelect, ...props});
22
+ }