@planet/maps 10.3.0 → 11.0.0-dev.1740094978574

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 (93) 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 +109 -26
  39. package/internal/update.js +4 -3
  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 +5 -11
  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/layer/WebGLVectorTile.js +27 -0
  59. package/package.json +14 -70
  60. package/source/BingMaps.js +4 -6
  61. package/source/CartoDB.js +4 -6
  62. package/source/Cluster.js +4 -6
  63. package/source/DataTile.js +4 -6
  64. package/source/GeoTIFF.js +4 -6
  65. package/source/Google.js +4 -6
  66. package/source/IIIF.js +4 -6
  67. package/source/Image.js +4 -6
  68. package/source/ImageArcGISRest.js +4 -6
  69. package/source/ImageCanvas.js +4 -6
  70. package/source/ImageMapGuide.js +4 -6
  71. package/source/ImageStatic.js +4 -6
  72. package/source/ImageTile.js +4 -6
  73. package/source/ImageWMS.js +4 -6
  74. package/source/OGCMapTile.js +4 -6
  75. package/source/OGCVectorTile.js +4 -6
  76. package/source/OSM.js +4 -6
  77. package/source/Raster.js +4 -6
  78. package/source/SentinelHub.js +4 -6
  79. package/source/Source.js +4 -6
  80. package/source/StadiaMaps.js +4 -6
  81. package/source/Tile.js +4 -6
  82. package/source/TileArcGISRest.js +4 -6
  83. package/source/TileDebug.js +4 -6
  84. package/source/TileImage.js +4 -6
  85. package/source/TileJSON.js +4 -6
  86. package/source/TileWMS.js +4 -6
  87. package/source/UTFGrid.js +4 -6
  88. package/source/UrlTile.js +4 -6
  89. package/source/Vector.js +4 -6
  90. package/source/VectorTile.js +4 -6
  91. package/source/WMTS.js +4 -6
  92. package/source/XYZ.js +4 -6
  93. package/source/Zoomify.js +4 -6
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLSnap from 'ol/interaction/Snap.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Snap = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLSnap, ref, ...props});
22
- });
23
-
24
- export default Snap;
20
+ export default function Snap(props) {
21
+ return createElement('interaction', {cls: OLSnap, ...props});
22
+ }
@@ -15,10 +15,8 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import OLTranslate from 'ol/interaction/Translate.js';
18
- import {createElement, forwardRef} from 'react';
18
+ import {createElement} from 'react';
19
19
 
20
- const Translate = forwardRef((props, ref) => {
21
- return createElement('interaction', {cls: OLTranslate, ref, ...props});
22
- });
23
-
24
- export default Translate;
20
+ export default function Translate(props) {
21
+ return createElement('interaction', {cls: OLTranslate, ...props});
22
+ }
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * The constants below represent the primitive element types handled by the renderer.
3
3
  */
4
+ export const MAP = 'map';
4
5
  export const VIEW = 'view';
5
6
  export const OVERLAY = 'overlay';
6
7
  export const CONTROL = 'control';
@@ -1,16 +1,17 @@
1
- import BaseLayer from 'ol/layer/Base.js';
1
+ import Overlay from 'ol/Overlay.js';
2
+ import View from 'ol/View.js';
2
3
  import Control from 'ol/control/Control.js';
3
- import GroupLayer from 'ol/layer/Group.js';
4
4
  import Interaction from 'ol/interaction/Interaction.js';
5
- import Overlay from 'ol/Overlay.js';
6
- import ReactReconciler from 'react-reconciler';
5
+ import BaseLayer from 'ol/layer/Base.js';
6
+ import GroupLayer from 'ol/layer/Group.js';
7
7
  import Source from 'ol/source/Source.js';
8
- import View from 'ol/View.js';
9
- import {CONTROL, INTERACTION, LAYER, OVERLAY, SOURCE, VIEW} from './config.js';
8
+ import ReactReconciler from 'react-reconciler';
10
9
  import {
11
10
  ConcurrentRoot,
12
11
  DefaultEventPriority,
12
+ NoEventPriority,
13
13
  } from 'react-reconciler/constants.js';
