@planet/maps 7.1.1-alpha-heat → 8.0.0-dev.1666714337006

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 (94) hide show
  1. package/LICENSE +202 -0
  2. package/config.js +32 -0
  3. package/lib/Map.js +70 -0
  4. package/lib/Overlay.js +24 -0
  5. package/lib/View.js +24 -0
  6. package/lib/control/Attribution.js +24 -0
  7. package/lib/control/Control.js +24 -0
  8. package/lib/control/FullScreen.js +24 -0
  9. package/lib/control/MousePosition.js +24 -0
  10. package/lib/control/OverviewMap.js +24 -0
  11. package/lib/control/Rotate.js +24 -0
  12. package/lib/control/ScaleLine.js +24 -0
  13. package/lib/control/Zoom.js +24 -0
  14. package/lib/control/ZoomSlider.js +24 -0
  15. package/lib/control/ZoomToExtent.js +24 -0
  16. package/lib/interaction/DoubleClickZoom.js +24 -0
  17. package/lib/interaction/DragAndDrop.js +24 -0
  18. package/lib/interaction/DragBox.js +24 -0
  19. package/lib/interaction/DragPan.js +24 -0
  20. package/lib/interaction/DragRotate.js +24 -0
  21. package/lib/interaction/DragRotateAndZoom.js +28 -0
  22. package/lib/interaction/DragZoom.js +24 -0
  23. package/lib/interaction/Draw.js +24 -0
  24. package/lib/interaction/Extent.js +24 -0
  25. package/lib/interaction/Interaction.js +24 -0
  26. package/lib/interaction/KeyboardPan.js +24 -0
  27. package/lib/interaction/KeyboardZoom.js +24 -0
  28. package/lib/interaction/Link.js +24 -0
  29. package/lib/interaction/Modify.js +24 -0
  30. package/lib/interaction/MouseWheelZoom.js +24 -0
  31. package/lib/interaction/PinchRotate.js +24 -0
  32. package/lib/interaction/PinchZoom.js +24 -0
  33. package/lib/interaction/Pointer.js +24 -0
  34. package/lib/interaction/Property.js +24 -0
  35. package/lib/interaction/Select.js +24 -0
  36. package/lib/interaction/Snap.js +24 -0
  37. package/lib/interaction/Translate.js +24 -0
  38. package/lib/layer/Base.js +29 -0
  39. package/lib/layer/BaseImage.js +29 -0
  40. package/lib/layer/BaseTile.js +29 -0
  41. package/lib/layer/BaseVector.js +29 -0
  42. package/lib/layer/Graticule.js +29 -0
  43. package/lib/layer/Group.js +29 -0
  44. package/lib/layer/Heatmap.js +29 -0
  45. package/lib/layer/Image.js +29 -0
  46. package/lib/layer/Layer.js +29 -0
  47. package/lib/layer/MapboxVector.js +29 -0
  48. package/lib/layer/Tile.js +29 -0
  49. package/lib/layer/Vector.js +29 -0
  50. package/lib/layer/VectorImage.js +29 -0
  51. package/lib/layer/VectorTile.js +29 -0
  52. package/lib/layer/WebGLPoints.js +29 -0
  53. package/lib/layer/WebGLTile.js +29 -0
  54. package/lib/source/BingMaps.js +24 -0
  55. package/lib/source/CartoDB.js +24 -0
  56. package/lib/source/Cluster.js +24 -0
  57. package/lib/source/DataTile.js +24 -0
  58. package/lib/source/GeoTIFF.js +24 -0
  59. package/lib/source/IIIF.js +24 -0
  60. package/lib/source/Image.js +24 -0
  61. package/lib/source/ImageArcGISRest.js +24 -0
  62. package/lib/source/ImageCanvas.js +24 -0
  63. package/lib/source/ImageMapGuide.js +24 -0
  64. package/lib/source/ImageStatic.js +24 -0
  65. package/lib/source/ImageWMS.js +24 -0
  66. package/lib/source/OGCMapTile.js +24 -0
  67. package/lib/source/OGCVectorTile.js +24 -0
  68. package/lib/source/OSM.js +24 -0
  69. package/lib/source/Raster.js +24 -0
  70. package/lib/source/Source.js +24 -0
  71. package/lib/source/Stamen.js +24 -0
  72. package/lib/source/Tile.js +24 -0
  73. package/lib/source/TileArcGISRest.js +24 -0
  74. package/lib/source/TileDebug.js +24 -0
  75. package/lib/source/TileImage.js +24 -0
  76. package/lib/source/TileJSON.js +24 -0
  77. package/lib/source/TileWMS.js +24 -0
  78. package/lib/source/UTFGrid.js +24 -0
  79. package/lib/source/UrlTile.js +24 -0
  80. package/lib/source/Vector.js +24 -0
  81. package/lib/source/VectorTile.js +24 -0
  82. package/lib/source/WMTS.js +24 -0
  83. package/lib/source/XYZ.js +24 -0
  84. package/lib/source/Zoomify.js +24 -0
  85. package/package.json +52 -17
  86. package/readme.md +53 -34
  87. package/renderer/render.js +304 -0
  88. package/renderer/update.js +98 -0
  89. package/.npmignore +0 -2
  90. package/common.js +0 -589
  91. package/debug.js +0 -92555
  92. package/embed.js +0 -431
  93. package/explorer.js +0 -92555
  94. package/ol.css +0 -241
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLOGCVectorTile from 'ol/source/OGCVectorTile.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const OGCVectorTile = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLOGCVectorTile, ref, ...props});
22
+ });
23
+
24
+ export default OGCVectorTile;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLOSM from 'ol/source/OSM.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const OSM = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLOSM, ref, ...props});
22
+ });
23
+
24
+ export default OSM;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLRaster from 'ol/source/Raster.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const Raster = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLRaster, ref, ...props});
22
+ });
23
+
24
+ export default Raster;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLSource from 'ol/source/Source.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const Source = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLSource, ref, ...props});
22
+ });
23
+
24
+ export default Source;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLStamen from 'ol/source/Stamen.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const Stamen = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLStamen, ref, ...props});
22
+ });
23
+
24
+ export default Stamen;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLTile from 'ol/source/Tile.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const Tile = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLTile, ref, ...props});
22
+ });
23
+
24
+ export default Tile;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLTileArcGISRest from 'ol/source/TileArcGISRest.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const TileArcGISRest = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLTileArcGISRest, ref, ...props});
22
+ });
23
+
24
+ export default TileArcGISRest;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLTileDebug from 'ol/source/TileDebug.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const TileDebug = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLTileDebug, ref, ...props});
22
+ });
23
+
24
+ export default TileDebug;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLTileImage from 'ol/source/TileImage.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const TileImage = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLTileImage, ref, ...props});
22
+ });
23
+
24
+ export default TileImage;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLTileJSON from 'ol/source/TileJSON.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const TileJSON = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLTileJSON, ref, ...props});
22
+ });
23
+
24
+ export default TileJSON;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLTileWMS from 'ol/source/TileWMS.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const TileWMS = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLTileWMS, ref, ...props});
22
+ });
23
+
24
+ export default TileWMS;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLUTFGrid from 'ol/source/UTFGrid.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const UTFGrid = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLUTFGrid, ref, ...props});
22
+ });
23
+
24
+ export default UTFGrid;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLUrlTile from 'ol/source/UrlTile.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const UrlTile = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLUrlTile, ref, ...props});
22
+ });
23
+
24
+ export default UrlTile;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLVector from 'ol/source/Vector.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const Vector = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLVector, ref, ...props});
22
+ });
23
+
24
+ export default Vector;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLVectorTile from 'ol/source/VectorTile.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const VectorTile = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLVectorTile, ref, ...props});
22
+ });
23
+
24
+ export default VectorTile;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLWMTS from 'ol/source/WMTS.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const WMTS = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLWMTS, ref, ...props});
22
+ });
23
+
24
+ export default WMTS;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLXYZ from 'ol/source/XYZ.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const XYZ = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLXYZ, ref, ...props});
22
+ });
23
+
24
+ export default XYZ;
@@ -0,0 +1,24 @@
1
+ // This file is generated by tools/generate.js. DO NOT EDIT.
2
+ /**
3
+ * Copyright 2022 Planet Labs PBC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import OLZoomify from 'ol/source/Zoomify.js';
18
+ import {createElement, forwardRef} from 'react';
19
+
20
+ const Zoomify = forwardRef((props, ref) => {
21
+ return createElement('source', {cls: OLZoomify, ref, ...props});
22
+ });
23
+
24
+ export default Zoomify;
package/package.json CHANGED
@@ -1,26 +1,61 @@
1
1
  {
2
2
  "name": "@planet/maps",
3
- "version": "7.1.1-alpha-heat",
4
- "description": "Custom builds of OpenLayers 3",
5
- "homepage": "https://github.com/planetlabs/maps",
6
- "repository": {
7
- "type": "git",
8
- "url": "git://github.com/planetlabs/maps.git"
9
- },
10
- "bugs": {
11
- "url": "https://github.com/planetlabs/maps/issues"
12
- },
13
- "main": "common.js",
3
+ "version": "8.0.0-dev.1666714337006",
4
+ "description": "Declarative mapping components for React",
5
+ "type": "module",
14
6
  "scripts": {
15
- "prepublish": "in-publish && make || not-in-publish"
7
+ "pretest": "npm run lint",
8
+ "test": "npm run test:rendering",
9
+ "test:unit": "vitest run -r ./tests/unit",
10
+ "lint": "eslint .",
11
+ "test:rendering": "playwright test --config=tests/rendering/playwright.config.js",
12
+ "start": "vite serve",
13
+ "start:rendering": "vite serve --config=tests/rendering/vite.config.js",
14
+ "build": "vite build",
15
+ "generate": "node tools/generate.js && npm run lint -- --fix",
16
+ "clean": "node tools/clean.js"
16
17
  },
17
18
  "license": "Apache-2.0",
18
- "keywords": [
19
- "openlayers",
20
- "ol3"
19
+ "files": [
20
+ "config.js",
21
+ "lib",
22
+ "renderer"
21
23
  ],
24
+ "dependencies": {
25
+ "react-reconciler": "^0.29.0"
26
+ },
22
27
  "devDependencies": {
23
- "in-publish": "2.0.0",
24
- "openlayers": "3.20.0"
28
+ "@octokit/rest": "^19.0.5",
29
+ "@playwright/test": "^1.25.2",
30
+ "c8": "^7.12.0",
31
+ "es-main": "^1.2.0",
32
+ "eslint": "^8.23.1",
33
+ "eslint-config-planet": "^20.0.3",
34
+ "fs-extra": "^10.1.0",
35
+ "import-meta-resolve": "^2.0.2",
36
+ "jsdom": "^20.0.0",
37
+ "minimist": "^1.2.6",
38
+ "mustache": "^4.2.0",
39
+ "ol": "^7.1.0",
40
+ "prop-types": "^15.8.1",
41
+ "react-dom": "^18.1.0",
42
+ "semapro": "^1.1.0",
43
+ "semver": "^7.3.7",
44
+ "vite": "^3.1.0",
45
+ "vitest": "^0.24.0"
46
+ },
47
+ "eslintConfig": {
48
+ "extends": "planet/react",
49
+ "overrides": [
50
+ {
51
+ "files": [
52
+ "*.jsx",
53
+ "*.js"
54
+ ]
55
+ }
56
+ ],
57
+ "parserOptions": {
58
+ "ecmaVersion": "latest"
59
+ }
25
60
  }
26
61
  }
package/readme.md CHANGED
@@ -1,60 +1,79 @@
1
- # Planet Maps
1
+ # @planet/maps
2
2
 
3
- Custom builds of OpenLayers 3.
3
+ Declarative mapping components
4
4
 
5
5
  ## Use
6
6
 
7
- Install `planet-maps` as a dependency with [`npm`](http://nodejs.org/).
8
-
9
- npm install planet-maps --save-dev
7
+ ```
8
+ npm install @planet/maps
9
+ ```
10
10
 
11
- Use [Browserify](http://browserify.org/) to `require` OpenLayers 3.
11
+ Import the components you need for your map. Provide an `options` prop to pass to the underlying OpenLayers constructor. Provide other props for values that you want to update with state changes.
12
12
 
13
13
  ```js
14
- // see below for a list of custom builds
15
- var ol = require('@planet/maps/common');
14
+ import Map from '@planet/maps/lib/Map';
15
+ import OSM from '@planet/maps/source/OSM';
16
+ import ScaleLine from '@planet/maps/control/ScaleLine';
17
+ import View from '@planet/maps/lib/View';
18
+ import WebGLTile from '@planet/maps/layer/WebGLTile';
19
+
20
+ function MyApp() {
21
+ return (
22
+ <Map style={{width: '100%', height: '100%'}}>
23
+ <View options={{center: [0, 0], zoom: 1}} />
24
+ <WebGLTile>
25
+ <OSM />
26
+ </WebGLTile>
27
+ <ScaleLine />
28
+ </Map>
29
+ );
30
+ }
16
31
  ```
17
32
 
18
- You'll also want to import the stylesheet:
33
+ You can also listen to any events on the map, view, controls, interactions, layers, or sources; use `ref`s to get access to the underlying OpenLayers instances; and more.
19
34
 
20
- ```css
21
- /* Make sure to use the path to your node_modules */
22
- @import url('./node_modules/planet-maps/ol.css');
23
- ```
35
+ ## Background
24
36
 
25
- ## Builds
37
+ React lets you build interactive UIs with (mostly) declarative syntax. OpenLayers provides an imperative API for building mapping apps. It can be awkward to map React's component API to an imperative API. However, the React team provides a package for creating custom renderers: [`react-reconciler`](https://www.npmjs.com/package/react-reconciler). This is how they integrate with imperative APIs themselves. The `react-dom` package uses `react-reconciler` to provide a mapping to the imperative DOM API. `react-native` uses `react-reconciler` to map to imperative native APIs.
26
38
 
27
- ### `common`
39
+ This library provides declarative mapping components representing imperative APIs from OpenLayers.
28
40
 
29
- ```js
30
- var ol = require('@planet/maps/common');
31
- ```
41
+ ## Design Goals
32
42
 
33
- Support for everything required by Scenes, Mosaics, Labs, etc. See `config/common.json` for details on what is included.
43
+ The purpose of this project is to provide a mapping between React's declarative components and OpenLayers' imperative API. In other words, this project provides a React renderer for OpenLayers.
34
44
 
35
- ### `explorer`
45
+ Here are some of the goals of this project:
36
46
 
37
- ```js
38
- var ol = require('@planet/maps/explorer');
39
- ```
47
+ * Ideally, the renderer would not have any additional dependencies beyond what is bundled with an OpenLayers map.
48
+ * Components exported by this package map 1:1 with classes exported by OpenLayers.
49
+ * Component props map directly to properties that are settable on instances of OpenLayers classes. Exceptions to this are props like `options` (passed to the constructor only), listener props (e.g. `onChange`), and `ref`.
50
+ * Components accept a `ref` that provide access to the underlying OpenLayers instance.
51
+ * The renderer should add negligible overhead in terms of bundle size, memory consumption, or processing.
52
+ * Code components can be generated by using OpenLayers sources. Exceptions to this are the map component (responsible for invoking the custom renderer) and components that map to classes without subclasses (e.g. the view).
53
+
54
+ ## Non-Goals
40
55
 
41
- Support for everything required by Planet Explorer. See `config/explorer.json` for details on what is included.
56
+ This project does not intend to provide any of the following:
42
57
 
43
- ### `debug`
58
+ * Higher level abstractions or components that combine logic from multiple OpenLayers instances (e.g. an editable layer component that wraps a layer, source, and editing interactions).
59
+ * Styled widgets (e.g. a layer switcher/browser).
60
+ * Other utilities for working with vector data, projections, etc.
44
61
 
45
- This is a debug build that should never be used in production.
62
+ We hope that this package can provide the foundation for other, higher-level libraries with more opinions about the look and feel of mapping components.
46
63
 
47
- ## Publishing a new release
64
+ ## Development
48
65
 
49
- Edit the `config` files to include what you need exported and commit the changes. Then you'll want to bump the version number in `package.json`, commit this change, and create a tag. This should be done with the `npm version` command (choose one of `patch`, `minor`, or `major`). E.g.
66
+ The development setup depends on [Node 18](https://nodejs.org/) (most things work on 16, but not all).
50
67
 
51
- npm version minor
68
+ Install project dependencies:
69
+
70
+ ```bash
71
+ npm install
72
+ ```
52
73
 
53
- Next you'll want to push your commits (and the tag) and publish your changes to npmjs.org.
74
+ The rendering tests use Playwright for visual snapshot comparison. See the [`tests/rendering/readme.md`](tests/rendering/readme.md) for more detail.
54
75
 
55
- git push --tags origin master
56
- npm publish
57
76
 
58
- Before publishing, the `prepublish` step will run `make`. This will create builds that are *not* tracked by `git` but that are pushed to the npmjs.org repository for use by consuming packages.
77
+ ## Prior Art
59
78
 
60
- Note the new version number in `package.json` and use it in packages that depend on this one.
79
+ Other projects like [`react-openlayers-fiber`](https://github.com/crubier/react-openlayers-fiber) and [`react-ol-fiber`](https://www.npmjs.com/package/react-ol-fiber) use a similar approach and provided inspiration for this project. The major difference between this project and those is that this project provides importable components for OpenLayers layers, sources, controls, and interactions. The other projects bundle all of OpenLayers in their renderer. So a simple "hello world" map with one of the existing projects is about 1.5 MB while the same with this project is about 460 KB.