@planet/maps 7.1.0 → 8.0.0-dev.1666713300824
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.
- package/LICENSE +202 -0
- package/config.js +32 -0
- package/lib/Map.js +70 -0
- package/lib/Overlay.js +24 -0
- package/lib/View.js +24 -0
- package/lib/control/Attribution.js +24 -0
- package/lib/control/Control.js +24 -0
- package/lib/control/FullScreen.js +24 -0
- package/lib/control/MousePosition.js +24 -0
- package/lib/control/OverviewMap.js +24 -0
- package/lib/control/Rotate.js +24 -0
- package/lib/control/ScaleLine.js +24 -0
- package/lib/control/Zoom.js +24 -0
- package/lib/control/ZoomSlider.js +24 -0
- package/lib/control/ZoomToExtent.js +24 -0
- package/lib/interaction/DoubleClickZoom.js +24 -0
- package/lib/interaction/DragAndDrop.js +24 -0
- package/lib/interaction/DragBox.js +24 -0
- package/lib/interaction/DragPan.js +24 -0
- package/lib/interaction/DragRotate.js +24 -0
- package/lib/interaction/DragRotateAndZoom.js +28 -0
- package/lib/interaction/DragZoom.js +24 -0
- package/lib/interaction/Draw.js +24 -0
- package/lib/interaction/Extent.js +24 -0
- package/lib/interaction/Interaction.js +24 -0
- package/lib/interaction/KeyboardPan.js +24 -0
- package/lib/interaction/KeyboardZoom.js +24 -0
- package/lib/interaction/Link.js +24 -0
- package/lib/interaction/Modify.js +24 -0
- package/lib/interaction/MouseWheelZoom.js +24 -0
- package/lib/interaction/PinchRotate.js +24 -0
- package/lib/interaction/PinchZoom.js +24 -0
- package/lib/interaction/Pointer.js +24 -0
- package/lib/interaction/Property.js +24 -0
- package/lib/interaction/Select.js +24 -0
- package/lib/interaction/Snap.js +24 -0
- package/lib/interaction/Translate.js +24 -0
- package/lib/layer/Base.js +29 -0
- package/lib/layer/BaseImage.js +29 -0
- package/lib/layer/BaseTile.js +29 -0
- package/lib/layer/BaseVector.js +29 -0
- package/lib/layer/Graticule.js +29 -0
- package/lib/layer/Group.js +29 -0
- package/lib/layer/Heatmap.js +29 -0
- package/lib/layer/Image.js +29 -0
- package/lib/layer/Layer.js +29 -0
- package/lib/layer/MapboxVector.js +29 -0
- package/lib/layer/Tile.js +29 -0
- package/lib/layer/Vector.js +29 -0
- package/lib/layer/VectorImage.js +29 -0
- package/lib/layer/VectorTile.js +29 -0
- package/lib/layer/WebGLPoints.js +29 -0
- package/lib/layer/WebGLTile.js +29 -0
- package/lib/source/BingMaps.js +24 -0
- package/lib/source/CartoDB.js +24 -0
- package/lib/source/Cluster.js +24 -0
- package/lib/source/DataTile.js +24 -0
- package/lib/source/GeoTIFF.js +24 -0
- package/lib/source/IIIF.js +24 -0
- package/lib/source/Image.js +24 -0
- package/lib/source/ImageArcGISRest.js +24 -0
- package/lib/source/ImageCanvas.js +24 -0
- package/lib/source/ImageMapGuide.js +24 -0
- package/lib/source/ImageStatic.js +24 -0
- package/lib/source/ImageWMS.js +24 -0
- package/lib/source/OGCMapTile.js +24 -0
- package/lib/source/OGCVectorTile.js +24 -0
- package/lib/source/OSM.js +24 -0
- package/lib/source/Raster.js +24 -0
- package/lib/source/Source.js +24 -0
- package/lib/source/Stamen.js +24 -0
- package/lib/source/Tile.js +24 -0
- package/lib/source/TileArcGISRest.js +24 -0
- package/lib/source/TileDebug.js +24 -0
- package/lib/source/TileImage.js +24 -0
- package/lib/source/TileJSON.js +24 -0
- package/lib/source/TileWMS.js +24 -0
- package/lib/source/UTFGrid.js +24 -0
- package/lib/source/UrlTile.js +24 -0
- package/lib/source/Vector.js +24 -0
- package/lib/source/VectorTile.js +24 -0
- package/lib/source/WMTS.js +24 -0
- package/lib/source/XYZ.js +24 -0
- package/lib/source/Zoomify.js +24 -0
- package/package.json +52 -17
- package/readme.md +44 -35
- package/renderer/render.js +304 -0
- package/renderer/update.js +98 -0
- package/.npmignore +0 -2
- package/common.js +0 -505
- package/debug.js +0 -88354
- package/embed.js +0 -293
- package/explorer.js +0 -464
- 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": "
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
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.1666713300824",
|
|
4
|
+
"description": "Declarative mapping components for React",
|
|
5
|
+
"type": "module",
|
|
14
6
|
"scripts": {
|
|
15
|
-
"
|
|
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
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"files": [
|
|
20
|
+
"config.js",
|
|
21
|
+
"lib",
|
|
22
|
+
"renderer"
|
|
21
23
|
],
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"react-reconciler": "^0.29.0"
|
|
26
|
+
},
|
|
22
27
|
"devDependencies": {
|
|
23
|
-
"
|
|
24
|
-
"
|
|
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,69 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @planet/maps
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Declarative mapping components
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Background
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
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.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This library provides declarative mapping components representing imperative APIs from OpenLayers.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
Here is an example of what a map looks like with components from this package:
|
|
12
14
|
|
|
13
15
|
```js
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
function MyApp() {
|
|
17
|
+
return (
|
|
18
|
+
<Map style={{width: '100%', height: '100%'}}>
|
|
19
|
+
<View options={{center: [0, 0], zoom: 1}} />
|
|
20
|
+
<WebGLTile>
|
|
21
|
+
<OSM />
|
|
22
|
+
</WebGLTile>
|
|
23
|
+
<ScaleLine />
|
|
24
|
+
</Map>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
16
27
|
```
|
|
17
28
|
|
|
18
|
-
You
|
|
19
|
-
|
|
20
|
-
```css
|
|
21
|
-
/* Make sure to use the path to your node_modules */
|
|
22
|
-
@import url('./node_modules/planet-maps/ol.css');
|
|
23
|
-
```
|
|
29
|
+
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.
|
|
24
30
|
|
|
25
|
-
##
|
|
31
|
+
## Design Goals
|
|
26
32
|
|
|
27
|
-
|
|
33
|
+
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.
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
var ol = require('@planet/maps/common');
|
|
31
|
-
```
|
|
35
|
+
Here are some of the goals of this project:
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
* Ideally, the renderer would not have any additional dependencies beyond what is bundled with an OpenLayers map.
|
|
38
|
+
* Components exported by this package map 1:1 with classes exported by OpenLayers.
|
|
39
|
+
* 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`.
|
|
40
|
+
* Components accept a `ref` that provide access to the underlying OpenLayers instance.
|
|
41
|
+
* The renderer should add negligible overhead in terms of bundle size, memory consumption, or processing.
|
|
42
|
+
* 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).
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
## Non-Goals
|
|
36
45
|
|
|
37
|
-
|
|
38
|
-
var ol = require('@planet/maps/explorer');
|
|
39
|
-
```
|
|
46
|
+
This project does not intend to provide any of the following:
|
|
40
47
|
|
|
41
|
-
|
|
48
|
+
* 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).
|
|
49
|
+
* Styled widgets (e.g. a layer switcher/browser).
|
|
50
|
+
* Other utilities for working with vector data, projections, etc.
|
|
42
51
|
|
|
43
|
-
|
|
52
|
+
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.
|
|
44
53
|
|
|
45
|
-
|
|
54
|
+
## Development
|
|
46
55
|
|
|
47
|
-
|
|
56
|
+
The development setup depends on [Node 18](https://nodejs.org/) (most things work on 16, but not all).
|
|
48
57
|
|
|
49
|
-
|
|
58
|
+
Install project dependencies:
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
```bash
|
|
61
|
+
npm install
|
|
62
|
+
```
|
|
52
63
|
|
|
53
|
-
|
|
64
|
+
The rendering tests use Playwright for visual snapshot comparison. See the [`tests/rendering/readme.md`](tests/rendering/readme.md) for more detail.
|
|
54
65
|
|
|
55
|
-
git push --tags origin master
|
|
56
|
-
npm publish
|
|
57
66
|
|
|
58
|
-
|
|
67
|
+
## Prior Art
|
|
59
68
|
|
|
60
|
-
|
|
69
|
+
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.
|