14
+ import {CONTROL, INTERACTION, LAYER, OVERLAY, SOURCE, VIEW} from './config.js';
14
15
  import {
15
16
  prepareControlUpdate,
16
17
  prepareInteractionUpdate,
@@ -41,20 +42,52 @@ const knownTypes = {
41
42
  [SOURCE]: true,
42
43
  };
43
44
 
44
- export function updateInstanceFromProps(instance, props, oldProps = {}) {
45
- for (const key in props) {
45
+ /**
46
+ * @param {Array} a1 An array.
47
+ * @param {Array} a2 An array.
48
+ * @return {boolean} All elements in the array are the same;
49
+ */
50
+ function arrayEquals(a1, a2) {
51
+ if (!a1 || !a2) {
52
+ return false;
53
+ }
54
+ const len1 = a1.length;
55
+ const len2 = a2.length;
56
+ if (len1 !== len2) {
57
+ return false;
58
+ }
59
+ for (let i = 0; i < len1; i += 1) {
60
+ const v1 = a1[i];
61
+ const v2 = a2[i];
62
+ if (v1 !== v2) {
63
+ return false;
64
+ }
65
+ }
66
+ return true;
67
+ }
68
+
69
+ export function updateInstanceFromProps(instance, type, oldProps, newProps) {
70
+ for (const key in newProps) {
46
71
  if (reservedProps[key]) {
47
72
  continue;
48
73
  }
74
+ const newValue = newProps[key];
75
+ const oldValue = oldProps[key];
76
+ if (oldValue === newValue) {
77
+ continue;
78
+ }
79
+
49
80
  if (listenerRegex.test(key)) {
50
- const listener = props[key];
51
- const type = key
81
+ const listener = newProps[key];
82
+ const eventType = key
52
83
  .replace(listenerColonRegex, 'onChange:')
53
84
  .replace(listenerRegex, '$1')
54
85
  .toLowerCase();
55
- instance.on(type, listener);
56
- if (oldProps[key]) {
57
- instance.un(type, oldProps[key]);
86
+ instance.on(eventType, listener);
87
+
88
+ const oldListener = oldProps[key];
89
+ if (oldListener) {
90
+ instance.un(eventType, oldListener);
58
91
  if (instance.changed) {
59
92
  instance.changed();
60
93
  }
@@ -62,16 +95,20 @@ export function updateInstanceFromProps(instance, props, oldProps = {}) {
62
95
  continue;
63
96
  }
64
97
 
98
+ if (key === 'center' && arrayEquals(newValue, oldValue)) {
99
+ continue;
100
+ }
101
+
65
102
  const setter = setterName(key);
66
103
  if (typeof instance[setter] === 'function') {
67
- instance[setter](props[key]);
104
+ instance[setter](newValue);
68
105
  continue;
69
106
  }
70
107
 
71
108
  if (key === 'features' && typeof instance.addFeatures === 'function') {
72
109
  // TODO: there is likely a smarter way to diff features
73
110
  instance.clear(true);
74
- instance.addFeatures(props[key]);
111
+ instance.addFeatures(newValue);
75
112
  continue;
76
113
  }
77
114
 
@@ -80,12 +117,12 @@ export function updateInstanceFromProps(instance, props, oldProps = {}) {
80
117
  typeof instance.addInteraction === 'function'
81
118
  ) {
82
119
  instance.getInteractions().clear();
83
- props[key].forEach(interaction => instance.addInteraction(interaction));
120
+ newValue.forEach(interaction => instance.addInteraction(interaction));
84
121
  continue;
85
122
  }
86
123
  if (key === 'controls' && typeof instance.addControl === 'function') {
87
124
  instance.getControls().clear();
88
- props[key].forEach(control => instance.addControl(control));
125
+ newValue.forEach(control => instance.addControl(control));
89
126
  continue;
90
127
  }
91
128
 
@@ -102,7 +139,7 @@ function createInstance(type, {cls: Constructor, ...props}) {
102
139
  }
103
140
 
104
141
  const instance = new Constructor(props.options || {});
105
- updateInstanceFromProps(instance, props);
142
+ updateInstanceFromProps(instance, type, {}, props);
106
143
  return instance;
107
144
  }
108
145
 
@@ -167,8 +204,8 @@ function prepareUpdate(instance, type, oldProps, newProps) {
167
204
  return updater(instance, type, oldProps, newProps);
168
205
  }
169
206
 
170
- function commitUpdate(instance, updatePayload, type, oldProps) {
171
- updateInstanceFromProps(instance, updatePayload, oldProps);
207
+ function commitUpdate(instance, type, oldProps, newProps) {
208
+ updateInstanceFromProps(instance, type, oldProps, newProps);
172
209
  }
173
210
 
174
211
  function removeChildFromContainer(map, child) {
@@ -247,6 +284,9 @@ function insertBefore(parent, child, beforeChild) {
247
284
  throw new Error(`Cannot insert child ${child} into parent ${parent}`);
248
285
  }
249
286
 
287
+ const noContext = {};
288
+ let currentUpdatePriority = NoEventPriority;
289
+
250
290
  const reconciler = ReactReconciler({
251
291
  supportsMutation: true,
252
292
  isPrimaryRenderer: false,
@@ -260,21 +300,66 @@ const reconciler = ReactReconciler({
260
300
  clearContainer,
261
301
  removeChildFromContainer,
262
302
  removeChild,
263
-
264
303
  insertInContainerBefore,
265
304
  insertBefore,
305
+ noTimeout: -1,
306
+
307
+ getInstanceFromNode() {
308
+ return null;
309
+ },
310
+
311
+ shouldAttemptEagerTransition() {
312
+ return false;
313
+ },
314
+
315
+ requestPostPaintCallback() {},
316
+
317
+ maySuspendCommit() {
318
+ return false;
319
+ },
320
+
321
+ preloadInstance() {
322
+ return true;
323
+ },
324
+
325
+ startSuspendingCommit() {},
326
+
327
+ suspendInstance() {},
328
+
329
+ waitForCommitToBeReady() {
330
+ return null;
331
+ },
332
+
333
+ setCurrentUpdatePriority(newPriority) {
334
+ currentUpdatePriority = newPriority;
335
+ },
336
+
337
+ getCurrentUpdatePriority() {
338
+ return currentUpdatePriority;
339
+ },
340
+
341
+ resolveUpdatePriority() {
342
+ if (currentUpdatePriority) {
343
+ return currentUpdatePriority;
344
+ }
345
+ return DefaultEventPriority;
346
+ },
266
347
 
267
348
  finalizeInitialChildren() {
268
349
  return false;
269
350
  },
270
351
 
271
- getChildHostContext() {},
352
+ getChildHostContext() {
353
+ return noContext;
354
+ },
272
355
 
273
356
  getPublicInstance(instance) {
274
357
  return instance;
275
358
  },
276
359
 
277
- getRootHostContext() {},
360
+ getRootHostContext() {
361
+ return noContext;
362
+ },
278
363
 
279
364
  getCurrentEventPriority() {
280
365
  return DefaultEventPriority;
@@ -299,9 +384,7 @@ export function render(element, container) {
299
384
  let root = roots.get(container);
300
385
  if (!root) {
301
386
  const logRecoverableError =
302
- typeof reportError === 'function'
303
- ? reportError // eslint-disable-line no-undef
304
- : console.error; // eslint-disable-line no-console
387
+ typeof reportError === 'function' ? reportError : console.error; // eslint-disable-line no-console
305
388
 
306
389
  root = reconciler.createContainer(
307
390
  container,
@@ -14,6 +14,7 @@ export const reservedProps = {
14
14
  children: true,
15
15
  cls: true,
16
16
  options: true,
17
+ ref: true, // TODO: deal with changing ref
17
18
  };
18
19
 
19
20
  export function prepareViewUpdate(view, type, oldProps, newProps) {
@@ -90,9 +91,9 @@ function prepareGenericUpdate(instance, type, oldProps, newProps) {
90
91
  }
91
92
 
92
93
  export {
93
- prepareGenericUpdate as prepareOverlayUpdate,
94
- prepareGenericUpdate as prepareLayerUpdate,
95
- prepareGenericUpdate as prepareSourceUpdate,
96
94
  prepareGenericUpdate as prepareControlUpdate,
97
95
  prepareGenericUpdate as prepareInteractionUpdate,
96
+ prepareGenericUpdate as prepareLayerUpdate,
97
+ prepareGenericUpdate as prepareOverlayUpdate,
98
+ prepareGenericUpdate as prepareSourceUpdate,
98
99
  };
package/layer/Base.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLBase from 'ol/layer/Base.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Base = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLBase, ref, ...props}, children);
23
- });
21
+ export default function Base({children, ...props}) {
22
+ return createElement('layer', {cls: OLBase, ...props}, children);
23
+ }
24
24
 
25
25
  Base.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Base;
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLBaseImage from 'ol/layer/BaseImage.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const BaseImage = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLBaseImage, ref, ...props}, children);
23
- });
21
+ export default function BaseImage({children, ...props}) {
22
+ return createElement('layer', {cls: OLBaseImage, ...props}, children);
23
+ }
24
24
 
25
25
  BaseImage.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default BaseImage;
package/layer/BaseTile.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLBaseTile from 'ol/layer/BaseTile.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const BaseTile = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLBaseTile, ref, ...props}, children);
23
- });
21
+ export default function BaseTile({children, ...props}) {
22
+ return createElement('layer', {cls: OLBaseTile, ...props}, children);
23
+ }
24
24
 
25
25
  BaseTile.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default BaseTile;
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLBaseVector from 'ol/layer/BaseVector.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const BaseVector = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLBaseVector, ref, ...props}, children);
23
- });
21
+ export default function BaseVector({children, ...props}) {
22
+ return createElement('layer', {cls: OLBaseVector, ...props}, children);
23
+ }
24
24
 
25
25
  BaseVector.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default BaseVector;
package/layer/Flow.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLFlow from 'ol/layer/Flow.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Flow = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLFlow, ref, ...props}, children);
23
- });
21
+ export default function Flow({children, ...props}) {
22
+ return createElement('layer', {cls: OLFlow, ...props}, children);
23
+ }
24
24
 
25
25
  Flow.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Flow;
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLGraticule from 'ol/layer/Graticule.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Graticule = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLGraticule, ref, ...props}, children);
23
- });
21
+ export default function Graticule({children, ...props}) {
22
+ return createElement('layer', {cls: OLGraticule, ...props}, children);
23
+ }
24
24
 
25
25
  Graticule.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Graticule;
package/layer/Group.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLGroup from 'ol/layer/Group.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Group = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLGroup, ref, ...props}, children);
23
- });
21
+ export default function Group({children, ...props}) {
22
+ return createElement('layer', {cls: OLGroup, ...props}, children);
23
+ }
24
24
 
25
25
  Group.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Group;
package/layer/Heatmap.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLHeatmap from 'ol/layer/Heatmap.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Heatmap = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLHeatmap, ref, ...props}, children);
23
- });
21
+ export default function Heatmap({children, ...props}) {
22
+ return createElement('layer', {cls: OLHeatmap, ...props}, children);
23
+ }
24
24
 
25
25
  Heatmap.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Heatmap;
package/layer/Image.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLImage from 'ol/layer/Image.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Image = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLImage, ref, ...props}, children);
23
- });
21
+ export default function Image({children, ...props}) {
22
+ return createElement('layer', {cls: OLImage, ...props}, children);
23
+ }
24
24
 
