react-spatial 1.2.2 → 1.2.3-beta.3
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/LayerService.js +128 -184
- package/LayerService.js.map +7 -1
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.js +163 -221
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +7 -1
- package/components/BaseLayerSwitcher/index.js +1 -3
- package/components/BaseLayerSwitcher/index.js.map +7 -1
- package/components/BasicMap/BasicMap.js +147 -285
- package/components/BasicMap/BasicMap.js.map +7 -1
- package/components/BasicMap/index.js +1 -3
- package/components/BasicMap/index.js.map +7 -1
- package/components/CanvasSaveButton/CanvasSaveButton.js +165 -419
- package/components/CanvasSaveButton/CanvasSaveButton.js.map +7 -1
- package/components/CanvasSaveButton/index.js +1 -3
- package/components/CanvasSaveButton/index.js.map +7 -1
- package/components/Copyright/Copyright.js +29 -70
- package/components/Copyright/Copyright.js.map +7 -1
- package/components/Copyright/index.js +1 -3
- package/components/Copyright/index.js.map +7 -1
- package/components/FeatureExportButton/FeatureExportButton.js +40 -106
- package/components/FeatureExportButton/FeatureExportButton.js.map +7 -1
- package/components/FeatureExportButton/index.js +1 -3
- package/components/FeatureExportButton/index.js.map +7 -1
- package/components/FilterButton/FilterButton.js +41 -106
- package/components/FilterButton/FilterButton.js.map +7 -1
- package/components/FilterButton/index.js +1 -3
- package/components/FilterButton/index.js.map +7 -1
- package/components/FitExtent/FitExtent.js +17 -50
- package/components/FitExtent/FitExtent.js.map +7 -1
- package/components/FitExtent/index.js +1 -3
- package/components/FitExtent/index.js.map +7 -1
- package/components/FollowButton/FollowButton.js +41 -111
- package/components/FollowButton/FollowButton.js.map +7 -1
- package/components/FollowButton/index.js +1 -3
- package/components/FollowButton/index.js.map +7 -1
- package/components/Geolocation/Geolocation.js +104 -213
- package/components/Geolocation/Geolocation.js.map +7 -1
- package/components/Geolocation/index.js +1 -3
- package/components/Geolocation/index.js.map +7 -1
- package/components/LayerTree/LayerTree.js +204 -410
- package/components/LayerTree/LayerTree.js.map +7 -1
- package/components/LayerTree/index.js +1 -3
- package/components/LayerTree/index.js.map +7 -1
- package/components/MousePosition/MousePosition.js +61 -130
- package/components/MousePosition/MousePosition.js.map +7 -1
- package/components/MousePosition/index.js +1 -3
- package/components/MousePosition/index.js.map +7 -1
- package/components/NorthArrow/NorthArrow.js +22 -62
- package/components/NorthArrow/NorthArrow.js.map +7 -1
- package/components/NorthArrow/index.js +1 -3
- package/components/NorthArrow/index.js.map +7 -1
- package/components/Overlay/Overlay.js +83 -130
- package/components/Overlay/Overlay.js.map +7 -1
- package/components/Overlay/index.js +1 -3
- package/components/Overlay/index.js.map +7 -1
- package/components/Permalink/Permalink.js +150 -244
- package/components/Permalink/Permalink.js.map +7 -1
- package/components/Permalink/index.js +1 -3
- package/components/Permalink/index.js.map +7 -1
- package/components/Popup/Popup.js +106 -233
- package/components/Popup/Popup.js.map +7 -1
- package/components/Popup/index.js +1 -3
- package/components/Popup/index.js.map +7 -1
- package/components/ResizeHandler/ResizeHandler.js +58 -113
- package/components/ResizeHandler/ResizeHandler.js.map +7 -1
- package/components/ResizeHandler/index.js +1 -3
- package/components/ResizeHandler/index.js.map +7 -1
- package/components/RouteSchedule/RouteSchedule.js +150 -283
- package/components/RouteSchedule/RouteSchedule.js.map +7 -1
- package/components/RouteSchedule/index.js +1 -3
- package/components/RouteSchedule/index.js.map +7 -1
- package/components/ScaleLine/ScaleLine.js +21 -45
- package/components/ScaleLine/ScaleLine.js.map +7 -1
- package/components/ScaleLine/index.js +1 -3
- package/components/ScaleLine/index.js.map +7 -1
- package/components/Search/Search.js +122 -186
- package/components/Search/Search.js.map +7 -1
- package/components/Search/SearchService.js +45 -69
- package/components/Search/SearchService.js.map +7 -1
- package/components/Search/engines/Engine.js +18 -25
- package/components/Search/engines/Engine.js.map +7 -1
- package/components/Search/engines/StopFinder.js +21 -38
- package/components/Search/engines/StopFinder.js.map +7 -1
- package/components/Search/index.js +3 -6
- package/components/Search/index.js.map +7 -1
- package/components/StopsFinder/StopsFinder.js +123 -174
- package/components/StopsFinder/StopsFinder.js.map +7 -1
- package/components/StopsFinder/StopsFinderOption.js +37 -54
- package/components/StopsFinder/StopsFinderOption.js.map +7 -1
- package/components/StopsFinder/index.js +1 -3
- package/components/StopsFinder/index.js.map +7 -1
- package/components/TrackerControl/TrackerControl.js +73 -128
- package/components/TrackerControl/TrackerControl.js.map +7 -1
- package/components/TrackerControl/index.js +1 -3
- package/components/TrackerControl/index.js.map +7 -1
- package/components/Zoom/Zoom.js +69 -112
- package/components/Zoom/Zoom.js.map +7 -1
- package/components/Zoom/index.js +1 -3
- package/components/Zoom/index.js.map +7 -1
- package/package.json +10 -5
- package/propTypes.js +17 -23
- package/propTypes.js.map +7 -1
- package/setupTests.js +2 -4
- package/setupTests.js.map +7 -1
- package/themes/README.md +26 -0
- package/themes/default/components.scss +0 -1
- package/themes/default/examples.scss +0 -1
- package/utils/GlobalsForOle.js +63 -64
- package/utils/GlobalsForOle.js.map +7 -1
- package/utils/KML.js +178 -364
- package/utils/KML.js.map +7 -1
- package/utils/KMLFormat.js +37 -73
- package/utils/KMLFormat.js.map +7 -1
- package/utils/Styles.js +24 -32
- package/utils/Styles.js.map +7 -1
- package/utils/getPolygonPattern.js +11 -44
- package/utils/getPolygonPattern.js.map +7 -1
- package/utils/timeUtils.js +16 -35
- package/utils/timeUtils.js.map +7 -1
- package/LayerService.test.js +0 -160
- package/LayerService.test.js.map +0 -1
- package/Projections.js +0 -16
- package/Projections.js.map +0 -1
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.test.js +0 -88
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.test.js.map +0 -1
- package/components/BaseLayerToggler/BaseLayerToggler.js +0 -490
- package/components/BaseLayerToggler/BaseLayerToggler.js.map +0 -1
- package/components/BaseLayerToggler/BaseLayerToggler.md.scss +0 -9
- package/components/BaseLayerToggler/BaseLayerToggler.scss +0 -49
- package/components/BaseLayerToggler/BaseLayerToggler.test.js +0 -127
- package/components/BaseLayerToggler/BaseLayerToggler.test.js.map +0 -1
- package/components/BaseLayerToggler/index.js +0 -3
- package/components/BaseLayerToggler/index.js.map +0 -1
- package/components/BasicMap/BasicMap.test.js +0 -288
- package/components/BasicMap/BasicMap.test.js.map +0 -1
- package/components/CanvasSaveButton/CanvasSaveButton.test.js +0 -173
- package/components/CanvasSaveButton/CanvasSaveButton.test.js.map +0 -1
- package/components/Copyright/Copyright.test.js +0 -133
- package/components/Copyright/Copyright.test.js.map +0 -1
- package/components/FeatureExportButton/FeatureExportButton.test.js +0 -407
- package/components/FeatureExportButton/FeatureExportButton.test.js.map +0 -1
- package/components/FilterButton/FilterButton.test.js +0 -48
- package/components/FilterButton/FilterButton.test.js.map +0 -1
- package/components/FitExtent/FitExtent.test.js +0 -44
- package/components/FitExtent/FitExtent.test.js.map +0 -1
- package/components/FollowButton/FollowButton.test.js +0 -57
- package/components/FollowButton/FollowButton.test.js.map +0 -1
- package/components/Geolocation/Geolocation.test.js +0 -263
- package/components/Geolocation/Geolocation.test.js.map +0 -1
- package/components/LayerTree/LayerTree.test.js +0 -323
- package/components/LayerTree/LayerTree.test.js.map +0 -1
- package/components/MousePosition/MousePosition.test.js +0 -125
- package/components/MousePosition/MousePosition.test.js.map +0 -1
- package/components/NorthArrow/NorthArrow.test.js +0 -106
- package/components/NorthArrow/NorthArrow.test.js.map +0 -1
- package/components/Overlay/Overlay.test.js +0 -145
- package/components/Overlay/Overlay.test.js.map +0 -1
- package/components/Permalink/Permalink.test.js +0 -267
- package/components/Permalink/Permalink.test.js.map +0 -1
- package/components/Popup/Popup.test.js +0 -291
- package/components/Popup/Popup.test.js.map +0 -1
- package/components/ResizeHandler/ResizeHandler.test.js +0 -410
- package/components/ResizeHandler/ResizeHandler.test.js.map +0 -1
- package/components/RouteSchedule/RouteSchedule.test.js +0 -102
- package/components/RouteSchedule/RouteSchedule.test.js.map +0 -1
- package/components/ScaleLine/ScaleLine.test.js +0 -32
- package/components/ScaleLine/ScaleLine.test.js.map +0 -1
- package/components/Search/Search.test.js +0 -15
- package/components/Search/Search.test.js.map +0 -1
- package/components/StopsFinder/StopsFinder.test.js +0 -19
- package/components/StopsFinder/StopsFinder.test.js.map +0 -1
- package/components/TrackerControl/TrackerControl.test.js +0 -17
- package/components/TrackerControl/TrackerControl.test.js.map +0 -1
- package/components/Zoom/Zoom.test.js +0 -150
- package/components/Zoom/Zoom.test.js.map +0 -1
- package/styleguidist/ComponentsList.js +0 -52
- package/styleguidist/ComponentsList.js.map +0 -1
- package/styleguidist/StyleGuide.js +0 -253
- package/styleguidist/StyleGuide.js.map +0 -1
- package/utils/KML.test.js +0 -163
- package/utils/KML.test.js.map +0 -1
- package/utils/KMLFormat.test.js +0 -22
- package/utils/KMLFormat.test.js.map +0 -1
- package/utils/getPolygonPattern.test.js +0 -66
- package/utils/getPolygonPattern.test.js.map +0 -1
- package/utils/timeUtils.test.js +0 -32
- package/utils/timeUtils.test.js.map +0 -1
package/components/Zoom/Zoom.js
CHANGED
|
@@ -1,163 +1,120 @@
|
|
|
1
|
-
function objectWithoutProperties (obj, exclude) { var target = {}; for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) target[k] = obj[k]; return target; }
|
|
2
1
|
import React, {
|
|
3
2
|
useEffect,
|
|
4
3
|
useRef,
|
|
5
4
|
useCallback,
|
|
6
5
|
useState,
|
|
7
|
-
useMemo
|
|
8
|
-
} from
|
|
9
|
-
import PropTypes from
|
|
10
|
-
import { FaPlus, FaMinus } from
|
|
11
|
-
import { ZoomSlider } from
|
|
12
|
-
import OLMap from
|
|
13
|
-
|
|
14
|
-
var propTypes = {
|
|
15
|
-
/**
|
|
16
|
-
* An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).
|
|
17
|
-
*/
|
|
6
|
+
useMemo
|
|
7
|
+
} from "react";
|
|
8
|
+
import PropTypes from "prop-types";
|
|
9
|
+
import { FaPlus, FaMinus } from "react-icons/fa";
|
|
10
|
+
import { ZoomSlider } from "ol/control";
|
|
11
|
+
import OLMap from "ol/Map";
|
|
12
|
+
const propTypes = {
|
|
18
13
|
map: PropTypes.instanceOf(OLMap).isRequired,
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The zoom delta applied on each click.
|
|
22
|
-
*/
|
|
23
14
|
delta: PropTypes.number,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Titles HTML attribtues for button.
|
|
27
|
-
*/
|
|
28
15
|
titles: PropTypes.shape({
|
|
29
16
|
zoomIn: PropTypes.string,
|
|
30
|
-
zoomOut: PropTypes.string
|
|
17
|
+
zoomOut: PropTypes.string
|
|
31
18
|
}),
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Children content of the zoom in button.
|
|
35
|
-
*/
|
|
36
19
|
zoomInChildren: PropTypes.node,
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Children content of the zoom out button.
|
|
40
|
-
*/
|
|
41
20
|
zoomOutChildren: PropTypes.node,
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Display a slider to zoom.
|
|
45
|
-
*/
|
|
46
|
-
zoomSlider: PropTypes.bool,
|
|
21
|
+
zoomSlider: PropTypes.bool
|
|
47
22
|
};
|
|
48
|
-
|
|
49
|
-
var defaultProps = {
|
|
23
|
+
const defaultProps = {
|
|
50
24
|
titles: {
|
|
51
|
-
zoomIn:
|
|
52
|
-
zoomOut:
|
|
25
|
+
zoomIn: "Zoom in",
|
|
26
|
+
zoomOut: "Zoom out"
|
|
53
27
|
},
|
|
54
|
-
zoomInChildren: React.createElement(
|
|
55
|
-
|
|
28
|
+
zoomInChildren: /* @__PURE__ */ React.createElement(FaPlus, {
|
|
29
|
+
focusable: false
|
|
30
|
+
}),
|
|
31
|
+
zoomOutChildren: /* @__PURE__ */ React.createElement(FaMinus, {
|
|
32
|
+
focusable: false
|
|
33
|
+
}),
|
|
56
34
|
zoomSlider: false,
|
|
57
|
-
delta: 1
|
|
35
|
+
delta: 1
|
|
58
36
|
};
|
|
59
|
-
|
|
60
|
-
var updateZoom = function (map, zoomAction) {
|
|
37
|
+
const updateZoom = (map, zoomAction) => {
|
|
61
38
|
map.getView().cancelAnimations();
|
|
62
|
-
|
|
63
|
-
|
|
39
|
+
const zoom = map.getView().getZoom();
|
|
64
40
|
map.getView().animate({ zoom: zoom + zoomAction });
|
|
65
41
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var other = rest;
|
|
80
|
-
|
|
81
|
-
var ref = useRef();
|
|
82
|
-
var ref$2 = useState();
|
|
83
|
-
var currentZoom = ref$2[0];
|
|
84
|
-
var setZoom = ref$2[1];
|
|
85
|
-
|
|
86
|
-
var zoomIn = useCallback(
|
|
87
|
-
function (evt) {
|
|
42
|
+
function Zoom({
|
|
43
|
+
map,
|
|
44
|
+
titles,
|
|
45
|
+
zoomInChildren,
|
|
46
|
+
zoomOutChildren,
|
|
47
|
+
zoomSlider,
|
|
48
|
+
delta,
|
|
49
|
+
...other
|
|
50
|
+
}) {
|
|
51
|
+
const ref = useRef();
|
|
52
|
+
const [currentZoom, setZoom] = useState();
|
|
53
|
+
const zoomIn = useCallback(
|
|
54
|
+
(evt) => {
|
|
88
55
|
if (!evt.which || evt.which === 13) {
|
|
89
56
|
updateZoom(map, delta);
|
|
90
57
|
}
|
|
91
58
|
},
|
|
92
59
|
[delta, map]
|
|
93
60
|
);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
function (evt) {
|
|
61
|
+
const zoomOut = useCallback(
|
|
62
|
+
(evt) => {
|
|
97
63
|
if (!evt.which || evt.which === 13) {
|
|
98
64
|
updateZoom(map, -delta);
|
|
99
65
|
}
|
|
100
66
|
},
|
|
101
67
|
[delta, map]
|
|
102
68
|
);
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
return (
|
|
106
|
-
currentZoom >=
|
|
107
|
-
map.getView().getConstrainedZoom(map.getView().getMaxZoom())
|
|
108
|
-
);
|
|
69
|
+
const zoomInDisabled = useMemo(() => {
|
|
70
|
+
return currentZoom >= map.getView().getConstrainedZoom(map.getView().getMaxZoom());
|
|
109
71
|
}, [currentZoom, map]);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return (
|
|
113
|
-
currentZoom <=
|
|
114
|
-
map.getView().getConstrainedZoom(map.getView().getMinZoom())
|
|
115
|
-
);
|
|
72
|
+
const zoomOutDisabled = useMemo(() => {
|
|
73
|
+
return currentZoom <= map.getView().getConstrainedZoom(map.getView().getMinZoom());
|
|
116
74
|
}, [currentZoom, map]);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/* Trigger zoom update to disable zooms on max and min */
|
|
120
|
-
var zoomListener = function () {
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
const zoomListener = () => {
|
|
121
77
|
return setZoom(map.getView().getZoom());
|
|
122
78
|
};
|
|
123
|
-
map.on(
|
|
124
|
-
|
|
125
|
-
var control;
|
|
79
|
+
map.on("moveend", zoomListener);
|
|
80
|
+
let control;
|
|
126
81
|
if (zoomSlider && ref.current) {
|
|
127
82
|
control = new ZoomSlider();
|
|
128
|
-
// We don't want to navigate to the zoom slider using TAB navigation.
|
|
129
83
|
control.element.firstElementChild.tabIndex = -1;
|
|
130
|
-
// Set the zoom slider in the custom control wrapper.
|
|
131
84
|
control.setTarget(ref.current);
|
|
132
85
|
map.addControl(control);
|
|
133
86
|
}
|
|
134
|
-
return
|
|
135
|
-
map.un(
|
|
87
|
+
return () => {
|
|
88
|
+
map.un("moveend", zoomListener);
|
|
136
89
|
if (control) {
|
|
137
90
|
map.removeControl(control);
|
|
138
91
|
}
|
|
139
92
|
};
|
|
140
93
|
}, [map, zoomSlider]);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
)
|
|
94
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
95
|
+
className: "rs-zooms-bar",
|
|
96
|
+
...other
|
|
97
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
98
|
+
type: "button",
|
|
99
|
+
tabIndex: 0,
|
|
100
|
+
className: "rs-zoom-in",
|
|
101
|
+
title: titles.zoomIn,
|
|
102
|
+
onClick: zoomIn,
|
|
103
|
+
onKeyPress: zoomIn,
|
|
104
|
+
disabled: zoomInDisabled
|
|
105
|
+
}, zoomInChildren), zoomSlider ? /* @__PURE__ */ React.createElement("div", {
|
|
106
|
+
className: "rs-zoomslider-wrapper",
|
|
107
|
+
ref
|
|
108
|
+
}) : null, /* @__PURE__ */ React.createElement("button", {
|
|
109
|
+
type: "button",
|
|
110
|
+
tabIndex: 0,
|
|
111
|
+
className: "rs-zoom-out",
|
|
112
|
+
title: titles.zoomOut,
|
|
113
|
+
onClick: zoomOut,
|
|
114
|
+
onKeyPress: zoomOut,
|
|
115
|
+
disabled: zoomOutDisabled
|
|
116
|
+
}, zoomOutChildren));
|
|
156
117
|
}
|
|
157
|
-
|
|
158
118
|
Zoom.propTypes = propTypes;
|
|
159
119
|
Zoom.defaultProps = defaultProps;
|
|
160
|
-
|
|
161
120
|
export default React.memo(Zoom);
|
|
162
|
-
|
|
163
|
-
//# sourceMappingURL=Zoom.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/Zoom/Zoom.js"],
|
|
4
|
+
"sourcesContent": ["import React, {\n useEffect,\n useRef,\n useCallback,\n useState,\n useMemo,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { FaPlus, FaMinus } from 'react-icons/fa';\nimport { ZoomSlider } from 'ol/control';\nimport OLMap from 'ol/Map';\n\nconst propTypes = {\n /**\n * An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\n map: PropTypes.instanceOf(OLMap).isRequired,\n\n /**\n * The zoom delta applied on each click.\n */\n delta: PropTypes.number,\n\n /**\n * Titles HTML attribtues for button.\n */\n titles: PropTypes.shape({\n zoomIn: PropTypes.string,\n zoomOut: PropTypes.string,\n }),\n\n /**\n * Children content of the zoom in button.\n */\n zoomInChildren: PropTypes.node,\n\n /**\n * Children content of the zoom out button.\n */\n zoomOutChildren: PropTypes.node,\n\n /**\n * Display a slider to zoom.\n */\n zoomSlider: PropTypes.bool,\n};\n\nconst defaultProps = {\n titles: {\n zoomIn: 'Zoom in',\n zoomOut: 'Zoom out',\n },\n zoomInChildren: <FaPlus focusable={false} />,\n zoomOutChildren: <FaMinus focusable={false} />,\n zoomSlider: false,\n delta: 1,\n};\n\nconst updateZoom = (map, zoomAction) => {\n map.getView().cancelAnimations();\n const zoom = map.getView().getZoom();\n\n map.getView().animate({ zoom: zoom + zoomAction });\n};\n\n/**\n * The Zoom component creates a zoom wrapper containing zoom-in and zoom-out buttons\n * and an optional [ol/ZoomSlider](https://openlayers.org/en/latest/apidoc/module-ol_control_ZoomSlider-ZoomSlider.html).\n */\nfunction Zoom({\n map,\n titles,\n zoomInChildren,\n zoomOutChildren,\n zoomSlider,\n delta,\n ...other\n}) {\n const ref = useRef();\n const [currentZoom, setZoom] = useState();\n\n const zoomIn = useCallback(\n (evt) => {\n if (!evt.which || evt.which === 13) {\n updateZoom(map, delta);\n }\n },\n [delta, map],\n );\n\n const zoomOut = useCallback(\n (evt) => {\n if (!evt.which || evt.which === 13) {\n updateZoom(map, -delta);\n }\n },\n [delta, map],\n );\n\n const zoomInDisabled = useMemo(() => {\n return (\n currentZoom >=\n map.getView().getConstrainedZoom(map.getView().getMaxZoom())\n );\n }, [currentZoom, map]);\n\n const zoomOutDisabled = useMemo(() => {\n return (\n currentZoom <=\n map.getView().getConstrainedZoom(map.getView().getMinZoom())\n );\n }, [currentZoom, map]);\n\n useEffect(() => {\n /* Trigger zoom update to disable zooms on max and min */\n const zoomListener = () => {\n return setZoom(map.getView().getZoom());\n };\n map.on('moveend', zoomListener);\n\n let control;\n if (zoomSlider && ref.current) {\n control = new ZoomSlider();\n // We don't want to navigate to the zoom slider using TAB navigation.\n control.element.firstElementChild.tabIndex = -1;\n // Set the zoom slider in the custom control wrapper.\n control.setTarget(ref.current);\n map.addControl(control);\n }\n return () => {\n map.un('moveend', zoomListener);\n if (control) {\n map.removeControl(control);\n }\n };\n }, [map, zoomSlider]);\n\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <div className=\"rs-zooms-bar\" {...other}>\n <button\n type=\"button\"\n tabIndex={0}\n className=\"rs-zoom-in\"\n title={titles.zoomIn}\n onClick={zoomIn}\n onKeyPress={zoomIn}\n disabled={zoomInDisabled}\n >\n {zoomInChildren}\n </button>\n {zoomSlider ? <div className=\"rs-zoomslider-wrapper\" ref={ref} /> : null}\n <button\n type=\"button\"\n tabIndex={0}\n className=\"rs-zoom-out\"\n title={titles.zoomOut}\n onClick={zoomOut}\n onKeyPress={zoomOut}\n disabled={zoomOutDisabled}\n >\n {zoomOutChildren}\n </button>\n </div>\n );\n}\n\nZoom.propTypes = propTypes;\nZoom.defaultProps = defaultProps;\n\nexport default React.memo(Zoom);\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/components/Zoom/index.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/Zoom/index.js"],
|
|
4
|
+
"sourcesContent": ["export { default } from './Zoom';\n"],
|
|
5
|
+
"mappings": "AAAA,wBAAwB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-spatial",
|
|
3
3
|
"description": "Components to build React map apps.",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3-beta.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@geops/geops-ui": "0.1.13",
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"canvas": "2.8.0",
|
|
45
45
|
"css-loader": "5.2.6",
|
|
46
46
|
"enzyme": "3.11.0",
|
|
47
|
+
"esbuild": "^0.15.6",
|
|
47
48
|
"eslint": "7.32.0",
|
|
48
49
|
"eslint-config-airbnb": "18.2.1",
|
|
49
50
|
"eslint-config-prettier": "8.3.0",
|
|
@@ -68,7 +69,8 @@
|
|
|
68
69
|
"jsts": "2.7.3",
|
|
69
70
|
"lint-staged": "11.2.0",
|
|
70
71
|
"mapbox-gl": "1.13.1",
|
|
71
|
-
"
|
|
72
|
+
"maplibre-gl": "2.4.0",
|
|
73
|
+
"mobility-toolbox-js": "2.0.0-beta.39",
|
|
72
74
|
"ol": "6.14.1",
|
|
73
75
|
"prettier": "2.4.1",
|
|
74
76
|
"proj4": "2.7.5",
|
|
@@ -94,7 +96,9 @@
|
|
|
94
96
|
"xml-beautifier": "0.5.0"
|
|
95
97
|
},
|
|
96
98
|
"scripts": {
|
|
97
|
-
"
|
|
99
|
+
"esbuild": "esbuild src/*.js src/**/*.js src/**/**/*.js src/**/**/**/*.js --target=chrome100 --outdir=build/ --loader:.js=jsx --sourcemap=external",
|
|
100
|
+
"buble": "buble --no modules,asyncAwait -i src -o build --objectAssign Object.assign --sourcemap",
|
|
101
|
+
"build": "yarn esbuild && find build -type f -name '*.test.*' -delete && rm -rf build/styleguidist && cp package.json README.md LICENSE build && cp -rf src/images build && cp -rf src/themes build",
|
|
98
102
|
"coverage": "yarn test --coverage --coverageDirectory=coverage",
|
|
99
103
|
"cp": "generact --root src/components",
|
|
100
104
|
"doc": "styleguidist build",
|
|
@@ -114,8 +118,9 @@
|
|
|
114
118
|
"browserslist": [
|
|
115
119
|
">0.2%",
|
|
116
120
|
"not dead",
|
|
117
|
-
"not
|
|
118
|
-
"not
|
|
121
|
+
"not op_mini all",
|
|
122
|
+
"not ie <= 11",
|
|
123
|
+
"not android < 5"
|
|
119
124
|
],
|
|
120
125
|
"eslintConfig": {
|
|
121
126
|
"env": {
|
package/propTypes.js
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
import PropTypes from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
arrivalTime: PropTypes.number, // time in milliseconds.
|
|
9
|
-
arrivalTimeWithDelay: PropTypes.number, // time in milliseconds with the delay included.
|
|
1
|
+
import PropTypes from "prop-types";
|
|
2
|
+
const STATE_BOARDING = "BOARDING";
|
|
3
|
+
const STATE_LEAVING = "LEAVING";
|
|
4
|
+
const station = PropTypes.shape({
|
|
5
|
+
arrivalDelay: PropTypes.number,
|
|
6
|
+
arrivalTime: PropTypes.number,
|
|
7
|
+
arrivalTimeWithDelay: PropTypes.number,
|
|
10
8
|
cancelled: PropTypes.bool,
|
|
11
9
|
coordinates: PropTypes.arrayOf(PropTypes.number),
|
|
12
|
-
departureDelay: PropTypes.number,
|
|
13
|
-
departureTime: PropTypes.number,
|
|
14
|
-
departureTimeWithDelay: PropTypes.number,
|
|
10
|
+
departureDelay: PropTypes.number,
|
|
11
|
+
departureTime: PropTypes.number,
|
|
12
|
+
departureTimeWithDelay: PropTypes.number,
|
|
15
13
|
noDropOff: PropTypes.bool,
|
|
16
14
|
noPickUp: PropTypes.bool,
|
|
17
15
|
stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
18
16
|
stationName: PropTypes.string,
|
|
19
17
|
wheelchairAccessible: PropTypes.bool,
|
|
20
|
-
state: PropTypes.oneOf([null, STATE_BOARDING, STATE_LEAVING])
|
|
18
|
+
state: PropTypes.oneOf([null, STATE_BOARDING, STATE_LEAVING])
|
|
21
19
|
});
|
|
22
|
-
|
|
23
|
-
var lineInfos = PropTypes.shape({
|
|
20
|
+
const lineInfos = PropTypes.shape({
|
|
24
21
|
backgroundColor: PropTypes.string,
|
|
25
22
|
bicyclesAllowed: PropTypes.bool,
|
|
26
23
|
color: PropTypes.string,
|
|
@@ -42,14 +39,11 @@ var lineInfos = PropTypes.shape({
|
|
|
42
39
|
shortName: PropTypes.string,
|
|
43
40
|
stations: PropTypes.arrayOf(station),
|
|
44
41
|
vehicleType: PropTypes.number,
|
|
45
|
-
wheelchairAccessible: PropTypes.bool
|
|
42
|
+
wheelchairAccessible: PropTypes.bool
|
|
46
43
|
});
|
|
47
|
-
|
|
48
44
|
export default {
|
|
49
|
-
lineInfos
|
|
50
|
-
station
|
|
51
|
-
STATE_BOARDING
|
|
52
|
-
STATE_LEAVING
|
|
45
|
+
lineInfos,
|
|
46
|
+
station,
|
|
47
|
+
STATE_BOARDING,
|
|
48
|
+
STATE_LEAVING
|
|
53
49
|
};
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=propTypes.js.map
|
package/propTypes.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/propTypes.js"],
|
|
4
|
+
"sourcesContent": ["import PropTypes from 'prop-types';\n\nconst STATE_BOARDING = 'BOARDING';\nconst STATE_LEAVING = 'LEAVING';\n\nconst station = PropTypes.shape({\n arrivalDelay: PropTypes.number, // time in milliseconds.\n arrivalTime: PropTypes.number, // time in milliseconds.\n arrivalTimeWithDelay: PropTypes.number, // time in milliseconds with the delay included.\n cancelled: PropTypes.bool,\n coordinates: PropTypes.arrayOf(PropTypes.number),\n departureDelay: PropTypes.number, // time in milliseconds.\n departureTime: PropTypes.number, // time in milliseconds.\n departureTimeWithDelay: PropTypes.number, // time in milliseconds with the delay included\n noDropOff: PropTypes.bool,\n noPickUp: PropTypes.bool,\n stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n stationName: PropTypes.string,\n wheelchairAccessible: PropTypes.bool,\n state: PropTypes.oneOf([null, STATE_BOARDING, STATE_LEAVING]),\n});\n\nconst lineInfos = PropTypes.shape({\n backgroundColor: PropTypes.string,\n bicyclesAllowed: PropTypes.bool,\n color: PropTypes.string,\n destination: PropTypes.string,\n feedsId: PropTypes.number,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n license: PropTypes.string,\n licenseNote: PropTypes.string,\n licenseUrl: PropTypes.string,\n longName: PropTypes.string,\n operatingInformations: PropTypes.object,\n operator: PropTypes.string,\n operatorTimeZone: PropTypes.string,\n operatorUrl: PropTypes.string,\n publisher: PropTypes.string,\n publisherTimeZone: PropTypes.string,\n publisherUrl: PropTypes.string,\n realTime: PropTypes.number,\n shortName: PropTypes.string,\n stations: PropTypes.arrayOf(station),\n vehicleType: PropTypes.number,\n wheelchairAccessible: PropTypes.bool,\n});\n\nexport default {\n lineInfos,\n station,\n STATE_BOARDING,\n STATE_LEAVING,\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,eAAe;AAEtB,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AAEtB,MAAM,UAAU,UAAU,MAAM;AAAA,EAC9B,cAAc,UAAU;AAAA,EACxB,aAAa,UAAU;AAAA,EACvB,sBAAsB,UAAU;AAAA,EAChC,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU,QAAQ,UAAU,MAAM;AAAA,EAC/C,gBAAgB,UAAU;AAAA,EAC1B,eAAe,UAAU;AAAA,EACzB,wBAAwB,UAAU;AAAA,EAClC,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACnE,aAAa,UAAU;AAAA,EACvB,sBAAsB,UAAU;AAAA,EAChC,OAAO,UAAU,MAAM,CAAC,MAAM,gBAAgB,aAAa,CAAC;AAC9D,CAAC;AAED,MAAM,YAAY,UAAU,MAAM;AAAA,EAChC,iBAAiB,UAAU;AAAA,EAC3B,iBAAiB,UAAU;AAAA,EAC3B,OAAO,UAAU;AAAA,EACjB,aAAa,UAAU;AAAA,EACvB,SAAS,UAAU;AAAA,EACnB,IAAI,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC5D,SAAS,UAAU;AAAA,EACnB,aAAa,UAAU;AAAA,EACvB,YAAY,UAAU;AAAA,EACtB,UAAU,UAAU;AAAA,EACpB,uBAAuB,UAAU;AAAA,EACjC,UAAU,UAAU;AAAA,EACpB,kBAAkB,UAAU;AAAA,EAC5B,aAAa,UAAU;AAAA,EACvB,WAAW,UAAU;AAAA,EACrB,mBAAmB,UAAU;AAAA,EAC7B,cAAc,UAAU;AAAA,EACxB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU,QAAQ,OAAO;AAAA,EACnC,aAAa,UAAU;AAAA,EACvB,sBAAsB,UAAU;AAClC,CAAC;AAED,eAAe;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/setupTests.js
CHANGED
package/setupTests.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/setupTests.js"],
|
|
4
|
+
"sourcesContent": ["global.URL.createObjectURL = jest.fn(() => {\n return 'fooblob';\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,IAAI,kBAAkB,KAAK,GAAG,MAAM;AACzC,SAAO;AACT,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/themes/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Themes
|
|
2
|
+
|
|
3
|
+
We are NOT a CSS library so we provide some default CSS helpers to help you start but feel free to use your own technology bootstrap or JSS or styled-compoennts.
|
|
4
|
+
|
|
5
|
+
## How to use
|
|
6
|
+
|
|
7
|
+
We provide a set of CSS variables and classes to help you start using `react-spatial` .
|
|
8
|
+
To use it just import the `index.scss` file of the `default` theme in your application:
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import 'react-spatial/themes/default/index.scss';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
If you want to override variables just import the `default/variables.css` and the default CSS files you want, there is one CSS file by component.
|
|
15
|
+
|
|
16
|
+
## Create a new theme
|
|
17
|
+
|
|
18
|
+
Just add a folder with an `index.scss` file.
|
|
19
|
+
|
|
20
|
+
Some rules must be followed:
|
|
21
|
+
|
|
22
|
+
- no positionning css for container.
|
|
23
|
+
- no size information without using CSS variable.
|
|
24
|
+
- use `display: flex` for container when possible.
|
|
25
|
+
|
|
26
|
+
Of course those rules must be adapted depending on the component.
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
@import '../../components/FilterButton/FilterButton.scss';
|
|
5
5
|
@import '../../components/FollowButton/FollowButton.scss';
|
|
6
6
|
@import '../../components/BaseLayerSwitcher/BaseLayerSwitcher.scss';
|
|
7
|
-
@import '../../components/BaseLayerToggler/BaseLayerToggler.scss';
|
|
8
7
|
@import '../../components/Geolocation/Geolocation.scss';
|
|
9
8
|
@import '../../components/LayerTree/LayerTree.scss';
|
|
10
9
|
@import '../../components/NorthArrow/NorthArrow.scss';
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
@import './index.scss';
|
|
5
5
|
@import '../../components/BaseLayerSwitcher/BaseLayerSwitcher.md.scss';
|
|
6
|
-
@import '../../components/BaseLayerToggler/BaseLayerToggler.md.scss';
|
|
7
6
|
@import '../../components/BasicMap/BasicMap.md.scss';
|
|
8
7
|
@import '../../components/CanvasSaveButton/CanvasSaveButton.md.scss';
|
|
9
8
|
@import '../../components/FeatureExportButton/FeatureExportButton.md.scss';
|
package/utils/GlobalsForOle.js
CHANGED
|
@@ -1,95 +1,94 @@
|
|
|
1
|
-
import OLVectorLayer from
|
|
2
|
-
import VectorSource from
|
|
3
|
-
import Control from
|
|
4
|
-
import Draw from
|
|
5
|
-
import Snap from
|
|
6
|
-
import Pointer from
|
|
7
|
-
import Select from
|
|
8
|
-
import Modify from
|
|
9
|
-
import Style from
|
|
10
|
-
import Fill from
|
|
11
|
-
import Stroke from
|
|
12
|
-
import Circle from
|
|
13
|
-
import Icon from
|
|
14
|
-
import RegularShape from
|
|
15
|
-
import Collection from
|
|
16
|
-
import Feature from
|
|
17
|
-
import Observable, { unByKey } from
|
|
18
|
-
import { getCenter } from
|
|
1
|
+
import OLVectorLayer from "ol/layer/Vector";
|
|
2
|
+
import VectorSource from "ol/source/Vector";
|
|
3
|
+
import Control from "ol/control/Control";
|
|
4
|
+
import Draw from "ol/interaction/Draw";
|
|
5
|
+
import Snap from "ol/interaction/Snap";
|
|
6
|
+
import Pointer from "ol/interaction/Pointer";
|
|
7
|
+
import Select from "ol/interaction/Select";
|
|
8
|
+
import Modify from "ol/interaction/Modify";
|
|
9
|
+
import Style from "ol/style/Style";
|
|
10
|
+
import Fill from "ol/style/Fill";
|
|
11
|
+
import Stroke from "ol/style/Stroke";
|
|
12
|
+
import Circle from "ol/style/Circle";
|
|
13
|
+
import Icon from "ol/style/Icon";
|
|
14
|
+
import RegularShape from "ol/style/RegularShape";
|
|
15
|
+
import Collection from "ol/Collection";
|
|
16
|
+
import Feature from "ol/Feature";
|
|
17
|
+
import Observable, { unByKey } from "ol/Observable";
|
|
18
|
+
import { getCenter } from "ol/extent";
|
|
19
19
|
import {
|
|
20
20
|
Point,
|
|
21
21
|
LineString,
|
|
22
22
|
Polygon,
|
|
23
23
|
MultiPoint,
|
|
24
24
|
MultiLineString,
|
|
25
|
-
MultiPolygon
|
|
26
|
-
} from
|
|
27
|
-
import LinearRing from
|
|
28
|
-
import { fromExtent } from
|
|
29
|
-
import * as events from
|
|
30
|
-
import * as condition from
|
|
31
|
-
import { OL3Parser } from
|
|
32
|
-
import { BufferOp } from
|
|
33
|
-
import { OverlayOp } from
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* This module create window.ol and window.jsts variables for ole editor.
|
|
37
|
-
*/
|
|
25
|
+
MultiPolygon
|
|
26
|
+
} from "ol/geom";
|
|
27
|
+
import LinearRing from "ol/geom/LinearRing";
|
|
28
|
+
import { fromExtent } from "ol/geom/Polygon";
|
|
29
|
+
import * as events from "ol/events";
|
|
30
|
+
import * as condition from "ol/events/condition";
|
|
31
|
+
import { OL3Parser } from "jsts/org/locationtech/jts/io";
|
|
32
|
+
import { BufferOp } from "jsts/org/locationtech/jts/operation/buffer";
|
|
33
|
+
import { OverlayOp } from "jsts/org/locationtech/jts/operation/overlay";
|
|
38
34
|
if (!window.ol) {
|
|
39
35
|
window.ol = {
|
|
40
|
-
Feature
|
|
41
|
-
Collection
|
|
36
|
+
Feature,
|
|
37
|
+
Collection,
|
|
42
38
|
layer: {
|
|
43
|
-
Vector: OLVectorLayer
|
|
39
|
+
Vector: OLVectorLayer
|
|
44
40
|
},
|
|
45
41
|
source: {
|
|
46
|
-
Vector: VectorSource
|
|
42
|
+
Vector: VectorSource
|
|
47
43
|
},
|
|
48
44
|
interaction: {
|
|
49
|
-
Draw
|
|
50
|
-
Snap
|
|
51
|
-
Pointer
|
|
52
|
-
Select
|
|
53
|
-
Modify
|
|
45
|
+
Draw,
|
|
46
|
+
Snap,
|
|
47
|
+
Pointer,
|
|
48
|
+
Select,
|
|
49
|
+
Modify
|
|
54
50
|
},
|
|
55
51
|
control: {
|
|
56
|
-
Control
|
|
52
|
+
Control
|
|
57
53
|
},
|
|
58
54
|
style: {
|
|
59
|
-
Style
|
|
60
|
-
Fill
|
|
61
|
-
Stroke
|
|
62
|
-
Circle
|
|
63
|
-
RegularShape
|
|
64
|
-
Icon
|
|
55
|
+
Style,
|
|
56
|
+
Fill,
|
|
57
|
+
Stroke,
|
|
58
|
+
Circle,
|
|
59
|
+
RegularShape,
|
|
60
|
+
Icon
|
|
65
61
|
},
|
|
66
62
|
geom: {
|
|
67
|
-
Point
|
|
68
|
-
LineString
|
|
69
|
-
Polygon
|
|
70
|
-
MultiPoint
|
|
71
|
-
MultiLineString
|
|
72
|
-
MultiPolygon
|
|
73
|
-
LinearRing
|
|
63
|
+
Point,
|
|
64
|
+
LineString,
|
|
65
|
+
Polygon,
|
|
66
|
+
MultiPoint,
|
|
67
|
+
MultiLineString,
|
|
68
|
+
MultiPolygon,
|
|
69
|
+
LinearRing
|
|
74
70
|
},
|
|
75
71
|
extent: {
|
|
76
|
-
getCenter
|
|
72
|
+
getCenter
|
|
77
73
|
},
|
|
78
|
-
Observable:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
Observable: {
|
|
75
|
+
...Observable,
|
|
76
|
+
unByKey
|
|
77
|
+
},
|
|
78
|
+
events: {
|
|
79
|
+
...events,
|
|
80
|
+
condition: {
|
|
81
|
+
...condition
|
|
82
|
+
}
|
|
83
|
+
}
|
|
82
84
|
};
|
|
83
85
|
window.ol.geom.Polygon.fromExtent = fromExtent;
|
|
84
86
|
}
|
|
85
|
-
|
|
86
87
|
if (!window.jsts) {
|
|
87
88
|
window.jsts = {
|
|
88
89
|
io: {
|
|
89
|
-
OL3Parser
|
|
90
|
+
OL3Parser
|
|
90
91
|
},
|
|
91
|
-
operation: { buffer: { BufferOp
|
|
92
|
+
operation: { buffer: { BufferOp }, overlay: { OverlayOp } }
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
|
-
|
|
95
|
-
//# sourceMappingURL=GlobalsForOle.js.map
|