react-spatial 1.5.3 → 1.5.4
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/components/BaseLayerSwitcher/BaseLayerSwitcher.js +231 -0
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +7 -0
- package/components/BaseLayerSwitcher/index.js +1 -0
- package/components/BaseLayerSwitcher/index.js.map +7 -0
- package/components/BasicMap/BasicMap.js +278 -0
- package/components/BasicMap/BasicMap.js.map +7 -0
- package/components/BasicMap/index.js +1 -0
- package/components/BasicMap/index.js.map +7 -0
- package/{src/components → components}/CanvasSaveButton/CanvasSaveButton.js +93 -320
- package/components/CanvasSaveButton/CanvasSaveButton.js.map +7 -0
- package/components/CanvasSaveButton/index.js +1 -0
- package/components/CanvasSaveButton/index.js.map +7 -0
- package/components/Copyright/Copyright.js +55 -0
- package/components/Copyright/Copyright.js.map +7 -0
- package/components/Copyright/index.js +1 -0
- package/components/Copyright/index.js.map +7 -0
- package/components/FeatureExportButton/FeatureExportButton.js +62 -0
- package/components/FeatureExportButton/FeatureExportButton.js.map +7 -0
- package/components/FeatureExportButton/index.js +1 -0
- package/components/FeatureExportButton/index.js.map +7 -0
- package/components/FitExtent/FitExtent.js +32 -0
- package/components/FitExtent/FitExtent.js.map +7 -0
- package/components/FitExtent/index.js +1 -0
- package/components/FitExtent/index.js.map +7 -0
- package/{src/components → components}/Geolocation/Geolocation.js +61 -144
- package/components/Geolocation/Geolocation.js.map +7 -0
- package/components/Geolocation/index.js +1 -0
- package/components/Geolocation/index.js.map +7 -0
- package/components/LayerTree/LayerTree.js +278 -0
- package/components/LayerTree/LayerTree.js.map +7 -0
- package/components/LayerTree/index.js +1 -0
- package/components/LayerTree/index.js.map +7 -0
- package/components/MousePosition/MousePosition.js +110 -0
- package/components/MousePosition/MousePosition.js.map +7 -0
- package/components/MousePosition/index.js +1 -0
- package/components/MousePosition/index.js.map +7 -0
- package/components/NorthArrow/NorthArrow.js +43 -0
- package/components/NorthArrow/NorthArrow.js.map +7 -0
- package/components/NorthArrow/index.js +1 -0
- package/components/NorthArrow/index.js.map +7 -0
- package/components/Overlay/Overlay.js +122 -0
- package/components/Overlay/Overlay.js.map +7 -0
- package/components/Overlay/index.js +1 -0
- package/components/Overlay/index.js.map +7 -0
- package/components/Permalink/Permalink.js +206 -0
- package/components/Permalink/Permalink.js.map +7 -0
- package/components/Permalink/index.js +1 -0
- package/components/Permalink/index.js.map +7 -0
- package/{src/components → components}/Popup/Popup.js +55 -165
- package/components/Popup/Popup.js.map +7 -0
- package/components/Popup/index.js +1 -0
- package/components/Popup/index.js.map +7 -0
- package/{src/components → components}/ResizeHandler/ResizeHandler.js +15 -50
- package/components/ResizeHandler/ResizeHandler.js.map +7 -0
- package/components/ResizeHandler/index.js +1 -0
- package/components/ResizeHandler/index.js.map +7 -0
- package/components/RouteSchedule/RouteSchedule.js +223 -0
- package/components/RouteSchedule/RouteSchedule.js.map +7 -0
- package/components/RouteSchedule/index.js +1 -0
- package/components/RouteSchedule/index.js.map +7 -0
- package/components/ScaleLine/ScaleLine.js +32 -0
- package/components/ScaleLine/ScaleLine.js.map +7 -0
- package/components/ScaleLine/index.js +1 -0
- package/components/ScaleLine/index.js.map +7 -0
- package/components/StopsFinder/StopsFinder.js +210 -0
- package/components/StopsFinder/StopsFinder.js.map +7 -0
- package/components/StopsFinder/StopsFinderOption.js +51 -0
- package/components/StopsFinder/StopsFinderOption.js.map +7 -0
- package/components/StopsFinder/index.js +1 -0
- package/components/StopsFinder/index.js.map +7 -0
- package/components/Zoom/Zoom.js +130 -0
- package/components/Zoom/Zoom.js.map +7 -0
- package/components/Zoom/index.js +1 -0
- package/components/Zoom/index.js.map +7 -0
- package/package.json +1 -1
- package/{src/propTypes.js → propTypes.js} +12 -16
- package/propTypes.js.map +7 -0
- package/{src/setupTests.js → setupTests.js} +1 -1
- package/setupTests.js.map +7 -0
- package/utils/GlobalsForOle.js +94 -0
- package/utils/GlobalsForOle.js.map +7 -0
- package/utils/KML.js +412 -0
- package/utils/KML.js.map +7 -0
- package/utils/KMLFormat.js +69 -0
- package/utils/KMLFormat.js.map +7 -0
- package/{src/utils → utils}/Styles.js +14 -20
- package/utils/Styles.js.map +7 -0
- package/{src/utils → utils}/getPolygonPattern.js +6 -34
- package/utils/getPolygonPattern.js.map +7 -0
- package/{src/utils → utils}/timeUtils.js +5 -22
- package/utils/timeUtils.js.map +7 -0
- package/.github/workflows/conventional-pr-title.yml +0 -21
- package/.github/workflows/main.yml +0 -28
- package/.husky/commit-msg +0 -4
- package/.husky/post-checkout +0 -4
- package/.husky/post-merge +0 -4
- package/.husky/post-rebase +0 -4
- package/.husky/pre-commit +0 -4
- package/.nvmrc +0 -1
- package/.whitesource +0 -8
- package/CHANGELOG.md +0 -65
- package/DEVELOP.md +0 -113
- package/__mocks__/mapbox-gl.js +0 -11
- package/__mocks__/resize-observer-polyfill.js +0 -9
- package/babel.config.js +0 -3
- package/commitlint.config.js +0 -1
- package/data/topic1.js +0 -119
- package/data/topic2.js +0 -28
- package/doc/README.md +0 -21
- package/doc/doc-config.json +0 -4
- package/pull_request_template.md +0 -16
- package/renovate.json +0 -4
- package/scripts/read-pkg-json.js +0 -17
- package/src/components/BaseLayerSwitcher/BaseLayerSwitcher.js +0 -322
- package/src/components/BaseLayerSwitcher/BaseLayerSwitcher.test.js +0 -69
- package/src/components/BaseLayerSwitcher/README.md +0 -61
- package/src/components/BaseLayerSwitcher/__snapshots__/BaseLayerSwitcher.test.js.snap +0 -88
- package/src/components/BaseLayerSwitcher/index.js +0 -1
- package/src/components/BasicMap/BasicMap.js +0 -413
- package/src/components/BasicMap/BasicMap.test.js +0 -281
- package/src/components/BasicMap/README.md +0 -18
- package/src/components/BasicMap/index.js +0 -1
- package/src/components/CanvasSaveButton/CanvasSaveButton.test.js +0 -148
- package/src/components/CanvasSaveButton/README.md +0 -76
- package/src/components/CanvasSaveButton/__snapshots__/CanvasSaveButton.test.js.snap +0 -76
- package/src/components/CanvasSaveButton/index.js +0 -1
- package/src/components/Copyright/Copyright.js +0 -89
- package/src/components/Copyright/Copyright.test.js +0 -134
- package/src/components/Copyright/README.md +0 -36
- package/src/components/Copyright/index.js +0 -1
- package/src/components/FeatureExportButton/FeatureExportButton.js +0 -118
- package/src/components/FeatureExportButton/FeatureExportButton.test.js +0 -417
- package/src/components/FeatureExportButton/README.md +0 -76
- package/src/components/FeatureExportButton/__snapshots__/FeatureExportButton.test.js.snap +0 -67
- package/src/components/FeatureExportButton/index.js +0 -1
- package/src/components/FitExtent/FitExtent.js +0 -62
- package/src/components/FitExtent/FitExtent.test.js +0 -48
- package/src/components/FitExtent/README.md +0 -34
- package/src/components/FitExtent/__snapshots__/FitExtent.test.js.snap +0 -13
- package/src/components/FitExtent/index.js +0 -1
- package/src/components/Geolocation/Geolocation.test.js +0 -267
- package/src/components/Geolocation/README.md +0 -25
- package/src/components/Geolocation/__snapshots__/Geolocation.test.js.snap +0 -92
- package/src/components/Geolocation/index.js +0 -1
- package/src/components/LayerTree/LayerTree.js +0 -487
- package/src/components/LayerTree/LayerTree.test.js +0 -337
- package/src/components/LayerTree/README.md +0 -92
- package/src/components/LayerTree/__snapshots__/LayerTree.test.js.snap +0 -1746
- package/src/components/LayerTree/index.js +0 -1
- package/src/components/MousePosition/MousePosition.js +0 -175
- package/src/components/MousePosition/MousePosition.test.js +0 -132
- package/src/components/MousePosition/README.md +0 -50
- package/src/components/MousePosition/__snapshots__/MousePosition.test.js.snap +0 -76
- package/src/components/MousePosition/index.js +0 -1
- package/src/components/NorthArrow/NorthArrow.js +0 -75
- package/src/components/NorthArrow/NorthArrow.test.js +0 -104
- package/src/components/NorthArrow/README.md +0 -59
- package/src/components/NorthArrow/__snapshots__/NorthArrow.test.js.snap +0 -117
- package/src/components/NorthArrow/index.js +0 -1
- package/src/components/Overlay/Overlay.js +0 -176
- package/src/components/Overlay/Overlay.test.js +0 -149
- package/src/components/Overlay/README.md +0 -59
- package/src/components/Overlay/__snapshots__/Overlay.test.js.snap +0 -9
- package/src/components/Overlay/index.js +0 -1
- package/src/components/Permalink/Permalink.js +0 -326
- package/src/components/Permalink/Permalink.test.js +0 -285
- package/src/components/Permalink/README.md +0 -105
- package/src/components/Permalink/index.js +0 -1
- package/src/components/Popup/Popup.test.js +0 -307
- package/src/components/Popup/README.md +0 -93
- package/src/components/Popup/__snapshots__/Popup.test.js.snap +0 -180
- package/src/components/Popup/index.js +0 -1
- package/src/components/README.md +0 -41
- package/src/components/ResizeHandler/ResizeHandler.test.js +0 -344
- package/src/components/ResizeHandler/index.js +0 -1
- package/src/components/RouteSchedule/README.md +0 -118
- package/src/components/RouteSchedule/RouteSchedule.js +0 -370
- package/src/components/RouteSchedule/RouteSchedule.test.js +0 -113
- package/src/components/RouteSchedule/__snapshots__/RouteSchedule.test.js.snap +0 -248
- package/src/components/RouteSchedule/index.js +0 -1
- package/src/components/ScaleLine/README.md +0 -29
- package/src/components/ScaleLine/ScaleLine.js +0 -50
- package/src/components/ScaleLine/ScaleLine.test.js +0 -30
- package/src/components/ScaleLine/__snapshots__/ScaleLine.test.js.snap +0 -7
- package/src/components/ScaleLine/index.js +0 -1
- package/src/components/StopsFinder/README.md +0 -50
- package/src/components/StopsFinder/StopsFinder.js +0 -284
- package/src/components/StopsFinder/StopsFinder.test.js +0 -17
- package/src/components/StopsFinder/StopsFinderOption.js +0 -61
- package/src/components/StopsFinder/__snapshots__/StopsFinder.test.js.snap +0 -133
- package/src/components/StopsFinder/index.js +0 -1
- package/src/components/Zoom/README.md +0 -25
- package/src/components/Zoom/Zoom.js +0 -180
- package/src/components/Zoom/Zoom.test.js +0 -141
- package/src/components/Zoom/__snapshots__/Zoom.test.js.snap +0 -201
- package/src/components/Zoom/index.js +0 -1
- package/src/styleguidist/ComponentsList.js +0 -52
- package/src/styleguidist/StyleGuide.js +0 -277
- package/src/styleguidist/styleguidist.css +0 -38
- package/src/utils/GlobalsForOle.js +0 -99
- package/src/utils/KML.js +0 -594
- package/src/utils/KML.test.js +0 -337
- package/src/utils/KMLFormat.js +0 -100
- package/src/utils/KMLFormat.test.js +0 -50
- package/src/utils/__snapshots__/KML.test.js.snap.KML-readFeatures()-and-writeFeatures()-should-read-and-write-lineDash-and-fillPattern-style-for-polygon.canvas-image.png +0 -0
- package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-2-(cross)-color-and-(light-blue)-opacity.canvas-image.png +0 -0
- package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-3-(diagonal-line-from-bottom-left-tot-top-right)-with-color-(light-blue)-and-opacity.canvas-image.png +0 -0
- package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-4-(diagonal-line-from-top-left-to-bottom-right)-with-color-(light-blue)-and-opacity.canvas-image.png +0 -0
- package/src/utils/getPolygonPattern.test.js +0 -61
- package/src/utils/timeUtils.test.js +0 -30
- package/styleguide.config.js +0 -251
- /package/{src/components → components}/BaseLayerSwitcher/BaseLayerSwitcher.md.scss +0 -0
- /package/{src/components → components}/BaseLayerSwitcher/BaseLayerSwitcher.scss +0 -0
- /package/{src/components → components}/BasicMap/BasicMap.md.scss +0 -0
- /package/{src/components → components}/CanvasSaveButton/CanvasSaveButton.md.scss +0 -0
- /package/{src/components → components}/Copyright/Copyright.md.scss +0 -0
- /package/{src/components → components}/FeatureExportButton/FeatureExportButton.md.scss +0 -0
- /package/{src/components → components}/FitExtent/FitExtent.md.scss +0 -0
- /package/{src/components → components}/Geolocation/Geolocation.md.scss +0 -0
- /package/{src/components → components}/Geolocation/Geolocation.scss +0 -0
- /package/{src/components → components}/LayerTree/LayerTree.md.scss +0 -0
- /package/{src/components → components}/LayerTree/LayerTree.scss +0 -0
- /package/{src/components → components}/MousePosition/MousePosition.md.scss +0 -0
- /package/{src/components → components}/NorthArrow/NorthArrow.scss +0 -0
- /package/{src/components → components}/Overlay/Overlay.md.scss +0 -0
- /package/{src/components → components}/Overlay/Overlay.scss +0 -0
- /package/{src/components → components}/Permalink/Permalink.md.scss +0 -0
- /package/{src/components → components}/Popup/Popup.md.scss +0 -0
- /package/{src/components → components}/Popup/Popup.scss +0 -0
- /package/{src/components → components}/RouteSchedule/RouteSchedule.md.scss +0 -0
- /package/{src/components → components}/RouteSchedule/RouteSchedule.scss +0 -0
- /package/{src/components → components}/ScaleLine/ScaleLine.scss +0 -0
- /package/{src/components → components}/Zoom/Zoom.md.scss +0 -0
- /package/{src/components → components}/Zoom/Zoom.scss +0 -0
- /package/{src/images → images}/RouteSchedule/firstStation.png +0 -0
- /package/{src/images → images}/RouteSchedule/lastStation.png +0 -0
- /package/{src/images → images}/RouteSchedule/line.png +0 -0
- /package/{src/images → images}/RouteSchedule/station.png +0 -0
- /package/{src/images → images}/baselayer/baselayer.basebright.png +0 -0
- /package/{src/images → images}/baselayer/baselayer.osm.png +0 -0
- /package/{src/images → images}/baselayer/baselayer.travic.png +0 -0
- /package/{src/images → images}/baselayer/open.topo.map.png +0 -0
- /package/{src/images → images}/baselayer/osm.baselayer.hot.png +0 -0
- /package/{src/images → images}/baselayer/osm.baselayer.png +0 -0
- /package/{src/images → images}/favicon.png +0 -0
- /package/{src/images → images}/geops_logo.png +0 -0
- /package/{src/images → images}/geops_logo.svg +0 -0
- /package/{src/images → images}/geops_qr.png +0 -0
- /package/{src/images → images}/mots/bus_poi-blue-01.svg +0 -0
- /package/{src/images → images}/mots/bus_poi-grey-01.svg +0 -0
- /package/{src/images → images}/mots/bus_round-blue-01.svg +0 -0
- /package/{src/images → images}/mots/bus_round-grey-01.svg +0 -0
- /package/{src/images → images}/mots/bus_square-blue-01.svg +0 -0
- /package/{src/images → images}/mots/bus_square-grey-01.svg +0 -0
- /package/{src/images → images}/mots/cable_car_poi-blue-01.svg +0 -0
- /package/{src/images → images}/mots/cable_car_poi-grey-01.svg +0 -0
- /package/{src/images → images}/mots/cable_car_round-blue-01.svg +0 -0
- /package/{src/images → images}/mots/cable_car_round-grey-01.svg +0 -0
- /package/{src/images → images}/mots/cable_car_square-blue-01.svg +0 -0
- /package/{src/images → images}/mots/cable_car_square-grey-01.svg +0 -0
- /package/{src/images → images}/mots/ferry_poi-blue-01.svg +0 -0
- /package/{src/images → images}/mots/ferry_poi-grey-01.svg +0 -0
- /package/{src/images → images}/mots/ferry_round-blue-01.svg +0 -0
- /package/{src/images → images}/mots/ferry_round-grey-01.svg +0 -0
- /package/{src/images → images}/mots/ferry_square-blue-01.svg +0 -0
- /package/{src/images → images}/mots/ferry_square-grey-01.svg +0 -0
- /package/{src/images → images}/mots/funicular_round-blue-01.svg +0 -0
- /package/{src/images → images}/mots/funicular_round-grey-01.svg +0 -0
- /package/{src/images → images}/mots/funicular_square-blue-01.svg +0 -0
- /package/{src/images → images}/mots/gondola_round-blue-01.svg +0 -0
- /package/{src/images → images}/mots/rail_poi-blue-01.svg +0 -0
- /package/{src/images → images}/mots/rail_poi-grey-01.svg +0 -0
- /package/{src/images → images}/mots/rail_round-blue-01.svg +0 -0
- /package/{src/images → images}/mots/rail_round-grey-01.svg +0 -0
- /package/{src/images → images}/mots/rail_square-blue-01.svg +0 -0
- /package/{src/images → images}/mots/rail_square-grey-01.svg +0 -0
- /package/{src/images → images}/mots/subway_round blue-01.svg +0 -0
- /package/{src/images → images}/mots/subway_round-blue-01.svg +0 -0
- /package/{src/images → images}/mots/tram_poi-blue-01.svg +0 -0
- /package/{src/images → images}/mots/tram_poi-grey-01.svg +0 -0
- /package/{src/images → images}/mots/tram_round-blue-01.svg +0 -0
- /package/{src/images → images}/mots/tram_round-grey-01.svg +0 -0
- /package/{src/images → images}/mots/tram_square-blue-01.svg +0 -0
- /package/{src/images → images}/mots/tram_square-grey-01.svg +0 -0
- /package/{src/images → images}/northArrow.svg +0 -0
- /package/{src/images → images}/northArrow.url.svg +0 -0
- /package/{src/images → images}/northArrowCircle.svg +0 -0
- /package/{src/images → images}/northArrowCircle.url.svg +0 -0
- /package/{src/themes → themes}/README.md +0 -0
- /package/{src/themes → themes}/default/components.scss +0 -0
- /package/{src/themes → themes}/default/examples.scss +0 -0
- /package/{src/themes → themes}/default/index.scss +0 -0
- /package/{src/themes → themes}/default/mixins.scss +0 -0
- /package/{src/themes → themes}/default/variables.scss +0 -0
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import { DEVICE_PIXEL_RATIO } from
|
|
2
|
-
|
|
1
|
+
import { DEVICE_PIXEL_RATIO } from "ol/has";
|
|
3
2
|
const getPolygonPattern = (patternId = 1, color = [235, 0, 0, 1]) => {
|
|
4
3
|
if (patternId === 1) {
|
|
5
4
|
return color;
|
|
6
5
|
}
|
|
7
|
-
|
|
8
|
-
const canvasElement = document.createElement('canvas');
|
|
6
|
+
const canvasElement = document.createElement("canvas");
|
|
9
7
|
const pixelRatio = DEVICE_PIXEL_RATIO;
|
|
10
|
-
|
|
11
8
|
canvasElement.width = 20 * pixelRatio;
|
|
12
9
|
canvasElement.height = 20 * pixelRatio;
|
|
13
|
-
|
|
14
10
|
let pattern = {};
|
|
15
|
-
const ctx = canvasElement.getContext(
|
|
11
|
+
const ctx = canvasElement.getContext("2d");
|
|
16
12
|
ctx.strokeStyle = `rgba(${color.toString()})`;
|
|
17
13
|
ctx.fillStyle = `rgba(${color.toString()})`;
|
|
18
14
|
ctx.lineWidth = 3;
|
|
19
|
-
|
|
20
15
|
switch (patternId) {
|
|
21
16
|
case 2:
|
|
22
|
-
/* Hatched pattern */
|
|
23
|
-
/* Ascending line */
|
|
24
17
|
ctx.beginPath();
|
|
25
18
|
ctx.moveTo(0, canvasElement.height);
|
|
26
19
|
ctx.lineTo(0, canvasElement.height - ctx.lineWidth / 2);
|
|
@@ -31,8 +24,6 @@ const getPolygonPattern = (patternId = 1, color = [235, 0, 0, 1]) => {
|
|
|
31
24
|
ctx.lineTo(ctx.lineWidth / 2, canvasElement.height);
|
|
32
25
|
ctx.fill();
|
|
33
26
|
ctx.closePath();
|
|
34
|
-
|
|
35
|
-
/* Descending line */
|
|
36
27
|
ctx.beginPath();
|
|
37
28
|
ctx.moveTo(0, 0);
|
|
38
29
|
ctx.lineTo(0, ctx.lineWidth / 2);
|
|
@@ -43,21 +34,16 @@ const getPolygonPattern = (patternId = 1, color = [235, 0, 0, 1]) => {
|
|
|
43
34
|
ctx.lineTo(0, 0);
|
|
44
35
|
ctx.fill();
|
|
45
36
|
ctx.closePath();
|
|
46
|
-
|
|
47
|
-
pattern = ctx.createPattern(canvasElement, 'repeat');
|
|
37
|
+
pattern = ctx.createPattern(canvasElement, "repeat");
|
|
48
38
|
pattern.canvas = canvasElement;
|
|
49
39
|
break;
|
|
50
40
|
case 3:
|
|
51
|
-
/* Shade ascending pattern */
|
|
52
|
-
/* Corner triangle */
|
|
53
41
|
ctx.beginPath();
|
|
54
42
|
ctx.moveTo(0, 0);
|
|
55
43
|
ctx.lineTo(0, ctx.lineWidth / 2);
|
|
56
44
|
ctx.lineTo(ctx.lineWidth / 2, 0);
|
|
57
45
|
ctx.fill();
|
|
58
46
|
ctx.closePath();
|
|
59
|
-
|
|
60
|
-
/* Ascending line */
|
|
61
47
|
ctx.beginPath();
|
|
62
48
|
ctx.moveTo(0, canvasElement.height);
|
|
63
49
|
ctx.lineTo(0, canvasElement.height - ctx.lineWidth / 2);
|
|
@@ -68,29 +54,22 @@ const getPolygonPattern = (patternId = 1, color = [235, 0, 0, 1]) => {
|
|
|
68
54
|
ctx.lineTo(ctx.lineWidth / 2, canvasElement.height);
|
|
69
55
|
ctx.fill();
|
|
70
56
|
ctx.closePath();
|
|
71
|
-
|
|
72
|
-
/* Corner triangle */
|
|
73
57
|
ctx.beginPath();
|
|
74
58
|
ctx.moveTo(canvasElement.width, canvasElement.height);
|
|
75
59
|
ctx.lineTo(canvasElement.width, canvasElement.height - ctx.lineWidth / 2);
|
|
76
60
|
ctx.lineTo(canvasElement.width - ctx.lineWidth / 2, canvasElement.height);
|
|
77
61
|
ctx.fill();
|
|
78
62
|
ctx.closePath();
|
|
79
|
-
|
|
80
|
-
pattern = ctx.createPattern(canvasElement, 'repeat');
|
|
63
|
+
pattern = ctx.createPattern(canvasElement, "repeat");
|
|
81
64
|
pattern.canvas = canvasElement;
|
|
82
65
|
break;
|
|
83
66
|
case 4:
|
|
84
|
-
/* Shade descending pattern */
|
|
85
|
-
/* Corner triangle */
|
|
86
67
|
ctx.beginPath();
|
|
87
68
|
ctx.moveTo(canvasElement.width, 0);
|
|
88
69
|
ctx.lineTo(canvasElement.width, ctx.lineWidth / 2);
|
|
89
70
|
ctx.lineTo(canvasElement.width - ctx.lineWidth / 2, 0);
|
|
90
71
|
ctx.fill();
|
|
91
72
|
ctx.closePath();
|
|
92
|
-
|
|
93
|
-
/* Descending line */
|
|
94
73
|
ctx.beginPath();
|
|
95
74
|
ctx.moveTo(0, 0);
|
|
96
75
|
ctx.lineTo(0, ctx.lineWidth / 2);
|
|
@@ -101,29 +80,22 @@ const getPolygonPattern = (patternId = 1, color = [235, 0, 0, 1]) => {
|
|
|
101
80
|
ctx.lineTo(0, 0);
|
|
102
81
|
ctx.fill();
|
|
103
82
|
ctx.closePath();
|
|
104
|
-
|
|
105
|
-
/* Corner triangle */
|
|
106
83
|
ctx.beginPath();
|
|
107
84
|
ctx.moveTo(0, canvasElement.height);
|
|
108
85
|
ctx.lineTo(0, canvasElement.height - ctx.lineWidth / 2);
|
|
109
86
|
ctx.lineTo(ctx.lineWidth / 2, canvasElement.height);
|
|
110
87
|
ctx.fill();
|
|
111
88
|
ctx.closePath();
|
|
112
|
-
|
|
113
|
-
pattern = ctx.createPattern(canvasElement, 'repeat');
|
|
89
|
+
pattern = ctx.createPattern(canvasElement, "repeat");
|
|
114
90
|
pattern.canvas = canvasElement;
|
|
115
91
|
break;
|
|
116
92
|
default:
|
|
117
93
|
}
|
|
118
|
-
|
|
119
94
|
if (patternId === 0) {
|
|
120
95
|
pattern.empty = true;
|
|
121
96
|
}
|
|
122
|
-
|
|
123
97
|
pattern.id = patternId;
|
|
124
98
|
pattern.color = color;
|
|
125
|
-
|
|
126
99
|
return pattern;
|
|
127
100
|
};
|
|
128
|
-
|
|
129
101
|
export default getPolygonPattern;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/getPolygonPattern.js"],
|
|
4
|
+
"sourcesContent": ["import { DEVICE_PIXEL_RATIO } from 'ol/has';\n\nconst getPolygonPattern = (patternId = 1, color = [235, 0, 0, 1]) => {\n if (patternId === 1) {\n return color;\n }\n\n const canvasElement = document.createElement('canvas');\n const pixelRatio = DEVICE_PIXEL_RATIO;\n\n canvasElement.width = 20 * pixelRatio;\n canvasElement.height = 20 * pixelRatio;\n\n let pattern = {};\n const ctx = canvasElement.getContext('2d');\n ctx.strokeStyle = `rgba(${color.toString()})`;\n ctx.fillStyle = `rgba(${color.toString()})`;\n ctx.lineWidth = 3;\n\n switch (patternId) {\n case 2:\n /* Hatched pattern */\n /* Ascending line */\n ctx.beginPath();\n ctx.moveTo(0, canvasElement.height);\n ctx.lineTo(0, canvasElement.height - ctx.lineWidth / 2);\n ctx.lineTo(canvasElement.width - ctx.lineWidth / 2, 0);\n ctx.lineTo(canvasElement.width, 0);\n ctx.lineTo(canvasElement.width, ctx.lineWidth / 2);\n ctx.lineTo(ctx.lineWidth / 2, canvasElement.height);\n ctx.lineTo(ctx.lineWidth / 2, canvasElement.height);\n ctx.fill();\n ctx.closePath();\n\n /* Descending line */\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.lineTo(0, ctx.lineWidth / 2);\n ctx.lineTo(canvasElement.width - ctx.lineWidth / 2, canvasElement.height);\n ctx.lineTo(canvasElement.width, canvasElement.height);\n ctx.lineTo(canvasElement.width, canvasElement.height - ctx.lineWidth / 2);\n ctx.lineTo(ctx.lineWidth / 2, 0);\n ctx.lineTo(0, 0);\n ctx.fill();\n ctx.closePath();\n\n pattern = ctx.createPattern(canvasElement, 'repeat');\n pattern.canvas = canvasElement;\n break;\n case 3:\n /* Shade ascending pattern */\n /* Corner triangle */\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.lineTo(0, ctx.lineWidth / 2);\n ctx.lineTo(ctx.lineWidth / 2, 0);\n ctx.fill();\n ctx.closePath();\n\n /* Ascending line */\n ctx.beginPath();\n ctx.moveTo(0, canvasElement.height);\n ctx.lineTo(0, canvasElement.height - ctx.lineWidth / 2);\n ctx.lineTo(canvasElement.width - ctx.lineWidth / 2, 0);\n ctx.lineTo(canvasElement.width, 0);\n ctx.lineTo(canvasElement.width, ctx.lineWidth / 2);\n ctx.lineTo(ctx.lineWidth / 2, canvasElement.height);\n ctx.lineTo(ctx.lineWidth / 2, canvasElement.height);\n ctx.fill();\n ctx.closePath();\n\n /* Corner triangle */\n ctx.beginPath();\n ctx.moveTo(canvasElement.width, canvasElement.height);\n ctx.lineTo(canvasElement.width, canvasElement.height - ctx.lineWidth / 2);\n ctx.lineTo(canvasElement.width - ctx.lineWidth / 2, canvasElement.height);\n ctx.fill();\n ctx.closePath();\n\n pattern = ctx.createPattern(canvasElement, 'repeat');\n pattern.canvas = canvasElement;\n break;\n case 4:\n /* Shade descending pattern */\n /* Corner triangle */\n ctx.beginPath();\n ctx.moveTo(canvasElement.width, 0);\n ctx.lineTo(canvasElement.width, ctx.lineWidth / 2);\n ctx.lineTo(canvasElement.width - ctx.lineWidth / 2, 0);\n ctx.fill();\n ctx.closePath();\n\n /* Descending line */\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.lineTo(0, ctx.lineWidth / 2);\n ctx.lineTo(canvasElement.width - ctx.lineWidth / 2, canvasElement.height);\n ctx.lineTo(canvasElement.width, canvasElement.height);\n ctx.lineTo(canvasElement.width, canvasElement.height - ctx.lineWidth / 2);\n ctx.lineTo(ctx.lineWidth / 2, 0);\n ctx.lineTo(0, 0);\n ctx.fill();\n ctx.closePath();\n\n /* Corner triangle */\n ctx.beginPath();\n ctx.moveTo(0, canvasElement.height);\n ctx.lineTo(0, canvasElement.height - ctx.lineWidth / 2);\n ctx.lineTo(ctx.lineWidth / 2, canvasElement.height);\n ctx.fill();\n ctx.closePath();\n\n pattern = ctx.createPattern(canvasElement, 'repeat');\n pattern.canvas = canvasElement;\n break;\n default:\n }\n\n if (patternId === 0) {\n pattern.empty = true;\n }\n\n pattern.id = patternId;\n pattern.color = color;\n\n return pattern;\n};\n\nexport default getPolygonPattern;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,40 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns a string representation of a number, with a zero if the number is lower than 10.
|
|
3
|
-
* @ignore
|
|
4
|
-
*/
|
|
5
1
|
export const pad = (integer) => {
|
|
6
2
|
return integer < 10 ? `0${integer}` : integer;
|
|
7
3
|
};
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Returns a 'hh:mm' string from a time in ms.
|
|
11
|
-
* @param {Number} timeInMs Time in milliseconds.
|
|
12
|
-
* @ignore
|
|
13
|
-
*/
|
|
14
4
|
export const getHoursAndMinutes = (timeInMs) => {
|
|
15
5
|
if (!timeInMs || timeInMs <= 0) {
|
|
16
|
-
return
|
|
6
|
+
return "";
|
|
17
7
|
}
|
|
18
8
|
const date = new Date(timeInMs);
|
|
19
9
|
return `${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
20
10
|
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Returns a string representing a delay.
|
|
24
|
-
* @param {Number} timeInMs Delay time in milliseconds.
|
|
25
|
-
* @ignore
|
|
26
|
-
*/
|
|
27
11
|
export const getDelayString = (delayInMs) => {
|
|
28
12
|
let timeInMs = delayInMs;
|
|
29
13
|
if (timeInMs < 0) {
|
|
30
14
|
timeInMs = 0;
|
|
31
15
|
}
|
|
32
|
-
const h = Math.floor(timeInMs /
|
|
33
|
-
const m = Math.floor(
|
|
34
|
-
const s = Math.floor(
|
|
35
|
-
|
|
16
|
+
const h = Math.floor(timeInMs / 36e5);
|
|
17
|
+
const m = Math.floor(timeInMs % 36e5 / 6e4);
|
|
18
|
+
const s = Math.floor(timeInMs % 36e5 % 6e4 / 1e3);
|
|
36
19
|
if (s === 0 && h === 0 && m === 0) {
|
|
37
|
-
return
|
|
20
|
+
return "0";
|
|
38
21
|
}
|
|
39
22
|
if (s === 0 && h === 0) {
|
|
40
23
|
return `${m}m`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/utils/timeUtils.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * Returns a string representation of a number, with a zero if the number is lower than 10.\n * @ignore\n */\nexport const pad = (integer) => {\n return integer < 10 ? `0${integer}` : integer;\n};\n\n/**\n * Returns a 'hh:mm' string from a time in ms.\n * @param {Number} timeInMs Time in milliseconds.\n * @ignore\n */\nexport const getHoursAndMinutes = (timeInMs) => {\n if (!timeInMs || timeInMs <= 0) {\n return '';\n }\n const date = new Date(timeInMs);\n return `${pad(date.getHours())}:${pad(date.getMinutes())}`;\n};\n\n/**\n * Returns a string representing a delay.\n * @param {Number} timeInMs Delay time in milliseconds.\n * @ignore\n */\nexport const getDelayString = (delayInMs) => {\n let timeInMs = delayInMs;\n if (timeInMs < 0) {\n timeInMs = 0;\n }\n const h = Math.floor(timeInMs / 3600000);\n const m = Math.floor((timeInMs % 3600000) / 60000);\n const s = Math.floor(((timeInMs % 3600000) % 60000) / 1000);\n\n if (s === 0 && h === 0 && m === 0) {\n return '0';\n }\n if (s === 0 && h === 0) {\n return `${m}m`;\n }\n if (s === 0) {\n return `${h}h${m}m`;\n }\n if (m === 0 && h === 0) {\n return `${s}s`;\n }\n if (h === 0) {\n return `${m}m${s}s`;\n }\n return `${h}h${m}m${s}s`;\n};\n"],
|
|
5
|
+
"mappings": "AAIO,aAAM,MAAM,CAAC,YAAY;AAC9B,SAAO,UAAU,KAAK,IAAI,YAAY;AACxC;AAOO,aAAM,qBAAqB,CAAC,aAAa;AAC9C,MAAI,CAAC,YAAY,YAAY,GAAG;AAC9B,WAAO;AAAA,EACT;AACA,QAAM,OAAO,IAAI,KAAK,QAAQ;AAC9B,SAAO,GAAG,IAAI,KAAK,SAAS,CAAC,KAAK,IAAI,KAAK,WAAW,CAAC;AACzD;AAOO,aAAM,iBAAiB,CAAC,cAAc;AAC3C,MAAI,WAAW;AACf,MAAI,WAAW,GAAG;AAChB,eAAW;AAAA,EACb;AACA,QAAM,IAAI,KAAK,MAAM,WAAW,IAAO;AACvC,QAAM,IAAI,KAAK,MAAO,WAAW,OAAW,GAAK;AACjD,QAAM,IAAI,KAAK,MAAQ,WAAW,OAAW,MAAS,GAAI;AAE1D,MAAI,MAAM,KAAK,MAAM,KAAK,MAAM,GAAG;AACjC,WAAO;AAAA,EACT;AACA,MAAI,MAAM,KAAK,MAAM,GAAG;AACtB,WAAO,GAAG;AAAA,EACZ;AACA,MAAI,MAAM,GAAG;AACX,WAAO,GAAG,KAAK;AAAA,EACjB;AACA,MAAI,MAAM,KAAK,MAAM,GAAG;AACtB,WAAO,GAAG;AAAA,EACZ;AACA,MAAI,MAAM,GAAG;AACX,WAAO,GAAG,KAAK;AAAA,EACjB;AACA,SAAO,GAAG,KAAK,KAAK;AACtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
name: Check PR title
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
types:
|
|
5
|
-
- opened
|
|
6
|
-
- reopened
|
|
7
|
-
- edited
|
|
8
|
-
- synchronize
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
lint:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: aslafy-z/conventional-pr-title-action@v2.2.0
|
|
15
|
-
with:
|
|
16
|
-
success-state: Title follows the specification.
|
|
17
|
-
failure-state: Title does not follow the specification.
|
|
18
|
-
context-name: conventional-pr-title
|
|
19
|
-
preset: conventional-changelog-angular@latest
|
|
20
|
-
env:
|
|
21
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
name: main
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
push:
|
|
6
|
-
branches:
|
|
7
|
-
- master
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout
|
|
15
|
-
uses: actions/checkout@v3
|
|
16
|
-
|
|
17
|
-
- name: Setup node
|
|
18
|
-
uses: actions/setup-node@v3
|
|
19
|
-
with:
|
|
20
|
-
node-version-file: '.nvmrc'
|
|
21
|
-
|
|
22
|
-
- name: Run linting and tests
|
|
23
|
-
run: |
|
|
24
|
-
yarn install --frozen-lockfile
|
|
25
|
-
yarn lint
|
|
26
|
-
yarn test
|
|
27
|
-
env:
|
|
28
|
-
CI: true
|
package/.husky/commit-msg
DELETED
package/.husky/post-checkout
DELETED
package/.husky/post-merge
DELETED
package/.husky/post-rebase
DELETED
package/.husky/pre-commit
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
16
|
package/.whitesource
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
##########################################################
|
|
2
|
-
#### WhiteSource Integration configuration file ####
|
|
3
|
-
##########################################################
|
|
4
|
-
|
|
5
|
-
# Configuration #
|
|
6
|
-
#---------------#
|
|
7
|
-
ws.repo.scan=true
|
|
8
|
-
vulnerable.check.run.conclusion.level=failure
|
package/CHANGELOG.md
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
### [1.5.2](https://github.com/geops/react-spatial/compare/v1.5.1...v1.5.2) (2023-06-28)
|
|
6
|
-
|
|
7
|
-
### [1.5.1](https://github.com/geops/react-spatial/compare/v1.5.0...v1.5.1) (2023-06-28)
|
|
8
|
-
|
|
9
|
-
## [1.5.0](https://github.com/geops/react-spatial/compare/v1.4.1...v1.5.0) (2023-04-28)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
### Features
|
|
13
|
-
|
|
14
|
-
* update react 18 and clean dependencies ([9064937](https://github.com/geops/react-spatial/commit/9064937aa975f072a84b0ad82e791e79ed129c8f))
|
|
15
|
-
|
|
16
|
-
### [1.4.1](https://github.com/geops/react-spatial/compare/v1.4.0...v1.4.1) (2023-04-28)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### Bug Fixes
|
|
20
|
-
|
|
21
|
-
* use a more intuitive zooming behavior ([2d43f31](https://github.com/geops/react-spatial/commit/2d43f3189096b2195e0b550e8fb2d9d994746a8a))
|
|
22
|
-
|
|
23
|
-
## [1.4.0](https://github.com/geops/react-spatial/compare/v1.3.2...v1.4.0) (2023-01-09)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
### Features
|
|
27
|
-
|
|
28
|
-
* **CanvasSaveButton:** add extraData.qrCode option to insert QR code in canvas export ([#700](https://github.com/geops/react-spatial/issues/700)) ([16be889](https://github.com/geops/react-spatial/commit/16be889d97682c2a2d21c2fa17d55cae205e09da))
|
|
29
|
-
|
|
30
|
-
### [1.3.2](https://github.com/geops/react-spatial/compare/v1.3.1...v1.3.2) (2022-12-15)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Bug Fixes
|
|
34
|
-
|
|
35
|
-
* fix use of baselayers permalink and baselayerswitcher ([#699](https://github.com/geops/react-spatial/issues/699)) ([23af45f](https://github.com/geops/react-spatial/commit/23af45f5681cc50cfc4c60502b71c161a478fe71))
|
|
36
|
-
|
|
37
|
-
### [1.3.1](https://github.com/geops/react-spatial/compare/v1.3.1-beta.0...v1.3.1) (2022-12-15)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### Bug Fixes
|
|
41
|
-
|
|
42
|
-
* fix detection of base layer in permalink ([9099ba7](https://github.com/geops/react-spatial/commit/9099ba704d15c670e87f8cb9245f06f159078f3e))
|
|
43
|
-
|
|
44
|
-
## [1.3.0](https://github.com/geops/react-spatial/compare/v1.3.0-beta.1...v1.3.0) (2022-11-14)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Bug Fixes
|
|
48
|
-
|
|
49
|
-
* **LayerTree:** add input and toggle props for layer tree renderItemContent ([#697](https://github.com/geops/react-spatial/issues/697)) ([8df5237](https://github.com/geops/react-spatial/commit/8df5237482373dc9c9de1ab9cfecefaf3472dcba))
|
|
50
|
-
|
|
51
|
-
### [1.2.2](https://github.com/geops/react-spatial/compare/v1.2.1...v1.2.2) (2022-07-22)
|
|
52
|
-
|
|
53
|
-
### [1.2.1](https://github.com/geops/react-spatial/compare/v1.2.0...v1.2.1) (2022-07-22)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### Bug Fixes
|
|
57
|
-
|
|
58
|
-
* make component better work with nextjs image sand routing ([#694](https://github.com/geops/react-spatial/issues/694)) ([85871fe](https://github.com/geops/react-spatial/commit/85871fe2201ecad0de76442bc9d77815bfe6db27))
|
|
59
|
-
|
|
60
|
-
## [1.2.0](https://github.com/geops/react-spatial/compare/v1.0.35...v1.2.0) (2022-06-20)
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
### Features
|
|
64
|
-
|
|
65
|
-
* use standard-version and commitlint for automatic versioning and changelog ([#690](https://github.com/geops/react-spatial/issues/690)) ([2c83f00](https://github.com/geops/react-spatial/commit/2c83f00c05f5b76b3f7e38978fb022d7cebfbcfc))
|
package/DEVELOP.md
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
# Develop
|
|
2
|
-
|
|
3
|
-
## Create new component
|
|
4
|
-
|
|
5
|
-
Follow the [guidelines](https://github.com/geops/react-spatial/tree/master/src/components).
|
|
6
|
-
|
|
7
|
-
## Create new theme
|
|
8
|
-
|
|
9
|
-
Follow the [guidelines](https://github.com/geops/react-spatial/tree/master/src/themes).
|
|
10
|
-
|
|
11
|
-
## Documentation
|
|
12
|
-
|
|
13
|
-
We are using [react-styleguidist](https://react-styleguidist.js.org/).
|
|
14
|
-
Documentation and examples are available [here](https://react-spatial.geops.de/).
|
|
15
|
-
|
|
16
|
-
Build the doc:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
yarn doc
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Run the doc on [`locahost:6060`](http://locahost:6060/):
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
yarn start
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Tests
|
|
29
|
-
|
|
30
|
-
We are using [jest]([https://react-styleguidist.js.org/](https://jestjs.io/docs/en/getting-started.html)) and [enzyme]([https://github.com/airbnb/enzyme](https://airbnb.io/enzyme/)).
|
|
31
|
-
|
|
32
|
-
Run the tests in watch mode:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
yarn test --watch
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Coverage
|
|
39
|
-
|
|
40
|
-
Run coverage:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
yarn coverage
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
Then open the file `coverage/lcov-report/index.html` in your browser.
|
|
47
|
-
|
|
48
|
-
## Publish on [npmjs.com](https://www.npmjs.com/package/react-spatial)
|
|
49
|
-
|
|
50
|
-
Run publish:
|
|
51
|
-
|
|
52
|
-
```bash
|
|
53
|
-
publish:public
|
|
54
|
-
```
|
|
55
|
-
You need to enter the new version number in the command line.
|
|
56
|
-
Then the new version must be published on [npmjs.com](https://www.npmjs.com/package/react-spatial).
|
|
57
|
-
|
|
58
|
-
## Publish a development version on [npmjs.com](https://www.npmjs.com/package/react-spatial)
|
|
59
|
-
|
|
60
|
-
This version WILL NOT be displayed to other in [npmjs.com](https://www.npmjs.com/package/react-spatial).
|
|
61
|
-
|
|
62
|
-
Run publish:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
publish:beta
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
You need to enter the new version number in the command line.
|
|
69
|
-
Append `-beta.0` to the current version or increase the beta number.
|
|
70
|
-
Then the new version must be published on [npmjs.com](https://www.npmjs.com/package/react-spatial) with the tag beta.
|
|
71
|
-
|
|
72
|
-
## How to use SVG
|
|
73
|
-
|
|
74
|
-
Before adding an SVG file in this folder please clean it using [svgo](https://www.npmjs.com/package/svgo) or [svgomg](https://jakearchibald.github.io/svgomg/).
|
|
75
|
-
|
|
76
|
-
After optimization, verify you can use it Openlayers using this [code sandbox](https://codesandbox.io/s/5w5o4mqwlk).
|
|
77
|
-
|
|
78
|
-
By default the svg loader will load the svg file as a react component if you want to load svg file as a base64 data URI use the extension .url.svg :
|
|
79
|
-
|
|
80
|
-
```javascript
|
|
81
|
-
// Import as a React component:
|
|
82
|
-
import NorthArrow from 'northArrow.svg';
|
|
83
|
-
// Use: <NorthArrow />
|
|
84
|
-
|
|
85
|
-
// Import as a base64 data URI (or with an url the file is too big):
|
|
86
|
-
import northArrow from 'northArrow.url.svg';
|
|
87
|
-
// northArrow = "data:image/svg+xml;base64,PHN2ZyB4...."
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
You could also use others loaders (ex: svg-inline-loader , svg-url-loader ...) .
|
|
91
|
-
To use these loaders just adapt the extension of the svg file and add the loader config in styleguide.config.js, then you will be able to use it like this :
|
|
92
|
-
|
|
93
|
-
```javascript
|
|
94
|
-
// Import as an inline svg:
|
|
95
|
-
import northArrow from 'northArrow.svginline.svg';
|
|
96
|
-
// northArrow = "<svg xmlns='http://www.w3.org/2000/svg' height='192' ...> ... </svg>"
|
|
97
|
-
|
|
98
|
-
// Import as an encoded inline svg data URI (or with an url the file is too big):
|
|
99
|
-
import northArrow from 'northArrow.svgurl.svg';
|
|
100
|
-
// northArrow = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='192' ...%3E ... %3C/svg%3E"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## How to use SVG with a dynamic size
|
|
104
|
-
|
|
105
|
-
In case you want your SVG fits perfectly his parent div you need to remove `width` and `height` attributes of `<svg>` and replace it by a `viewBox` property, like this:
|
|
106
|
-
|
|
107
|
-
Replace
|
|
108
|
-
|
|
109
|
-
`<svg width="192" height="192">`
|
|
110
|
-
|
|
111
|
-
by
|
|
112
|
-
|
|
113
|
-
`<svg viewBox="0 0 192 192">`
|
package/__mocks__/mapbox-gl.js
DELETED
package/babel.config.js
DELETED
package/commitlint.config.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = { extends: ['@commitlint/config-conventional'] };
|
package/data/topic1.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import Style from 'ol/style/Style';
|
|
2
|
-
import Circle from 'ol/style/Circle';
|
|
3
|
-
import Stroke from 'ol/style/Stroke';
|
|
4
|
-
import Fill from 'ol/style/Fill';
|
|
5
|
-
|
|
6
|
-
const topic1 = {
|
|
7
|
-
id: 'topic1',
|
|
8
|
-
name: 'Topic 1',
|
|
9
|
-
visible: true,
|
|
10
|
-
children: [
|
|
11
|
-
{
|
|
12
|
-
name: 'OSM Baselayer',
|
|
13
|
-
visible: true,
|
|
14
|
-
isBaseLayer: true,
|
|
15
|
-
data: {
|
|
16
|
-
type: 'xyz',
|
|
17
|
-
url: 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'Other layers',
|
|
22
|
-
visible: true,
|
|
23
|
-
type: 'parent',
|
|
24
|
-
children: [
|
|
25
|
-
{
|
|
26
|
-
name: 'Countries Borders',
|
|
27
|
-
visible: false,
|
|
28
|
-
data: {
|
|
29
|
-
type: 'vectorLayer',
|
|
30
|
-
url:
|
|
31
|
-
'https://openlayers.org/en/latest/examples/data/geojson/' +
|
|
32
|
-
'countries.geojson',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'USA Population Density',
|
|
37
|
-
visible: true,
|
|
38
|
-
data: {
|
|
39
|
-
type: 'wmts',
|
|
40
|
-
url:
|
|
41
|
-
'https://services.arcgisonline.com/arcgis/rest/services/' +
|
|
42
|
-
'Demographics/USA_Population_Density/MapServer/WMTS/?layer=0' +
|
|
43
|
-
'&style=default&tilematrixset=EPSG%3A3857&Service=WMTS&' +
|
|
44
|
-
'Request=GetTile&Version=1.0.0&Format=image%2Fpng&',
|
|
45
|
-
projection: 'EPSG:3857',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'Vector sample layers',
|
|
52
|
-
visible: true,
|
|
53
|
-
radioGroup: 'radio',
|
|
54
|
-
children: [
|
|
55
|
-
{
|
|
56
|
-
name: 'Points Samples',
|
|
57
|
-
radioGroup: 'vectorLayers',
|
|
58
|
-
visible: false,
|
|
59
|
-
data: {
|
|
60
|
-
style: new Style({
|
|
61
|
-
image: new Circle({
|
|
62
|
-
radius: 5,
|
|
63
|
-
fill: new Fill({
|
|
64
|
-
color: '#ff0000',
|
|
65
|
-
}),
|
|
66
|
-
}),
|
|
67
|
-
}),
|
|
68
|
-
type: 'vectorLayer',
|
|
69
|
-
url:
|
|
70
|
-
'https://raw.githubusercontent.com/openlayers/openlayers/' +
|
|
71
|
-
'3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
|
|
72
|
-
'point-samples.geojson',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'Lines Samples',
|
|
77
|
-
radioGroup: 'vectorLayers',
|
|
78
|
-
visible: true,
|
|
79
|
-
data: {
|
|
80
|
-
style: new Style({
|
|
81
|
-
stroke: new Stroke({
|
|
82
|
-
color: '#ffcc33',
|
|
83
|
-
width: 2,
|
|
84
|
-
}),
|
|
85
|
-
}),
|
|
86
|
-
type: 'vectorLayer',
|
|
87
|
-
url:
|
|
88
|
-
'https://raw.githubusercontent.com/openlayers/openlayers/' +
|
|
89
|
-
'3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
|
|
90
|
-
'line-samples.geojson',
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: 'Polygons Samples',
|
|
95
|
-
radioGroup: 'vectorLayers',
|
|
96
|
-
visible: false,
|
|
97
|
-
data: {
|
|
98
|
-
style: new Style({
|
|
99
|
-
stroke: new Stroke({
|
|
100
|
-
color: '#7dff8f',
|
|
101
|
-
width: 3,
|
|
102
|
-
}),
|
|
103
|
-
fill: new Fill({
|
|
104
|
-
color: 'rgba(125, 255, 143, 0.2)',
|
|
105
|
-
}),
|
|
106
|
-
}),
|
|
107
|
-
type: 'vectorLayer',
|
|
108
|
-
url:
|
|
109
|
-
'https://raw.githubusercontent.com/openlayers/openlayers/' +
|
|
110
|
-
'3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
|
|
111
|
-
'polygon-samples.geojson',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export default topic1;
|
package/data/topic2.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
const topic2 = {
|
|
2
|
-
id: 'topic2',
|
|
3
|
-
name: 'Topic 2',
|
|
4
|
-
visible: false,
|
|
5
|
-
children: [
|
|
6
|
-
{
|
|
7
|
-
name: 'OSM Baselayer',
|
|
8
|
-
visible: true,
|
|
9
|
-
isBaseLayer: true,
|
|
10
|
-
data: {
|
|
11
|
-
type: 'xyz',
|
|
12
|
-
url: 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: 'Countries Borders',
|
|
17
|
-
visible: true,
|
|
18
|
-
data: {
|
|
19
|
-
type: 'vectorLayer',
|
|
20
|
-
url:
|
|
21
|
-
'https://openlayers.org/en/latest/examples/data/geojson/' +
|
|
22
|
-
'countries.geojson',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default topic2;
|