mobility-toolbox-js 3.0.0-beta.21 → 3.0.0-beta.22
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/api/StopsAPI.js +1 -1
- package/common/controls/StopFinderControlCommon.js +1 -1
- package/mbt.js +7 -2
- package/mbt.js.map +2 -2
- package/mbt.min.js +2 -2
- package/mbt.min.js.map +2 -2
- package/ol/controls/StopFinderControl.d.ts +2 -2
- package/ol/controls/StopFinderControl.js +1 -1
- package/ol/layers/MaplibreLayer.js +1 -0
- package/ol/layers/VectorLayer.js +5 -4
- package/ol/mixins/PropertiesLayerMixin.d.ts +1 -0
- package/ol/mixins/PropertiesLayerMixin.js +4 -0
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Feature } from 'geojson';
|
|
2
2
|
import Control, { Options } from 'ol/control/Control';
|
|
3
3
|
import StopFinderControlCommon from '../../common/controls/StopFinderControlCommon';
|
|
4
|
-
export type StopFinderControlOptions =
|
|
4
|
+
export type StopFinderControlOptions = {
|
|
5
5
|
className?: string;
|
|
6
|
-
};
|
|
6
|
+
} & Options & StopFinderControlCommon;
|
|
7
7
|
/**
|
|
8
8
|
* This OpenLayers control allows to search stations from the [geOps Stops API](https://developer.geops.io/apis/stops/).
|
|
9
9
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { fromLonLat } from 'ol/proj';
|
|
2
1
|
import Control from 'ol/control/Control';
|
|
2
|
+
import { fromLonLat } from 'ol/proj';
|
|
3
3
|
import StopFinderControlCommon from '../../common/controls/StopFinderControlCommon';
|
|
4
4
|
import createDefaultStopFinderElement from '../../common/utils/createDefaultStopFinderElt';
|
|
5
5
|
/**
|
|
@@ -69,6 +69,7 @@ class MaplibreLayer extends MobilityLayerMixin(MapLibreLayer) {
|
|
|
69
69
|
attachToMap(map) {
|
|
70
70
|
super.attachToMap(map);
|
|
71
71
|
const updateMaplibreMapDebounced = debounce(this.updateMaplibreMap.bind(this), 150);
|
|
72
|
+
updateMaplibreMapDebounced();
|
|
72
73
|
this.olEventsKeys.push(this.on('propertychange', (evt) => {
|
|
73
74
|
if (/(url|style)/.test(evt.key)) {
|
|
74
75
|
updateMaplibreMapDebounced();
|
package/ol/layers/VectorLayer.js
CHANGED
|
@@ -16,10 +16,11 @@ class VectorLayer extends Layer {
|
|
|
16
16
|
let features = [];
|
|
17
17
|
if (this.map) {
|
|
18
18
|
const pixel = this.map.getPixelFromCoordinate(coordinate);
|
|
19
|
-
features =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
features =
|
|
20
|
+
this.map.getFeaturesAtPixel(pixel, {
|
|
21
|
+
hitTolerance: this.hitTolerance || 5,
|
|
22
|
+
layerFilter: (l) => l === this.olLayer,
|
|
23
|
+
}) || [];
|
|
23
24
|
}
|
|
24
25
|
return Promise.resolve({
|
|
25
26
|
coordinate,
|
|
@@ -60,6 +60,7 @@ declare function PropertiesLayerMixin<TBase extends Layerable>(Base: TBase): {
|
|
|
60
60
|
/** @deprecated */
|
|
61
61
|
olLayer: Layer;
|
|
62
62
|
/** @deprecated */
|
|
63
|
+
/** @deprecated */
|
|
63
64
|
parent: Layer<import("ol/source").Source, import("ol/renderer/Layer").default<any>>;
|
|
64
65
|
/** @deprecated */
|
|
65
66
|
visible: boolean;
|
|
@@ -150,6 +150,10 @@ function PropertiesLayerMixin(Base) {
|
|
|
150
150
|
deprecated('Layer.olLayer is deprecated. mobility-toolbox-js/ol layers inherits now from ol/layer/Layer class. This setter has no effect.');
|
|
151
151
|
}
|
|
152
152
|
/** @deprecated */
|
|
153
|
+
// get olListenersKeys(): EventsKey[] {
|
|
154
|
+
// return this.olEventsKeys;
|
|
155
|
+
// }
|
|
156
|
+
/** @deprecated */
|
|
153
157
|
get parent() {
|
|
154
158
|
deprecated("Layer.parent is deprecated. Use the Layer.get('parent') method instead.");
|
|
155
159
|
return this.get('parent');
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "mobility-toolbox-js",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "Toolbox for JavaScript applications in the domains of mobility and logistics.",
|
|
5
|
-
"version": "3.0.0-beta.
|
|
5
|
+
"version": "3.0.0-beta.22",
|
|
6
6
|
"homepage": "https://mobility-toolbox-js.geops.io/",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./index.js",
|