react-spatial 1.5.3 → 1.5.5
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 +262 -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/{src/components → components}/BasicMap/BasicMap.js +80 -170
- 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 +133 -278
- package/components/CanvasSaveButton/CanvasSaveButton.js.map +7 -0
- package/components/CanvasSaveButton/index.js +1 -0
- package/components/CanvasSaveButton/index.js.map +7 -0
- package/{src/components → components}/Copyright/Copyright.js +21 -41
- 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 +80 -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/{src/components → components}/FitExtent/FitExtent.js +16 -30
- 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 +60 -110
- package/components/Geolocation/Geolocation.js.map +7 -0
- package/components/Geolocation/index.js +1 -0
- package/components/Geolocation/index.js.map +7 -0
- package/{src/components → components}/LayerTree/LayerTree.js +113 -213
- package/components/LayerTree/LayerTree.js.map +7 -0
- package/components/LayerTree/index.js +1 -0
- package/components/LayerTree/index.js.map +7 -0
- package/{src/components → components}/MousePosition/MousePosition.js +37 -70
- package/components/MousePosition/MousePosition.js.map +7 -0
- package/components/MousePosition/index.js +1 -0
- package/components/MousePosition/index.js.map +7 -0
- package/{src/components → components}/NorthArrow/NorthArrow.js +18 -34
- package/components/NorthArrow/NorthArrow.js.map +7 -0
- package/components/NorthArrow/index.js +1 -0
- package/components/NorthArrow/index.js.map +7 -0
- package/{src/components → components}/Overlay/Overlay.js +59 -85
- package/components/Overlay/Overlay.js.map +7 -0
- package/components/Overlay/index.js +1 -0
- package/components/Overlay/index.js.map +7 -0
- package/{src/components → components}/Permalink/Permalink.js +64 -147
- 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 +57 -116
- 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 -49
- 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 +268 -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/{src/components → components}/ScaleLine/ScaleLine.js +8 -23
- package/components/ScaleLine/ScaleLine.js.map +7 -0
- package/components/ScaleLine/index.js +1 -0
- package/components/ScaleLine/index.js.map +7 -0
- package/{src/components → components}/StopsFinder/StopsFinder.js +74 -103
- package/components/StopsFinder/StopsFinder.js.map +7 -0
- package/components/StopsFinder/StopsFinderOption.js +44 -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/{src/components → components}/Zoom/Zoom.js +46 -77
- 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 +32 -31
- package/{src/propTypes.js → propTypes.js} +30 -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 +420 -0
- package/utils/KML.js.map +7 -0
- package/{src/utils → utils}/KMLFormat.js +29 -32
- 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.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.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.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.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.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.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.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.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.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.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.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.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,10 +1,9 @@
|
|
|
1
|
-
import { PureComponent } from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import qs from
|
|
4
|
-
import OLMap from
|
|
5
|
-
import { unByKey } from
|
|
6
|
-
import { Layer, getLayersAsFlatArray } from
|
|
7
|
-
|
|
1
|
+
import { PureComponent } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import qs from "query-string";
|
|
4
|
+
import OLMap from "ol/Map";
|
|
5
|
+
import { unByKey } from "ol/Observable";
|
|
6
|
+
import { Layer, getLayersAsFlatArray } from "mobility-toolbox-js/ol";
|
|
8
7
|
const propTypes = {
|
|
9
8
|
/**
|
|
10
9
|
* Either 'react-router' history object:
|
|
@@ -13,29 +12,24 @@ const propTypes = {
|
|
|
13
12
|
* https://developer.mozilla.org/en-US/docs/Web/API/History
|
|
14
13
|
*/
|
|
15
14
|
history: PropTypes.shape({
|
|
16
|
-
replace: PropTypes.func
|
|
15
|
+
replace: PropTypes.func
|
|
17
16
|
}),
|
|
18
|
-
|
|
19
17
|
/**
|
|
20
18
|
* Layers provider.
|
|
21
19
|
*/
|
|
22
20
|
layers: PropTypes.arrayOf(PropTypes.instanceOf(Layer)),
|
|
23
|
-
|
|
24
21
|
/**
|
|
25
22
|
* An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).
|
|
26
23
|
*/
|
|
27
24
|
map: PropTypes.instanceOf(OLMap),
|
|
28
|
-
|
|
29
25
|
/**
|
|
30
26
|
* Params to be written in url.
|
|
31
27
|
*/
|
|
32
28
|
params: PropTypes.object,
|
|
33
|
-
|
|
34
29
|
/**
|
|
35
30
|
* Maximum number of decimals allowed for coordinates.
|
|
36
31
|
*/
|
|
37
32
|
coordinateDecimals: PropTypes.number,
|
|
38
|
-
|
|
39
33
|
/**
|
|
40
34
|
* Determine if the layer is hidden in the permalink or not.
|
|
41
35
|
*
|
|
@@ -44,7 +38,6 @@ const propTypes = {
|
|
|
44
38
|
* @return {bool} true if the item is not displayed in the permalink
|
|
45
39
|
*/
|
|
46
40
|
isLayerHidden: PropTypes.func,
|
|
47
|
-
|
|
48
41
|
/**
|
|
49
42
|
* Determine if the layer appears in the baselayers permalink parameter or not.
|
|
50
43
|
*
|
|
@@ -53,14 +46,12 @@ const propTypes = {
|
|
|
53
46
|
* @return {bool} true if the item is not displayed in the baselayers permalink parameter
|
|
54
47
|
*/
|
|
55
48
|
isBaseLayer: PropTypes.func,
|
|
56
|
-
|
|
57
49
|
/**
|
|
58
50
|
* Custom function to be called when the permalink is updated.
|
|
59
51
|
* This property has priority over the history parameter and window.history.replaceState calls.
|
|
60
52
|
*/
|
|
61
|
-
replace: PropTypes.func
|
|
53
|
+
replace: PropTypes.func
|
|
62
54
|
};
|
|
63
|
-
|
|
64
55
|
const defaultProps = {
|
|
65
56
|
history: null,
|
|
66
57
|
replace: null,
|
|
@@ -72,17 +63,9 @@ const defaultProps = {
|
|
|
72
63
|
return false;
|
|
73
64
|
},
|
|
74
65
|
isBaseLayer: (layer) => {
|
|
75
|
-
return layer.get(
|
|
76
|
-
}
|
|
66
|
+
return layer.get("isBaseLayer");
|
|
67
|
+
}
|
|
77
68
|
};
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* This component handles permalink logic. Injecting an
|
|
81
|
-
* __[ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html)__
|
|
82
|
-
* will add the *map center* (x, y) and the *zoom* (z) parameters to the permalink.
|
|
83
|
-
* Injecting layers will add the *baselayers* and/or *layers* parameters. Further parameters can
|
|
84
|
-
* be added using __params__.
|
|
85
|
-
*/
|
|
86
69
|
class Permalink extends PureComponent {
|
|
87
70
|
constructor(props) {
|
|
88
71
|
super(props);
|
|
@@ -90,216 +73,153 @@ class Permalink extends PureComponent {
|
|
|
90
73
|
this.onMoveEndRef = null;
|
|
91
74
|
this.onPropertyChangeKeys = [];
|
|
92
75
|
}
|
|
93
|
-
|
|
94
76
|
componentDidMount() {
|
|
95
77
|
const { map, layers, isLayerHidden, isBaseLayer } = this.props;
|
|
96
78
|
if (map) {
|
|
97
|
-
this.moveEndRef = map.on(
|
|
79
|
+
this.moveEndRef = map.on("moveend", () => {
|
|
98
80
|
this.onMapMoved();
|
|
99
81
|
});
|
|
100
82
|
}
|
|
101
|
-
|
|
102
83
|
if (layers) {
|
|
103
|
-
// set layer visibility based on 'layers' parameter.
|
|
104
84
|
const urlParams = qs.parse(window.location.search);
|
|
105
|
-
|
|
106
85
|
if (urlParams.layers) {
|
|
107
|
-
const visibleLayers = urlParams.layers.split(
|
|
86
|
+
const visibleLayers = urlParams.layers.split(",");
|
|
108
87
|
getLayersAsFlatArray(layers).forEach((l) => {
|
|
109
88
|
if (visibleLayers.includes(l.key)) {
|
|
110
89
|
if (l.setVisible) {
|
|
111
90
|
l.setVisible(true);
|
|
112
91
|
} else {
|
|
113
|
-
// eslint-disable-next-line no-param-reassign
|
|
114
92
|
l.visible = true;
|
|
115
93
|
}
|
|
116
|
-
} else if (
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
!l.children.some((ll) => {
|
|
120
|
-
return ll.visible;
|
|
121
|
-
})
|
|
122
|
-
) {
|
|
94
|
+
} else if (!isBaseLayer(l) && !isLayerHidden(l) && !l.children.some((ll) => {
|
|
95
|
+
return ll.visible;
|
|
96
|
+
})) {
|
|
123
97
|
if (l.setVisible) {
|
|
124
98
|
l.setVisible(false);
|
|
125
99
|
} else {
|
|
126
|
-
// eslint-disable-next-line no-param-reassign
|
|
127
100
|
l.visible = false;
|
|
128
101
|
}
|
|
129
102
|
}
|
|
130
103
|
});
|
|
131
104
|
}
|
|
132
|
-
|
|
133
|
-
// Set baser layer visibility based on 'baseLayers' parameter.
|
|
134
|
-
// Show the first of the list then hide the others
|
|
135
|
-
const visibleBaseLayer = (urlParams.baselayers || '').split(',')[0];
|
|
105
|
+
const visibleBaseLayer = (urlParams.baselayers || "").split(",")[0];
|
|
136
106
|
if (visibleBaseLayer) {
|
|
137
|
-
getLayersAsFlatArray(layers)
|
|
138
|
-
.
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
baseLayer.visible = visible;
|
|
146
|
-
}
|
|
147
|
-
});
|
|
107
|
+
getLayersAsFlatArray(layers).filter(isBaseLayer).forEach((baseLayer) => {
|
|
108
|
+
const visible = baseLayer.key === visibleBaseLayer;
|
|
109
|
+
if (baseLayer.setVisible) {
|
|
110
|
+
baseLayer.setVisible(visible);
|
|
111
|
+
} else {
|
|
112
|
+
baseLayer.visible = visible;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
148
115
|
}
|
|
149
116
|
this.updateLayers();
|
|
150
117
|
}
|
|
151
118
|
}
|
|
152
|
-
|
|
153
119
|
componentDidUpdate(prevProps, prevState) {
|
|
154
120
|
const { map, layers } = this.props;
|
|
155
121
|
const { revision } = this.state;
|
|
156
|
-
|
|
157
122
|
if (layers !== prevProps.layers || revision !== prevState.revision) {
|
|
158
123
|
this.updateLayers();
|
|
159
124
|
}
|
|
160
|
-
|
|
161
125
|
if (map !== prevProps.map) {
|
|
162
126
|
unByKey(this.moveEndRef);
|
|
163
|
-
this.moveEndRef = map.on(
|
|
127
|
+
this.moveEndRef = map.on("moveend", () => {
|
|
164
128
|
return this.onMapMoved();
|
|
165
129
|
});
|
|
166
130
|
}
|
|
167
|
-
|
|
168
131
|
this.updateHistory();
|
|
169
132
|
}
|
|
170
|
-
|
|
171
133
|
componentWillUnmount() {
|
|
172
134
|
const { map } = this.props;
|
|
173
|
-
|
|
174
135
|
if (map) {
|
|
175
136
|
unByKey(this.moveEndRef);
|
|
176
137
|
}
|
|
177
138
|
unByKey(this.onPropertyChangeKeys);
|
|
178
139
|
this.onPropertyChangeKeys = [];
|
|
179
140
|
}
|
|
180
|
-
|
|
181
141
|
onMapMoved() {
|
|
182
142
|
const { map } = this.props;
|
|
183
143
|
const mapView = map.getView();
|
|
184
144
|
const center = mapView.getCenter();
|
|
185
145
|
const params = {};
|
|
186
|
-
|
|
187
|
-
if (
|
|
188
|
-
center !== undefined &&
|
|
189
|
-
center[0] !== undefined &&
|
|
190
|
-
center[1] !== undefined
|
|
191
|
-
) {
|
|
146
|
+
if (center !== void 0 && center[0] !== void 0 && center[1] !== void 0) {
|
|
192
147
|
params.x = this.roundCoord(center[0]);
|
|
193
148
|
params.y = this.roundCoord(center[1]);
|
|
194
149
|
}
|
|
195
|
-
|
|
196
150
|
this.setState({
|
|
197
151
|
...params,
|
|
198
152
|
// rounds zoom to two digits max.
|
|
199
|
-
z: +`${Math.round(`${parseFloat(mapView.getZoom())}e+2`)}e-2
|
|
153
|
+
z: +`${Math.round(`${parseFloat(mapView.getZoom())}e+2`)}e-2`
|
|
200
154
|
});
|
|
201
155
|
}
|
|
202
|
-
|
|
203
156
|
roundCoord(val) {
|
|
204
157
|
const { coordinateDecimals } = this.props;
|
|
205
158
|
return parseFloat(val.toFixed(coordinateDecimals));
|
|
206
159
|
}
|
|
207
|
-
|
|
208
160
|
updateLayers() {
|
|
209
161
|
const { layers, isLayerHidden, isBaseLayer } = this.props;
|
|
210
162
|
const { revision } = this.state;
|
|
211
|
-
|
|
212
163
|
unByKey(this.onPropertyChangeKeys);
|
|
213
164
|
this.onPropertyChangeKeys = getLayersAsFlatArray(layers).map((layer) => {
|
|
214
|
-
return layer.on(
|
|
165
|
+
return layer.on("change:visible", () => {
|
|
215
166
|
this.setState({ revision: revision + 1 });
|
|
216
167
|
});
|
|
217
168
|
});
|
|
218
|
-
|
|
219
|
-
// layers param
|
|
220
169
|
let layersParam;
|
|
221
170
|
if (layers.length) {
|
|
222
|
-
layersParam = getLayersAsFlatArray(layers)
|
|
223
|
-
.
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
l.visible &&
|
|
235
|
-
(!hasVisibleChildren || allChildrenHidden)
|
|
236
|
-
);
|
|
237
|
-
})
|
|
238
|
-
.map((l) => {
|
|
239
|
-
return l.key;
|
|
240
|
-
})
|
|
241
|
-
.join();
|
|
171
|
+
layersParam = getLayersAsFlatArray(layers).filter((l) => {
|
|
172
|
+
const children = l.children || [];
|
|
173
|
+
const allChildrenHidden = children.every((child) => {
|
|
174
|
+
return isLayerHidden(child);
|
|
175
|
+
});
|
|
176
|
+
const hasVisibleChildren = children.some((child) => {
|
|
177
|
+
return child.visible;
|
|
178
|
+
});
|
|
179
|
+
return !isBaseLayer(l) && !isLayerHidden(l) && l.visible && (!hasVisibleChildren || allChildrenHidden);
|
|
180
|
+
}).map((l) => {
|
|
181
|
+
return l.key;
|
|
182
|
+
}).join();
|
|
242
183
|
}
|
|
243
|
-
|
|
244
|
-
// baselayers param
|
|
245
184
|
let baseLayersParam;
|
|
246
185
|
const baseLayers = getLayersAsFlatArray(layers).filter(isBaseLayer);
|
|
247
186
|
if (baseLayers.length) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
)
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
return
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}
|
|
266
|
-
return 1;
|
|
267
|
-
})
|
|
268
|
-
.map((l) => {
|
|
269
|
-
return l.key;
|
|
270
|
-
})
|
|
271
|
-
.join();
|
|
187
|
+
const visibleBaseLayers = (baseLayers.filter((l) => {
|
|
188
|
+
return l.visible;
|
|
189
|
+
}) || []).reverse();
|
|
190
|
+
const nonVisibleBaseLayers = baseLayers.filter((l) => {
|
|
191
|
+
return !l.visible;
|
|
192
|
+
}) || [];
|
|
193
|
+
baseLayersParam = [...visibleBaseLayers, ...nonVisibleBaseLayers].sort((a, b) => {
|
|
194
|
+
if (a.visible === b.visible) {
|
|
195
|
+
return 0;
|
|
196
|
+
}
|
|
197
|
+
if (a.visible && !b.visible) {
|
|
198
|
+
return -1;
|
|
199
|
+
}
|
|
200
|
+
return 1;
|
|
201
|
+
}).map((l) => {
|
|
202
|
+
return l.key;
|
|
203
|
+
}).join();
|
|
272
204
|
}
|
|
273
|
-
|
|
274
|
-
// Only add parameters if there is actually some layers added.
|
|
275
205
|
this.setState({
|
|
276
206
|
layers: layersParam,
|
|
277
|
-
baselayers: baseLayersParam
|
|
207
|
+
baselayers: baseLayersParam
|
|
278
208
|
});
|
|
279
209
|
}
|
|
280
|
-
|
|
281
210
|
updateHistory() {
|
|
282
211
|
const { params, history, replace } = this.props;
|
|
283
212
|
const oldParams = qs.parse(window.location.search);
|
|
284
213
|
const parameters = { ...oldParams, ...this.state, ...params };
|
|
285
|
-
|
|
286
214
|
delete parameters.revision;
|
|
287
|
-
|
|
288
|
-
// Remove parameters that are undefined or null
|
|
289
215
|
Object.entries(parameters).forEach(([key, value]) => {
|
|
290
|
-
if (value ===
|
|
216
|
+
if (value === void 0 || value === null) {
|
|
291
217
|
delete parameters[key];
|
|
292
218
|
}
|
|
293
219
|
});
|
|
294
|
-
|
|
295
|
-
// encodeURI to encode spaces, accents, etc. but not characters like ;,/?:@&=+$-_.!~*'()
|
|
296
220
|
const qStr = encodeURI(qs.stringify(parameters, { encode: false }));
|
|
297
|
-
const search = qStr ? `?${qStr}` :
|
|
298
|
-
|
|
299
|
-
if (
|
|
300
|
-
(!qStr && window.location.search) ||
|
|
301
|
-
(qStr && search !== window.location.search)
|
|
302
|
-
) {
|
|
221
|
+
const search = qStr ? `?${qStr}` : "";
|
|
222
|
+
if (!qStr && window.location.search || qStr && search !== window.location.search) {
|
|
303
223
|
if (replace) {
|
|
304
224
|
replace({ parameters, search });
|
|
305
225
|
} else if (history) {
|
|
@@ -307,20 +227,17 @@ class Permalink extends PureComponent {
|
|
|
307
227
|
} else {
|
|
308
228
|
const { hash } = window.location;
|
|
309
229
|
window.history.replaceState(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
`${search}${hash ||
|
|
230
|
+
void 0,
|
|
231
|
+
void 0,
|
|
232
|
+
`${search}${hash || ""}`
|
|
313
233
|
);
|
|
314
234
|
}
|
|
315
235
|
}
|
|
316
236
|
}
|
|
317
|
-
|
|
318
237
|
render() {
|
|
319
238
|
return null;
|
|
320
239
|
}
|
|
321
240
|
}
|
|
322
|
-
|
|
323
241
|
Permalink.propTypes = propTypes;
|
|
324
242
|
Permalink.defaultProps = defaultProps;
|
|
325
|
-
|
|
326
243
|
export default Permalink;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/Permalink/Permalink.js"],
|
|
4
|
+
"sourcesContent": ["import { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport qs from 'query-string';\nimport OLMap from 'ol/Map';\nimport { unByKey } from 'ol/Observable';\nimport { Layer, getLayersAsFlatArray } from 'mobility-toolbox-js/ol';\n\nconst propTypes = {\n /**\n * Either 'react-router' history object:\n * https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/history.md<br>\n * or default fallback as HTML5 History:\n * https://developer.mozilla.org/en-US/docs/Web/API/History\n */\n history: PropTypes.shape({\n replace: PropTypes.func,\n }),\n\n /**\n * Layers provider.\n */\n layers: PropTypes.arrayOf(PropTypes.instanceOf(Layer)),\n\n /**\n * An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\n map: PropTypes.instanceOf(OLMap),\n\n /**\n * Params to be written in url.\n */\n params: PropTypes.object,\n\n /**\n * Maximum number of decimals allowed for coordinates.\n */\n coordinateDecimals: PropTypes.number,\n\n /**\n * Determine if the layer is hidden in the permalink or not.\n *\n * @param {object} item The item to hide or not.\n *\n * @return {bool} true if the item is not displayed in the permalink\n */\n isLayerHidden: PropTypes.func,\n\n /**\n * Determine if the layer appears in the baselayers permalink parameter or not.\n *\n * @param {object} item The item to hide or not.\n *\n * @return {bool} true if the item is not displayed in the baselayers permalink parameter\n */\n isBaseLayer: PropTypes.func,\n\n /**\n * Custom function to be called when the permalink is updated.\n * This property has priority over the history parameter and window.history.replaceState calls.\n */\n replace: PropTypes.func,\n};\n\nconst defaultProps = {\n history: null,\n replace: null,\n layers: [],\n map: null,\n params: {},\n coordinateDecimals: 2,\n isLayerHidden: () => {\n return false;\n },\n isBaseLayer: (layer) => {\n return layer.get('isBaseLayer');\n },\n};\n\n/**\n * This component handles permalink logic. Injecting an\n * __[ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html)__\n * will add the *map center* (x, y) and the *zoom* (z) parameters to the permalink.\n * Injecting layers will add the *baselayers* and/or *layers* parameters. Further parameters can\n * be added using __params__.\n */\nclass Permalink extends PureComponent {\n constructor(props) {\n super(props);\n this.state = { revision: 0 };\n this.onMoveEndRef = null;\n this.onPropertyChangeKeys = [];\n }\n\n componentDidMount() {\n const { map, layers, isLayerHidden, isBaseLayer } = this.props;\n if (map) {\n this.moveEndRef = map.on('moveend', () => {\n this.onMapMoved();\n });\n }\n\n if (layers) {\n // set layer visibility based on 'layers' parameter.\n const urlParams = qs.parse(window.location.search);\n\n if (urlParams.layers) {\n const visibleLayers = urlParams.layers.split(',');\n getLayersAsFlatArray(layers).forEach((l) => {\n if (visibleLayers.includes(l.key)) {\n if (l.setVisible) {\n l.setVisible(true);\n } else {\n // eslint-disable-next-line no-param-reassign\n l.visible = true;\n }\n } else if (\n !isBaseLayer(l) &&\n !isLayerHidden(l) &&\n !l.children.some((ll) => {\n return ll.visible;\n })\n ) {\n if (l.setVisible) {\n l.setVisible(false);\n } else {\n // eslint-disable-next-line no-param-reassign\n l.visible = false;\n }\n }\n });\n }\n\n // Set baser layer visibility based on 'baseLayers' parameter.\n // Show the first of the list then hide the others\n const visibleBaseLayer = (urlParams.baselayers || '').split(',')[0];\n if (visibleBaseLayer) {\n getLayersAsFlatArray(layers)\n .filter(isBaseLayer)\n .forEach((baseLayer) => {\n const visible = baseLayer.key === visibleBaseLayer;\n if (baseLayer.setVisible) {\n baseLayer.setVisible(visible);\n } else {\n // eslint-disable-next-line no-param-reassign\n baseLayer.visible = visible;\n }\n });\n }\n this.updateLayers();\n }\n }\n\n componentDidUpdate(prevProps, prevState) {\n const { map, layers } = this.props;\n const { revision } = this.state;\n\n if (layers !== prevProps.layers || revision !== prevState.revision) {\n this.updateLayers();\n }\n\n if (map !== prevProps.map) {\n unByKey(this.moveEndRef);\n this.moveEndRef = map.on('moveend', () => {\n return this.onMapMoved();\n });\n }\n\n this.updateHistory();\n }\n\n componentWillUnmount() {\n const { map } = this.props;\n\n if (map) {\n unByKey(this.moveEndRef);\n }\n unByKey(this.onPropertyChangeKeys);\n this.onPropertyChangeKeys = [];\n }\n\n onMapMoved() {\n const { map } = this.props;\n const mapView = map.getView();\n const center = mapView.getCenter();\n const params = {};\n\n if (\n center !== undefined &&\n center[0] !== undefined &&\n center[1] !== undefined\n ) {\n params.x = this.roundCoord(center[0]);\n params.y = this.roundCoord(center[1]);\n }\n\n this.setState({\n ...params,\n // rounds zoom to two digits max.\n z: +`${Math.round(`${parseFloat(mapView.getZoom())}e+2`)}e-2`,\n });\n }\n\n roundCoord(val) {\n const { coordinateDecimals } = this.props;\n return parseFloat(val.toFixed(coordinateDecimals));\n }\n\n updateLayers() {\n const { layers, isLayerHidden, isBaseLayer } = this.props;\n const { revision } = this.state;\n\n unByKey(this.onPropertyChangeKeys);\n this.onPropertyChangeKeys = getLayersAsFlatArray(layers).map((layer) => {\n return layer.on('change:visible', () => {\n this.setState({ revision: revision + 1 });\n });\n });\n\n // layers param\n let layersParam;\n if (layers.length) {\n layersParam = getLayersAsFlatArray(layers)\n .filter((l) => {\n const children = l.children || [];\n const allChildrenHidden = children.every((child) => {\n return isLayerHidden(child);\n });\n const hasVisibleChildren = children.some((child) => {\n return child.visible;\n });\n return (\n !isBaseLayer(l) &&\n !isLayerHidden(l) &&\n l.visible &&\n (!hasVisibleChildren || allChildrenHidden)\n );\n })\n .map((l) => {\n return l.key;\n })\n .join();\n }\n\n // baselayers param\n let baseLayersParam;\n const baseLayers = getLayersAsFlatArray(layers).filter(isBaseLayer);\n if (baseLayers.length) {\n // First baselayers in order of visibility, top layer is first\n const visibleBaseLayers = (\n baseLayers.filter((l) => {\n return l.visible;\n }) || []\n ).reverse();\n const nonVisibleBaseLayers =\n baseLayers.filter((l) => {\n return !l.visible;\n }) || [];\n baseLayersParam = [...visibleBaseLayers, ...nonVisibleBaseLayers]\n .sort((a, b) => {\n if (a.visible === b.visible) {\n return 0;\n }\n if (a.visible && !b.visible) {\n return -1;\n }\n return 1;\n })\n .map((l) => {\n return l.key;\n })\n .join();\n }\n\n // Only add parameters if there is actually some layers added.\n this.setState({\n layers: layersParam,\n baselayers: baseLayersParam,\n });\n }\n\n updateHistory() {\n const { params, history, replace } = this.props;\n const oldParams = qs.parse(window.location.search);\n const parameters = { ...oldParams, ...this.state, ...params };\n\n delete parameters.revision;\n\n // Remove parameters that are undefined or null\n Object.entries(parameters).forEach(([key, value]) => {\n if (value === undefined || value === null) {\n delete parameters[key];\n }\n });\n\n // encodeURI to encode spaces, accents, etc. but not characters like ;,/?:@&=+$-_.!~*'()\n const qStr = encodeURI(qs.stringify(parameters, { encode: false }));\n const search = qStr ? `?${qStr}` : '';\n\n if (\n (!qStr && window.location.search) ||\n (qStr && search !== window.location.search)\n ) {\n if (replace) {\n replace({ parameters, search });\n } else if (history) {\n history.replace({ search });\n } else {\n const { hash } = window.location;\n window.history.replaceState(\n undefined,\n undefined,\n `${search}${hash || ''}`,\n );\n }\n }\n }\n\n render() {\n return null;\n }\n}\n\nPermalink.propTypes = propTypes;\nPermalink.defaultProps = defaultProps;\n\nexport default Permalink;\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,qBAAqB;AAC9B,OAAO,eAAe;AACtB,OAAO,QAAQ;AACf,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,OAAO,4BAA4B;AAE5C,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOhB,SAAS,UAAU,MAAM;AAAA,IACvB,SAAS,UAAU;AAAA,EACrB,CAAC;AAAA;AAAA;AAAA;AAAA,EAKD,QAAQ,UAAU,QAAQ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