25
25
  Image.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Image;
package/layer/Layer.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLLayer from 'ol/layer/Layer.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Layer = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLLayer, ref, ...props}, children);
23
- });
21
+ export default function Layer({children, ...props}) {
22
+ return createElement('layer', {cls: OLLayer, ...props}, children);
23
+ }
24
24
 
25
25
  Layer.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Layer;
@@ -14,20 +14,14 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- import propTypes from 'prop-types';
18
17
  import {MapboxVectorLayer as OLMBVectorLayer} from 'ol-mapbox-style';
19
- import {createElement, forwardRef} from 'react';
18
+ import propTypes from 'prop-types';
19
+ import {createElement} from 'react';
20
20
 
21
- const MapboxVector = forwardRef(({children, ...props}, ref) => {
22
- return createElement(
23
- 'layer',
24
- {cls: OLMBVectorLayer, ref, ...props},
25
- children,
26
- );
27
- });
21
+ export default function MapboxVector({children, ...props}) {
22
+ return createElement('layer', {cls: OLMBVectorLayer, ...props}, children);
23
+ }
28
24
 
29
25
  MapboxVector.propTypes = {
30
26
  children: propTypes.node,
31
27
  };
32
-
33
- export default MapboxVector;
package/layer/Tile.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLTile from 'ol/layer/Tile.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Tile = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLTile, ref, ...props}, children);
23
- });
21
+ export default function Tile({children, ...props}) {
22
+ return createElement('layer', {cls: OLTile, ...props}, children);
23
+ }
24
24
 
