react-spatial 2.0.0-beta.0 → 2.0.0-beta.2
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/README.md +5 -10
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.js +188 -107
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +2 -2
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.scss +6 -5
- package/components/BaseLayerSwitcher/index.js.map +2 -2
- package/components/BasicMap/BasicMap.js +116 -98
- package/components/BasicMap/BasicMap.js.map +2 -2
- package/components/BasicMap/index.js.map +2 -2
- package/components/CanvasSaveButton/CanvasSaveButton.js +448 -316
- package/components/CanvasSaveButton/CanvasSaveButton.js.map +2 -2
- package/components/CanvasSaveButton/CanvasSaveButton.md.scss +1 -1
- package/components/CanvasSaveButton/index.js.map +2 -2
- package/components/Copyright/Copyright.js +43 -35
- package/components/Copyright/Copyright.js.map +2 -2
- package/components/Copyright/index.js.map +2 -2
- package/components/FeatureExportButton/FeatureExportButton.js +35 -17
- package/components/FeatureExportButton/FeatureExportButton.js.map +2 -2
- package/components/FeatureExportButton/index.js.map +2 -2
- package/components/FitExtent/FitExtent.js +36 -18
- package/components/FitExtent/FitExtent.js.map +2 -2
- package/components/FitExtent/index.js.map +2 -2
- package/components/Geolocation/Geolocation.js +131 -92
- package/components/Geolocation/Geolocation.js.map +2 -2
- package/components/Geolocation/Geolocation.scss +7 -5
- package/components/Geolocation/index.js.map +2 -2
- package/components/LayerTree/LayerTree.js +361 -169
- package/components/LayerTree/LayerTree.js.map +2 -2
- package/components/LayerTree/LayerTree.scss +4 -6
- package/components/LayerTree/index.js.map +2 -2
- package/components/MousePosition/MousePosition.js +64 -33
- package/components/MousePosition/MousePosition.js.map +2 -2
- package/components/MousePosition/index.js.map +2 -2
- package/components/NorthArrow/NorthArrow.js +35 -19
- package/components/NorthArrow/NorthArrow.js.map +2 -2
- package/components/NorthArrow/index.js.map +2 -2
- package/components/Overlay/Overlay.js +100 -83
- package/components/Overlay/Overlay.js.map +2 -2
- package/components/Overlay/index.js.map +2 -2
- package/components/Permalink/Permalink.js +135 -90
- package/components/Permalink/Permalink.js.map +2 -2
- package/components/Permalink/index.js.map +2 -2
- package/components/Popup/Popup.js +134 -83
- package/components/Popup/Popup.js.map +2 -2
- package/components/Popup/Popup.md.scss +1 -0
- package/components/Popup/Popup.scss +3 -1
- package/components/Popup/index.js.map +2 -2
- package/components/ResizeHandler/ResizeHandler.js +51 -45
- package/components/ResizeHandler/ResizeHandler.js.map +2 -2
- package/components/ResizeHandler/index.js.map +2 -2
- package/components/RouteSchedule/RouteSchedule.js +218 -136
- package/components/RouteSchedule/RouteSchedule.js.map +2 -2
- package/components/RouteSchedule/RouteSchedule.md.scss +4 -2
- package/components/RouteSchedule/RouteSchedule.scss +12 -23
- package/components/RouteSchedule/index.js.map +2 -2
- package/components/ScaleLine/ScaleLine.js +11 -9
- package/components/ScaleLine/ScaleLine.js.map +2 -2
- package/components/ScaleLine/ScaleLine.scss +6 -4
- package/components/ScaleLine/index.js.map +2 -2
- package/components/StopsFinder/StopsFinder.js +141 -118
- package/components/StopsFinder/StopsFinder.js.map +2 -2
- package/components/StopsFinder/StopsFinderOption.js +11 -24
- package/components/StopsFinder/StopsFinderOption.js.map +2 -2
- package/components/StopsFinder/index.js.map +2 -2
- package/components/Zoom/Zoom.js +101 -62
- package/components/Zoom/Zoom.js.map +2 -2
- package/components/Zoom/Zoom.md.scss +3 -1
- package/components/Zoom/Zoom.scss +7 -5
- package/components/Zoom/index.js.map +2 -2
- package/images/geops_qr.png +0 -0
- package/package.json +81 -177
- package/propTypes.js +67 -0
- package/propTypes.js.map +7 -0
- package/setupTests.js +22 -0
- package/setupTests.js.map +7 -0
- package/themes/README.md +26 -0
- package/themes/default/components.scss +9 -13
- package/themes/default/examples.scss +20 -19
- package/themes/default/index.scss +3 -3
- package/themes/default/mixins.scss +7 -5
- package/themes/default/variables.scss +27 -25
- package/utils/GlobalsForOle.js +57 -57
- package/utils/GlobalsForOle.js.map +2 -2
- package/utils/KML.js +174 -49
- package/utils/KML.js.map +2 -2
- package/utils/Styles.js +7 -7
- package/utils/Styles.js.map +2 -2
- package/utils/getLayersAsFlatArray.js +14 -0
- package/utils/getLayersAsFlatArray.js.map +7 -0
- package/utils/getPolygonPattern.js.map +2 -2
- package/utils/timeUtils.js +11 -7
- package/utils/timeUtils.js.map +2 -2
- package/components/FilterButton/FilterButton.js +0 -66
- package/components/FilterButton/FilterButton.js.map +0 -7
- package/components/FilterButton/FilterButton.scss +0 -36
- package/components/FilterButton/index.js +0 -1
- package/components/FilterButton/index.js.map +0 -7
- package/components/FollowButton/FollowButton.js +0 -73
- package/components/FollowButton/FollowButton.js.map +0 -7
- package/components/FollowButton/FollowButton.scss +0 -36
- package/components/FollowButton/index.js +0 -1
- package/components/FollowButton/index.js.map +0 -7
- package/components/Search/Search.js +0 -166
- package/components/Search/Search.js.map +0 -7
- package/components/Search/Search.md.scss +0 -4
- package/components/Search/Search.scss +0 -78
- package/components/Search/SearchService.js +0 -48
- package/components/Search/SearchService.js.map +0 -7
- package/components/Search/engines/Engine.js +0 -19
- package/components/Search/engines/Engine.js.map +0 -7
- package/components/Search/engines/StopFinder.js +0 -30
- package/components/Search/engines/StopFinder.js.map +0 -7
- package/components/Search/index.js +0 -3
- package/components/Search/index.js.map +0 -7
- package/components/TrackerControl/TrackerControl.js +0 -116
- package/components/TrackerControl/TrackerControl.js.map +0 -7
- package/components/TrackerControl/TrackerControl.scss +0 -30
- package/components/TrackerControl/index.js +0 -1
- package/components/TrackerControl/index.js.map +0 -7
- package/images/FilterButton/filter.svg +0 -1
- package/images/FollowButton/follow.svg +0 -1
- package/images/baselayer/osm.baselayer.hot.png +0 -0
- package/images/baselayer/osm.baselayer.png +0 -0
- package/utils/KMLFormat.js +0 -69
- package/utils/KMLFormat.js.map +0 -7
|
@@ -1,77 +1,108 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
|
-
import { defaults as defaultInteractions } from "ol/interaction";
|
|
1
|
+
import OLCollection from "ol/Collection";
|
|
4
2
|
import { equals } from "ol/extent";
|
|
3
|
+
import { defaults as defaultInteractions } from "ol/interaction";
|
|
4
|
+
import Interaction from "ol/interaction/Interaction";
|
|
5
|
+
import Layer from "ol/layer/Layer";
|
|
5
6
|
import OLMap from "ol/Map";
|
|
6
|
-
import OLCollection from "ol/Collection";
|
|
7
|
-
import View from "ol/View";
|
|
8
7
|
import { unByKey } from "ol/Observable";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
8
|
+
import View from "ol/View";
|
|
9
|
+
import PropTypes from "prop-types";
|
|
10
|
+
import React, { PureComponent } from "react";
|
|
12
11
|
const propTypes = {
|
|
12
|
+
/** Map animation options */
|
|
13
13
|
animationOptions: PropTypes.shape({
|
|
14
14
|
center: PropTypes.arrayOf(PropTypes.number),
|
|
15
15
|
resolution: PropTypes.number,
|
|
16
16
|
zoom: PropTypes.number
|
|
17
17
|
}),
|
|
18
|
+
/** HTML aria-label. */
|
|
19
|
+
ariaLabel: PropTypes.string,
|
|
20
|
+
/** Center of the [ol/View](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html). */
|
|
18
21
|
center: PropTypes.arrayOf(PropTypes.number),
|
|
22
|
+
/** Class name of the map container */
|
|
19
23
|
className: PropTypes.string,
|
|
24
|
+
/** Map extent */
|
|
20
25
|
extent: PropTypes.arrayOf(PropTypes.number),
|
|
26
|
+
/**
|
|
27
|
+
* Optional options to pass on feature click. Passed to ol's 'getFeaturesAtPixel' method.
|
|
28
|
+
* https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html#getFeaturesAtPixel
|
|
29
|
+
*/
|
|
30
|
+
featuresClickOptions: PropTypes.shape({
|
|
31
|
+
checkWrapped: PropTypes.bool,
|
|
32
|
+
hitTolerance: PropTypes.number,
|
|
33
|
+
layerFilter: PropTypes.func
|
|
34
|
+
}),
|
|
35
|
+
/** Openlayers [fit options](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#fit) when extent is updated */
|
|
21
36
|
fitOptions: PropTypes.object,
|
|
37
|
+
/** Array of [ol/interaction](https://openlayers.org/en/latest/apidoc/module-ol_interaction_Interaction-Interaction.html). */
|
|
22
38
|
interactions: PropTypes.oneOfType([
|
|
23
39
|
PropTypes.arrayOf(PropTypes.instanceOf(Interaction)),
|
|
24
40
|
PropTypes.instanceOf(OLCollection)
|
|
25
41
|
]),
|
|
42
|
+
/** Array of Openlayers layers */
|
|
26
43
|
layers: PropTypes.arrayOf(PropTypes.instanceOf(Layer)),
|
|
44
|
+
/** An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html). */
|
|
27
45
|
map: PropTypes.instanceOf(OLMap),
|
|
46
|
+
/**
|
|
47
|
+
* Callback when a [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html) is clicked.
|
|
48
|
+
* @param {OLFeature[]} features An array of [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html).
|
|
49
|
+
* @param {ol.MapBrowserEvent} event The singleclick [ol/MapBrowserEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:singleclick).
|
|
50
|
+
*/
|
|
28
51
|
onFeaturesClick: PropTypes.func,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Callback when a [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html) is hovered.
|
|
54
|
+
* @param {OLFeature[]} features An array of [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html).
|
|
55
|
+
* @param {ol.MapBrowserEvent} event The pointermove [ol/MapBrowserEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:pointermove).
|
|
56
|
+
*/
|
|
34
57
|
onFeaturesHover: PropTypes.func,
|
|
58
|
+
/**
|
|
59
|
+
* Callback when the map was moved.
|
|
60
|
+
* @param {ol.MapEvent} event The movend [ol/MapEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:moveend).
|
|
61
|
+
*/
|
|
35
62
|
onMapMoved: PropTypes.func,
|
|
63
|
+
/** Map resolution */
|
|
36
64
|
resolution: PropTypes.number,
|
|
37
|
-
|
|
65
|
+
/** The style of the map. */
|
|
38
66
|
style: PropTypes.object,
|
|
39
|
-
|
|
67
|
+
/** The tabIndex of the map. */
|
|
68
|
+
tabIndex: PropTypes.number,
|
|
69
|
+
/** [ol/View](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html) constructor options */
|
|
40
70
|
viewOptions: PropTypes.shape({
|
|
41
|
-
minZoom: PropTypes.number,
|
|
42
|
-
maxZoom: PropTypes.number,
|
|
43
71
|
extent: PropTypes.array,
|
|
72
|
+
maxZoom: PropTypes.number,
|
|
73
|
+
minZoom: PropTypes.number,
|
|
44
74
|
projection: PropTypes.string
|
|
45
75
|
}),
|
|
76
|
+
/** Map zoom level */
|
|
46
77
|
zoom: PropTypes.number
|
|
47
78
|
};
|
|
48
79
|
const defaultProps = {
|
|
49
80
|
animationOptions: void 0,
|
|
81
|
+
ariaLabel: "map",
|
|
50
82
|
center: [0, 0],
|
|
51
83
|
className: "rs-map",
|
|
52
84
|
extent: void 0,
|
|
85
|
+
featuresClickOptions: {
|
|
86
|
+
hitTolerance: 0
|
|
87
|
+
},
|
|
53
88
|
fitOptions: {
|
|
54
89
|
duration: 1e3,
|
|
55
|
-
|
|
56
|
-
|
|
90
|
+
maxZoom: 23,
|
|
91
|
+
padding: [20, 20, 20, 20]
|
|
57
92
|
},
|
|
58
|
-
style: void 0,
|
|
59
93
|
interactions: null,
|
|
60
94
|
layers: [],
|
|
61
95
|
map: null,
|
|
62
96
|
onFeaturesClick: void 0,
|
|
63
|
-
featuresClickOptions: {
|
|
64
|
-
hitTolerance: 0
|
|
65
|
-
},
|
|
66
97
|
onFeaturesHover: void 0,
|
|
67
98
|
onMapMoved: void 0,
|
|
68
99
|
resolution: void 0,
|
|
100
|
+
style: void 0,
|
|
69
101
|
tabIndex: void 0,
|
|
70
|
-
ariaLabel: "map",
|
|
71
102
|
viewOptions: {
|
|
72
|
-
minZoom: 0,
|
|
73
|
-
maxZoom: 22,
|
|
74
103
|
extent: void 0,
|
|
104
|
+
maxZoom: 22,
|
|
105
|
+
minZoom: 0,
|
|
75
106
|
projection: "EPSG:3857"
|
|
76
107
|
},
|
|
77
108
|
zoom: 1
|
|
@@ -79,7 +110,7 @@ const defaultProps = {
|
|
|
79
110
|
class BasicMap extends PureComponent {
|
|
80
111
|
constructor(props) {
|
|
81
112
|
super(props);
|
|
82
|
-
const {
|
|
113
|
+
const { interactions, map } = this.props;
|
|
83
114
|
this.map = map || new OLMap({
|
|
84
115
|
controls: [],
|
|
85
116
|
interactions: interactions || defaultInteractions({
|
|
@@ -90,17 +121,16 @@ class BasicMap extends PureComponent {
|
|
|
90
121
|
this.state = {
|
|
91
122
|
node: null
|
|
92
123
|
};
|
|
93
|
-
this.layers = [];
|
|
94
124
|
this.moveEndRef = null;
|
|
95
125
|
this.singleClickRef = null;
|
|
96
126
|
this.pointerMoveRef = null;
|
|
97
127
|
this.setNode = this.setNode.bind(this);
|
|
98
128
|
}
|
|
99
129
|
componentDidMount() {
|
|
100
|
-
const {
|
|
130
|
+
const { center, extent, layers, resolution, viewOptions, zoom } = this.props;
|
|
101
131
|
const { node } = this.state;
|
|
102
132
|
this.map.setTarget(node);
|
|
103
|
-
this.map.setView(new View({ ...viewOptions, center,
|
|
133
|
+
this.map.setView(new View({ ...viewOptions, center, resolution, zoom }));
|
|
104
134
|
const viewPort = this.map.getViewport();
|
|
105
135
|
viewPort.style.touchAction = "none";
|
|
106
136
|
viewPort.style.msTouchAction = "none";
|
|
@@ -120,15 +150,21 @@ class BasicMap extends PureComponent {
|
|
|
120
150
|
extent,
|
|
121
151
|
fitOptions,
|
|
122
152
|
layers,
|
|
153
|
+
onFeaturesClick,
|
|
154
|
+
onFeaturesHover,
|
|
155
|
+
onMapMoved,
|
|
123
156
|
resolution,
|
|
124
157
|
viewOptions,
|
|
125
|
-
zoom
|
|
126
|
-
onMapMoved,
|
|
127
|
-
onFeaturesClick,
|
|
128
|
-
onFeaturesHover
|
|
158
|
+
zoom
|
|
129
159
|
} = this.props;
|
|
130
160
|
const { node } = this.state;
|
|
131
161
|
if (prevState.node !== node) {
|
|
162
|
+
if (zoom) {
|
|
163
|
+
this.map.getView().setZoom(zoom);
|
|
164
|
+
}
|
|
165
|
+
if (resolution) {
|
|
166
|
+
this.map.getView().setResolution(resolution);
|
|
167
|
+
}
|
|
132
168
|
this.map.setTarget(node);
|
|
133
169
|
if (!prevState.node && node && extent) {
|
|
134
170
|
this.map.getView().fit(extent);
|
|
@@ -176,48 +212,15 @@ class BasicMap extends PureComponent {
|
|
|
176
212
|
componentWillUnmount() {
|
|
177
213
|
unByKey([this.moveEndRef, this.singleClickRef, this.pointerMoveRef]);
|
|
178
214
|
}
|
|
179
|
-
setNode(node) {
|
|
180
|
-
this.setState({ node });
|
|
181
|
-
}
|
|
182
|
-
setLayers(layers = [], prevLayers = []) {
|
|
183
|
-
for (let i = 0; i < prevLayers.length; i += 1) {
|
|
184
|
-
this.terminateLayer(prevLayers[i]);
|
|
185
|
-
}
|
|
186
|
-
for (let i = 0; i < layers.length; i += 1) {
|
|
187
|
-
this.initLayer(layers[i]);
|
|
188
|
-
}
|
|
189
|
-
this.layers = layers;
|
|
190
|
-
}
|
|
191
215
|
initLayer(layer) {
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
if (layer.init) {
|
|
196
|
-
layer.init(this.map);
|
|
216
|
+
if (!this.map?.getLayers()?.getArray()?.includes(layer)) {
|
|
217
|
+
this.map.addLayer(layer);
|
|
197
218
|
}
|
|
198
|
-
|
|
199
|
-
this.map.addLayer(layer.olLayer);
|
|
200
|
-
}
|
|
201
|
-
const layers = layer.children || [];
|
|
219
|
+
const layers = layer.get("children") || layer.children || [];
|
|
202
220
|
for (let i = 0; i < layers.length; i += 1) {
|
|
203
221
|
this.initLayer(layers[i]);
|
|
204
222
|
}
|
|
205
223
|
}
|
|
206
|
-
terminateLayer(layer) {
|
|
207
|
-
const layers = layer.children || [];
|
|
208
|
-
for (let i = 0; i < layers.length; i += 1) {
|
|
209
|
-
this.terminateLayer(layers[i]);
|
|
210
|
-
}
|
|
211
|
-
if (layer.olLayer && this.map.getLayers() && this.map.getLayers().getArray().includes(layer.olLayer)) {
|
|
212
|
-
this.map.removeLayer(layer.olLayer);
|
|
213
|
-
}
|
|
214
|
-
if (layer.terminate) {
|
|
215
|
-
layer.terminate(this.map);
|
|
216
|
-
}
|
|
217
|
-
if (layer.detachFromMap) {
|
|
218
|
-
layer.detachFromMap(this.map);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
224
|
listenMoveEnd() {
|
|
222
225
|
const { onMapMoved } = this.props;
|
|
223
226
|
unByKey(this.moveEndRef);
|
|
@@ -228,8 +231,19 @@ class BasicMap extends PureComponent {
|
|
|
228
231
|
return onMapMoved(evt);
|
|
229
232
|
});
|
|
230
233
|
}
|
|
234
|
+
listenPointerMove() {
|
|
235
|
+
const { onFeaturesHover } = this.props;
|
|
236
|
+
unByKey(this.pointerMoveRef);
|
|
237
|
+
if (!onFeaturesHover) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
this.pointerMoveRef = this.map.on("pointermove", (evt) => {
|
|
241
|
+
const features = evt.map.getFeaturesAtPixel(evt.pixel);
|
|
242
|
+
onFeaturesHover(features || [], evt);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
231
245
|
listenSingleClick() {
|
|
232
|
-
const {
|
|
246
|
+
const { featuresClickOptions, onFeaturesClick } = this.props;
|
|
233
247
|
unByKey(this.singleClickRef);
|
|
234
248
|
if (!onFeaturesClick) {
|
|
235
249
|
return;
|
|
@@ -242,35 +256,39 @@ class BasicMap extends PureComponent {
|
|
|
242
256
|
onFeaturesClick(features || [], evt);
|
|
243
257
|
});
|
|
244
258
|
}
|
|
245
|
-
listenPointerMove() {
|
|
246
|
-
const { onFeaturesHover } = this.props;
|
|
247
|
-
unByKey(this.pointerMoveRef);
|
|
248
|
-
if (!onFeaturesHover) {
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
this.pointerMoveRef = this.map.on("pointermove", (evt) => {
|
|
252
|
-
const features = evt.map.getFeaturesAtPixel(evt.pixel);
|
|
253
|
-
onFeaturesHover(features || [], evt);
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
259
|
render() {
|
|
257
|
-
const {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
maxHeightBrkpts: null,
|
|
268
|
-
maxWidthBrkpts: null,
|
|
269
|
-
observe: node,
|
|
270
|
-
onResize: () => {
|
|
271
|
-
this.map.updateSize();
|
|
260
|
+
const { ariaLabel, className, style, tabIndex } = this.props;
|
|
261
|
+
return /* @__PURE__ */ React.createElement(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
"aria-label": ariaLabel,
|
|
265
|
+
className,
|
|
266
|
+
ref: this.setNode,
|
|
267
|
+
role: "presentation",
|
|
268
|
+
style,
|
|
269
|
+
tabIndex
|
|
272
270
|
}
|
|
273
|
-
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
setLayers(layers = [], prevLayers = []) {
|
|
274
|
+
for (let i = 0; i < prevLayers.length; i += 1) {
|
|
275
|
+
this.terminateLayer(prevLayers[i]);
|
|
276
|
+
}
|
|
277
|
+
for (let i = 0; i < layers.length; i += 1) {
|
|
278
|
+
this.initLayer(layers[i]);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
setNode(node) {
|
|
282
|
+
this.setState({ node });
|
|
283
|
+
}
|
|
284
|
+
terminateLayer(layer) {
|
|
285
|
+
const layers = layer.get("children") || layer.children || [];
|
|
286
|
+
for (let i = 0; i < layers.length; i += 1) {
|
|
287
|
+
this.terminateLayer(layers[i]);
|
|
288
|
+
}
|
|
289
|
+
if (this.map?.getLayers()?.getArray()?.includes(layer)) {
|
|
290
|
+
this.map.removeLayer(layer);
|
|
291
|
+
}
|
|
274
292
|
}
|
|
275
293
|
}
|
|
276
294
|
BasicMap.propTypes = propTypes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/BasicMap/BasicMap.js"],
|
|
4
|
-
"sourcesContent": ["import React, { PureComponent } from 'react';\nimport PropTypes from 'prop-types';\nimport { defaults as defaultInteractions } from 'ol/interaction';\nimport { equals } from 'ol/extent';\nimport OLMap from 'ol/Map';\nimport OLCollection from 'ol/Collection';\nimport View from 'ol/View';\nimport { unByKey } from 'ol/Observable';\nimport Interaction from 'ol/interaction/Interaction';\nimport { Layer } from 'mobility-toolbox-js/ol';\nimport ResizeHandler from '../ResizeHandler';\n\nconst propTypes = {\n /** Map animation options */\n animationOptions: PropTypes.shape({\n center: PropTypes.arrayOf(PropTypes.number),\n resolution: PropTypes.number,\n zoom: PropTypes.number,\n }),\n\n /** Center of the [ol/View](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html). */\n center: PropTypes.arrayOf(PropTypes.number),\n\n /** Class name of the map container */\n className: PropTypes.string,\n\n /** Map extent */\n extent: PropTypes.arrayOf(PropTypes.number),\n\n /** Openlayers [fit options](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#fit) when extent is updated */\n fitOptions: PropTypes.object,\n\n /** Array of [ol/interaction](https://openlayers.org/en/latest/apidoc/module-ol_interaction_Interaction-Interaction.html). */\n interactions: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.instanceOf(Interaction)),\n PropTypes.instanceOf(OLCollection),\n ]),\n\n /** Array of [mobility-toolbox-js layers](https://mobility-toolbox-js.geops.io/api/identifiers%20html#ol-layers) to display. */\n layers: PropTypes.arrayOf(PropTypes.instanceOf(Layer)),\n\n /** An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html). */\n map: PropTypes.instanceOf(OLMap),\n\n /**\n * Callback when a [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html) is clicked.\n * @param {OLFeature[]} features An array of [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html).\n * @param {ol.MapBrowserEvent} event The singleclick [ol/MapBrowserEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:singleclick).\n */\n onFeaturesClick: PropTypes.func,\n\n /**\n * Optional options to pass on feature click. Passed to ol's 'getFeaturesAtPixel' method.\n * https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html#getFeaturesAtPixel\n */\n featuresClickOptions: PropTypes.shape({\n layerFilter: PropTypes.func,\n hitTolerance: PropTypes.number,\n checkWrapped: PropTypes.bool,\n }),\n\n /**\n * Callback when a [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html) is hovered.\n * @param {OLFeature[]} features An array of [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html).\n * @param {ol.MapBrowserEvent} event The pointermove [ol/MapBrowserEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:pointermove).\n */\n onFeaturesHover: PropTypes.func,\n\n /**\n * Callback when the map was moved.\n * @param {ol.MapEvent} event The movend [ol/MapEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:moveend).\n */\n onMapMoved: PropTypes.func,\n\n /** Map resolution */\n resolution: PropTypes.number,\n\n /** The tabIndex of the map. */\n tabIndex: PropTypes.number,\n\n /** The style of the map. */\n style: PropTypes.object,\n\n /** HTML aria-label. */\n ariaLabel: PropTypes.string,\n\n /** [ol/View](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html) constructor options */\n viewOptions: PropTypes.shape({\n minZoom: PropTypes.number,\n maxZoom: PropTypes.number,\n extent: PropTypes.array,\n projection: PropTypes.string,\n }),\n\n /** Map zoom level */\n zoom: PropTypes.number,\n};\n\nconst defaultProps = {\n animationOptions: undefined,\n center: [0, 0],\n className: 'rs-map',\n extent: undefined,\n fitOptions: {\n duration: 1000,\n padding: [20, 20, 20, 20],\n maxZoom: 23,\n },\n style: undefined,\n interactions: null,\n layers: [],\n map: null,\n onFeaturesClick: undefined,\n featuresClickOptions: {\n hitTolerance: 0,\n },\n onFeaturesHover: undefined,\n onMapMoved: undefined,\n resolution: undefined,\n tabIndex: undefined,\n ariaLabel: 'map',\n viewOptions: {\n minZoom: 0,\n maxZoom: 22,\n extent: undefined,\n projection: 'EPSG:3857',\n },\n zoom: 1,\n};\n\n/**\n * The BasicMap component renders an [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n *\n * The map's view is created with the following parameters for the view:\n * - projection: 'EPSG:3857'\n * - zoom: 0\n * - minZoom: 0\n * - maxZoom: 22\n *\n * These options can be overridden using the viewOptions property.\n */\nclass BasicMap extends PureComponent {\n constructor(props) {\n super(props);\n const { map, interactions } = this.props;\n\n this.map =\n map ||\n new OLMap({\n controls: [],\n interactions:\n interactions ||\n defaultInteractions({\n altShiftDragRotate: false,\n pinchRotate: false,\n }),\n });\n\n this.state = {\n node: null,\n };\n\n this.layers = [];\n this.moveEndRef = null;\n this.singleClickRef = null;\n this.pointerMoveRef = null;\n this.setNode = this.setNode.bind(this);\n }\n\n componentDidMount() {\n const { layers, extent, viewOptions, center, zoom, resolution } =\n this.props;\n const { node } = this.state;\n this.map.setTarget(node);\n\n // We set the view here otherwise the map is not correctly zoomed.\n this.map.setView(new View({ ...viewOptions, center, zoom, resolution }));\n\n // // Since ol 6.1.0 touch-action is set to auto and creates a bad navigation experience on mobile,\n // // so we have to force it to none for mobile.\n // // https://github.com/openlayers/openlayers/pull/10187/files\n const viewPort = this.map.getViewport();\n viewPort.style.touchAction = 'none';\n viewPort.style.msTouchAction = 'none';\n viewPort.setAttribute('touch-action', 'none');\n\n // Fit only work if the map has a size.\n if (this.map.getSize() && extent) {\n this.map.getView().fit(extent);\n }\n\n this.setLayers(layers);\n this.listenMoveEnd();\n this.listenSingleClick();\n this.listenPointerMove();\n }\n\n componentDidUpdate(prevProps, prevState) {\n const {\n animationOptions,\n center,\n extent,\n fitOptions,\n layers,\n resolution,\n viewOptions,\n zoom,\n onMapMoved,\n onFeaturesClick,\n onFeaturesHover,\n } = this.props;\n const { node } = this.state;\n\n if (prevState.node !== node) {\n this.map.setTarget(node);\n\n // When the node is set we reinitialize the extent with the extent property.\n if (!prevState.node && node && extent) {\n this.map.getView().fit(extent);\n }\n }\n\n if (prevProps.layers !== layers) {\n this.setLayers(layers, prevProps.layers);\n }\n\n // Creates a new view if necessary before updating the others prop.\n if (\n viewOptions &&\n JSON.stringify(viewOptions) !== JSON.stringify(prevProps.viewOptions)\n ) {\n // Re-create a view, ol doesn't provide any method to setExtent of view.\n this.map.setView(\n new View({\n ...viewOptions,\n center,\n resolution,\n zoom,\n }),\n );\n }\n\n const view = this.map.getView();\n\n if (animationOptions && prevProps.animationOptions !== animationOptions) {\n view.animate(animationOptions);\n }\n\n if (prevProps.center !== center) {\n view.setCenter(center);\n }\n\n if (zoom !== prevProps.zoom) {\n view.setZoom(zoom);\n }\n\n if (resolution !== prevProps.resolution) {\n view.setResolution(resolution);\n }\n\n if (extent && !equals(extent, prevProps.extent || [])) {\n view.fit(extent, fitOptions);\n }\n\n if (onMapMoved !== prevProps.onMapMoved) {\n this.listenMoveEnd();\n }\n\n if (onFeaturesClick !== prevProps.onFeaturesClick) {\n this.listenSingleClick();\n }\n\n if (onFeaturesHover !== prevProps.onFeaturesHover) {\n this.listenPointerMove();\n }\n }\n\n componentWillUnmount() {\n unByKey([this.moveEndRef, this.singleClickRef, this.pointerMoveRef]);\n }\n\n setNode(node) {\n this.setState({ node });\n }\n\n setLayers(layers = [], prevLayers = []) {\n for (let i = 0; i < prevLayers.length; i += 1) {\n this.terminateLayer(prevLayers[i]);\n }\n for (let i = 0; i < layers.length; i += 1) {\n this.initLayer(layers[i]);\n }\n this.layers = layers;\n }\n\n initLayer(layer) {\n if (layer.attachToMap) {\n layer.attachToMap(this.map);\n }\n\n if (layer.init) {\n layer.init(this.map);\n }\n\n if (\n layer.olLayer &&\n this.map.getLayers() &&\n !this.map.getLayers().getArray().includes(layer.olLayer)\n ) {\n this.map.addLayer(layer.olLayer);\n }\n const layers = layer.children || [];\n for (let i = 0; i < layers.length; i += 1) {\n this.initLayer(layers[i]);\n }\n }\n\n terminateLayer(layer) {\n const layers = layer.children || [];\n for (let i = 0; i < layers.length; i += 1) {\n this.terminateLayer(layers[i]);\n }\n\n if (\n layer.olLayer &&\n this.map.getLayers() &&\n this.map.getLayers().getArray().includes(layer.olLayer)\n ) {\n this.map.removeLayer(layer.olLayer);\n }\n\n if (layer.terminate) {\n layer.terminate(this.map);\n }\n\n if (layer.detachFromMap) {\n layer.detachFromMap(this.map);\n }\n }\n\n listenMoveEnd() {\n const { onMapMoved } = this.props;\n unByKey(this.moveEndRef);\n\n if (!onMapMoved) {\n return;\n }\n\n this.moveEndRef = this.map.on('moveend', (evt) => {\n return onMapMoved(evt);\n });\n }\n\n listenSingleClick() {\n const { onFeaturesClick, featuresClickOptions } = this.props;\n unByKey(this.singleClickRef);\n\n if (!onFeaturesClick) {\n return;\n }\n\n this.singleClickRef = this.map.on('singleclick', (evt) => {\n const features = evt.map.getFeaturesAtPixel(\n evt.pixel,\n featuresClickOptions,\n );\n onFeaturesClick(features || [], evt);\n });\n }\n\n listenPointerMove() {\n const { onFeaturesHover } = this.props;\n unByKey(this.pointerMoveRef);\n\n if (!onFeaturesHover) {\n return;\n }\n\n this.pointerMoveRef = this.map.on('pointermove', (evt) => {\n const features = evt.map.getFeaturesAtPixel(evt.pixel);\n onFeaturesHover(features || [], evt);\n });\n }\n\n render() {\n const { className, tabIndex, ariaLabel, style } = this.props;\n const { node } = this.state;\n return (\n <div\n className={className}\n ref={this.setNode}\n role=\"presentation\"\n aria-label={ariaLabel}\n tabIndex={tabIndex}\n style={style}\n >\n <ResizeHandler\n maxHeightBrkpts={null}\n maxWidthBrkpts={null}\n observe={node}\n onResize={() => {\n this.map.updateSize();\n }}\n />\n </div>\n );\n }\n}\n\nBasicMap.propTypes = propTypes;\nBasicMap.defaultProps = defaultProps;\n\nexport default BasicMap;\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,
|
|
4
|
+
"sourcesContent": ["import OLCollection from \"ol/Collection\";\nimport { equals } from \"ol/extent\";\nimport { defaults as defaultInteractions } from \"ol/interaction\";\nimport Interaction from \"ol/interaction/Interaction\";\nimport Layer from \"ol/layer/Layer\";\nimport OLMap from \"ol/Map\";\nimport { unByKey } from \"ol/Observable\";\nimport View from \"ol/View\";\nimport PropTypes from \"prop-types\";\nimport React, { PureComponent } from \"react\";\n\nconst propTypes = {\n /** Map animation options */\n animationOptions: PropTypes.shape({\n center: PropTypes.arrayOf(PropTypes.number),\n resolution: PropTypes.number,\n zoom: PropTypes.number,\n }),\n\n /** HTML aria-label. */\n ariaLabel: PropTypes.string,\n\n /** Center of the [ol/View](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html). */\n center: PropTypes.arrayOf(PropTypes.number),\n\n /** Class name of the map container */\n className: PropTypes.string,\n\n /** Map extent */\n extent: PropTypes.arrayOf(PropTypes.number),\n\n /**\n * Optional options to pass on feature click. Passed to ol's 'getFeaturesAtPixel' method.\n * https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html#getFeaturesAtPixel\n */\n featuresClickOptions: PropTypes.shape({\n checkWrapped: PropTypes.bool,\n hitTolerance: PropTypes.number,\n layerFilter: PropTypes.func,\n }),\n\n /** Openlayers [fit options](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#fit) when extent is updated */\n fitOptions: PropTypes.object,\n\n /** Array of [ol/interaction](https://openlayers.org/en/latest/apidoc/module-ol_interaction_Interaction-Interaction.html). */\n interactions: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.instanceOf(Interaction)),\n PropTypes.instanceOf(OLCollection),\n ]),\n\n /** Array of Openlayers layers */\n layers: PropTypes.arrayOf(PropTypes.instanceOf(Layer)),\n\n /** An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html). */\n map: PropTypes.instanceOf(OLMap),\n\n /**\n * Callback when a [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html) is clicked.\n * @param {OLFeature[]} features An array of [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html).\n * @param {ol.MapBrowserEvent} event The singleclick [ol/MapBrowserEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:singleclick).\n */\n onFeaturesClick: PropTypes.func,\n\n /**\n * Callback when a [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html) is hovered.\n * @param {OLFeature[]} features An array of [ol/Feature](https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html).\n * @param {ol.MapBrowserEvent} event The pointermove [ol/MapBrowserEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:pointermove).\n */\n onFeaturesHover: PropTypes.func,\n\n /**\n * Callback when the map was moved.\n * @param {ol.MapEvent} event The movend [ol/MapEvent](https://openlayers.org/en/latest/apidoc/module-ol_MapBrowserEvent-MapBrowserEvent.html#event:moveend).\n */\n onMapMoved: PropTypes.func,\n\n /** Map resolution */\n resolution: PropTypes.number,\n\n /** The style of the map. */\n style: PropTypes.object,\n\n /** The tabIndex of the map. */\n tabIndex: PropTypes.number,\n\n /** [ol/View](https://openlayers.org/en/latest/apidoc/module-ol_View-View.html) constructor options */\n viewOptions: PropTypes.shape({\n extent: PropTypes.array,\n maxZoom: PropTypes.number,\n minZoom: PropTypes.number,\n projection: PropTypes.string,\n }),\n\n /** Map zoom level */\n zoom: PropTypes.number,\n};\n\nconst defaultProps = {\n animationOptions: undefined,\n ariaLabel: \"map\",\n center: [0, 0],\n className: \"rs-map\",\n extent: undefined,\n featuresClickOptions: {\n hitTolerance: 0,\n },\n fitOptions: {\n duration: 1000,\n maxZoom: 23,\n padding: [20, 20, 20, 20],\n },\n interactions: null,\n layers: [],\n map: null,\n onFeaturesClick: undefined,\n onFeaturesHover: undefined,\n onMapMoved: undefined,\n resolution: undefined,\n style: undefined,\n tabIndex: undefined,\n viewOptions: {\n extent: undefined,\n maxZoom: 22,\n minZoom: 0,\n projection: \"EPSG:3857\",\n },\n zoom: 1,\n};\n\n/**\n * The BasicMap component renders an [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n *\n * The map's view is created with the following parameters for the view:\n * - projection: 'EPSG:3857'\n * - zoom: 0\n * - minZoom: 0\n * - maxZoom: 22\n *\n * These options can be overridden using the viewOptions property.\n */\nclass BasicMap extends PureComponent {\n constructor(props) {\n super(props);\n const { interactions, map } = this.props;\n\n this.map =\n map ||\n new OLMap({\n controls: [],\n interactions:\n interactions ||\n defaultInteractions({\n altShiftDragRotate: false,\n pinchRotate: false,\n }),\n });\n\n this.state = {\n node: null,\n };\n\n this.moveEndRef = null;\n this.singleClickRef = null;\n this.pointerMoveRef = null;\n this.setNode = this.setNode.bind(this);\n }\n\n componentDidMount() {\n const { center, extent, layers, resolution, viewOptions, zoom } =\n this.props;\n const { node } = this.state;\n this.map.setTarget(node);\n\n // We set the view here otherwise the map is not correctly zoomed.\n this.map.setView(new View({ ...viewOptions, center, resolution, zoom }));\n\n // // Since ol 6.1.0 touch-action is set to auto and creates a bad navigation experience on mobile,\n // // so we have to force it to none for mobile.\n // // https://github.com/openlayers/openlayers/pull/10187/files\n const viewPort = this.map.getViewport();\n viewPort.style.touchAction = \"none\";\n viewPort.style.msTouchAction = \"none\";\n viewPort.setAttribute(\"touch-action\", \"none\");\n\n // Fit only work if the map has a size.\n if (this.map.getSize() && extent) {\n this.map.getView().fit(extent);\n }\n\n this.setLayers(layers);\n this.listenMoveEnd();\n this.listenSingleClick();\n this.listenPointerMove();\n }\n\n componentDidUpdate(prevProps, prevState) {\n const {\n animationOptions,\n center,\n extent,\n fitOptions,\n layers,\n onFeaturesClick,\n onFeaturesHover,\n onMapMoved,\n resolution,\n viewOptions,\n zoom,\n } = this.props;\n const { node } = this.state;\n\n if (prevState.node !== node) {\n if (zoom) {\n this.map.getView().setZoom(zoom);\n }\n\n if (resolution) {\n this.map.getView().setResolution(resolution);\n }\n this.map.setTarget(node);\n\n // When the node is set we reinitialize the extent with the extent property.\n if (!prevState.node && node && extent) {\n this.map.getView().fit(extent);\n }\n }\n\n if (prevProps.layers !== layers) {\n this.setLayers(layers, prevProps.layers);\n }\n\n // Creates a new view if necessary before updating the others prop.\n if (\n viewOptions &&\n JSON.stringify(viewOptions) !== JSON.stringify(prevProps.viewOptions)\n ) {\n // Re-create a view, ol doesn't provide any method to setExtent of view.\n this.map.setView(\n new View({\n ...viewOptions,\n center,\n resolution,\n zoom,\n }),\n );\n }\n\n const view = this.map.getView();\n\n if (animationOptions && prevProps.animationOptions !== animationOptions) {\n view.animate(animationOptions);\n }\n\n if (prevProps.center !== center) {\n view.setCenter(center);\n }\n\n if (zoom !== prevProps.zoom) {\n view.setZoom(zoom);\n }\n\n if (resolution !== prevProps.resolution) {\n view.setResolution(resolution);\n }\n\n if (extent && !equals(extent, prevProps.extent || [])) {\n view.fit(extent, fitOptions);\n }\n\n if (onMapMoved !== prevProps.onMapMoved) {\n this.listenMoveEnd();\n }\n\n if (onFeaturesClick !== prevProps.onFeaturesClick) {\n this.listenSingleClick();\n }\n\n if (onFeaturesHover !== prevProps.onFeaturesHover) {\n this.listenPointerMove();\n }\n }\n\n componentWillUnmount() {\n unByKey([this.moveEndRef, this.singleClickRef, this.pointerMoveRef]);\n }\n\n initLayer(layer) {\n if (!this.map?.getLayers()?.getArray()?.includes(layer)) {\n this.map.addLayer(layer);\n }\n\n const layers = layer.get(\"children\") || layer.children || [];\n for (let i = 0; i < layers.length; i += 1) {\n this.initLayer(layers[i]);\n }\n }\n\n listenMoveEnd() {\n const { onMapMoved } = this.props;\n unByKey(this.moveEndRef);\n\n if (!onMapMoved) {\n return;\n }\n\n this.moveEndRef = this.map.on(\"moveend\", (evt) => {\n return onMapMoved(evt);\n });\n }\n\n listenPointerMove() {\n const { onFeaturesHover } = this.props;\n unByKey(this.pointerMoveRef);\n\n if (!onFeaturesHover) {\n return;\n }\n\n this.pointerMoveRef = this.map.on(\"pointermove\", (evt) => {\n const features = evt.map.getFeaturesAtPixel(evt.pixel);\n onFeaturesHover(features || [], evt);\n });\n }\n\n listenSingleClick() {\n const { featuresClickOptions, onFeaturesClick } = this.props;\n unByKey(this.singleClickRef);\n\n if (!onFeaturesClick) {\n return;\n }\n\n this.singleClickRef = this.map.on(\"singleclick\", (evt) => {\n const features = evt.map.getFeaturesAtPixel(\n evt.pixel,\n featuresClickOptions,\n );\n onFeaturesClick(features || [], evt);\n });\n }\n\n render() {\n const { ariaLabel, className, style, tabIndex } = this.props;\n return (\n <div\n aria-label={ariaLabel}\n className={className}\n ref={this.setNode}\n role=\"presentation\"\n style={style}\n tabIndex={tabIndex}\n />\n );\n }\n\n setLayers(layers = [], prevLayers = []) {\n for (let i = 0; i < prevLayers.length; i += 1) {\n this.terminateLayer(prevLayers[i]);\n }\n for (let i = 0; i < layers.length; i += 1) {\n this.initLayer(layers[i]);\n }\n }\n\n setNode(node) {\n this.setState({ node });\n }\n\n terminateLayer(layer) {\n const layers = layer.get(\"children\") || layer.children || [];\n for (let i = 0; i < layers.length; i += 1) {\n this.terminateLayer(layers[i]);\n }\n\n if (this.map?.getLayers()?.getArray()?.includes(layer)) {\n this.map.removeLayer(layer);\n }\n }\n}\n\nBasicMap.propTypes = propTypes;\nBasicMap.defaultProps = defaultProps;\n\nexport default BasicMap;\n"],
|
|
5
|
+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G;AACzC,WAAK,UAAU,OAAO,CAAC,CAAC;AAAA,IAC1B;AAAA,EACF;AAAA,EAEA,QAAQ,MAAM;AACZ,SAAK,SAAS,EAAE,KAAK,CAAC;AAAA,EACxB;AAAA,EAEA,eAAe,OAAO;AACpB,UAAM,SAAS,MAAM,IAAI,UAAU,KAAK,MAAM,YAAY,CAAC;AAC3D,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK,GAAG;AACzC,WAAK,eAAe,OAAO,CAAC,CAAC;AAAA,IAC/B;AAEA,QAAI,KAAK,KAAK,UAAU,GAAG,SAAS,GAAG,SAAS,KAAK,GAAG;AACtD,WAAK,IAAI,YAAY,KAAK;AAAA,IAC5B;AAAA,EACF;AACF;AAEA,SAAS,YAAY;AACrB,SAAS,eAAe;AAExB,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/BasicMap/index.js"],
|
|
4
|
-
"sourcesContent": ["export { default } from
|
|
5
|
-
"mappings": "AAAA,
|
|
4
|
+
"sourcesContent": ["export { default } from \"./BasicMap\";\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|