25
25
  Tile.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Tile;
package/layer/Vector.js CHANGED
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLVector from 'ol/layer/Vector.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const Vector = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLVector, ref, ...props}, children);
23
- });
21
+ export default function Vector({children, ...props}) {
22
+ return createElement('layer', {cls: OLVector, ...props}, children);
23
+ }
24
24
 
25
25
  Vector.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default Vector;
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLVectorImage from 'ol/layer/VectorImage.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const VectorImage = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLVectorImage, ref, ...props}, children);
23
- });
21
+ export default function VectorImage({children, ...props}) {
22
+ return createElement('layer', {cls: OLVectorImage, ...props}, children);
23
+ }
24
24
 
25
25
  VectorImage.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default VectorImage;
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLVectorTile from 'ol/layer/VectorTile.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const VectorTile = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLVectorTile, ref, ...props}, children);
23
- });
21
+ export default function VectorTile({children, ...props}) {
22
+ return createElement('layer', {cls: OLVectorTile, ...props}, children);
23
+ }
24
24
 
25
25
  VectorTile.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default VectorTile;
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLWebGLPoints from 'ol/layer/WebGLPoints.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const WebGLPoints = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLWebGLPoints, ref, ...props}, children);
23
- });
21
+ export default function WebGLPoints({children, ...props}) {
22
+ return createElement('layer', {cls: OLWebGLPoints, ...props}, children);
23
+ }
24
24
 
25
25
  WebGLPoints.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default WebGLPoints;
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLWebGLTile from 'ol/layer/WebGLTile.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const WebGLTile = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLWebGLTile, ref, ...props}, children);
23
- });
21
+ export default function WebGLTile({children, ...props}) {
22
+ return createElement('layer', {cls: OLWebGLTile, ...props}, children);
23
+ }
24
24
 
25
25
  WebGLTile.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default WebGLTile;
@@ -16,14 +16,12 @@
16
16
  */
17
17
  import OLWebGLVector from 'ol/layer/WebGLVector.js';
18
18
  import propTypes from 'prop-types';
19
- import {createElement, forwardRef} from 'react';
19
+ import {createElement} from 'react';
20
20
 
21
- const WebGLVector = forwardRef(({children, ...props}, ref) => {
22
- return createElement('layer', {cls: OLWebGLVector, ref, ...props}, children);
23
- });
21
+ export default function WebGLVector({children, ...props}) {
22
+ return createElement('layer', {cls: OLWebGLVector, ...props}, children);
23
+ }
24
24
 
25
25
  WebGLVector.propTypes = {
26
26
  children: propTypes.node,
27
27
  };
28
-
29
- export default WebGLVector;