mobility-toolbox-js 3.0.0-beta.10 → 3.0.0-beta.11

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.
@@ -31,7 +31,7 @@ export type AbotControllersByGraph = {
31
31
  [key: string]: AbortController;
32
32
  };
33
33
  /**
34
- * Display a route of a specified mean of transport.
34
+ * This control allows the user to add and modifiy via points to a map and request a route from the [geOps Routing API](https://developer.geops.io/apis/routing/).
35
35
  *
36
36
  * @example
37
37
  * import { Map } from 'ol';
@@ -47,7 +47,7 @@ const getFlatCoordinatesFromSegments = (segmentArray) => {
47
47
  return coords;
48
48
  };
49
49
  /**
50
- * Display a route of a specified mean of transport.
50
+ * This control allows the user to add and modifiy via points to a map and request a route from the [geOps Routing API](https://developer.geops.io/apis/routing/).
51
51
  *
52
52
  * @example
53
53
  * import { Map } from 'ol';
@@ -5,7 +5,7 @@ export type StopFinderControlOptions = Options & StopFinderControlCommon & {
5
5
  className?: string;
6
6
  };
7
7
  /**
8
- * Search stations.
8
+ * This OpenLayers control allows to search stations from the [geOps Stops API](https://developer.geops.io/apis/stops/).
9
9
  *
10
10
  * @example
11
11
  * import { Map } from 'ol';
@@ -3,7 +3,7 @@ import Control from 'ol/control/Control';
3
3
  import StopFinderControlCommon from '../../common/controls/StopFinderControlCommon';
4
4
  import createDefaultStopFinderElement from '../../common/utils/createDefaultStopFinderElt';
5
5
  /**
6
- * Search stations.
6
+ * This OpenLayers control allows to search stations from the [geOps Stops API](https://developer.geops.io/apis/stops/).
7
7
  *
8
8
  * @example
9
9
  * import { Map } from 'ol';
@@ -1,11 +1,110 @@
1
+ import Source from 'ol/source/Source';
2
+ import OlMap from 'ol/Map';
3
+ import BaseEvent from 'ol/events/Event';
4
+ import Layer from 'ol/layer/Layer';
1
5
  import { Map, MapOptions } from 'maplibre-gl';
2
- import MapGlLayer, { MapGlLayerOptions } from './MapGlLayer';
6
+ import { MobilityLayerOptions } from '../mixins/MobilityLayerMixin';
3
7
  import MaplibreLayerRenderer from '../renderers/MaplibreLayerRenderer';
4
- export type MaplibreLayerOptions = MapGlLayerOptions & {
5
- mapOptions?: MapOptions;
8
+ export type MaplibreLayerOptions = MobilityLayerOptions & {
9
+ apiKey?: string;
10
+ apiKeyName?: string;
11
+ style?: string | maplibregl.StyleSpecification;
12
+ url?: string;
13
+ mapOptions?: maplibregl.MapOptions;
14
+ queryRenderedFeaturesOptions?: maplibregl.QueryRenderedFeaturesOptions;
6
15
  };
16
+ declare const MaplibreLayer_base: {
17
+ new (...args: any[]): {
18
+ options?: import("../mixins/PropertiesLayerMixin").PropertiesLayerMixinOptions | undefined;
19
+ olListenersKeys: import("ol/events").EventsKey[];
20
+ children: Layer<Source, import("ol/renderer/Layer").default<any>>[];
21
+ get copyrights(): string;
22
+ set copyrights(newCopyrights: string | string[]);
23
+ disabled: boolean;
24
+ readonly group: string;
25
+ readonly hitTolerance: boolean;
26
+ readonly key: string;
27
+ readonly map: OlMap;
28
+ readonly name: string;
29
+ olLayer: Layer<Source, import("ol/renderer/Layer").default<any>>;
30
+ parent: Layer<Source, import("ol/renderer/Layer").default<any>>;
31
+ visible: boolean;
32
+ setMapInternal: ((map: OlMap) => void) & ((map: OlMap | null) => void);
33
+ onChildrenChange(oldValue: Layer<Source, import("ol/renderer/Layer").default<any>>[]): void;
34
+ attachToMap(map: OlMap): void;
35
+ detachFromMap(): void;
36
+ flat(): any[];
37
+ addEventListener: (type: string, listener: import("ol/events").Listener) => void;
38
+ removeEventListener: (type: string, listener: import("ol/events").Listener) => void;
39
+ on: import("ol/layer/Layer").LayerOnSignature<import("ol/events").EventsKey>;
40
+ render: (frameState: import("ol/Map").FrameState | null, target: HTMLElement) => HTMLElement | null;
41
+ once: import("ol/layer/Layer").LayerOnSignature<import("ol/events").EventsKey>;
42
+ un: import("ol/layer/Layer").LayerOnSignature<void>;
43
+ getSource: () => Source | null;
44
+ getRenderSource: () => Source | null;
45
+ getFeatures: (pixel: import("ol/pixel").Pixel) => Promise<import("ol/Feature").FeatureLike[]>;
46
+ getData: (pixel: import("ol/pixel").Pixel) => Float32Array | Uint8ClampedArray | Uint8Array | DataView | null;
47
+ isVisible: (view?: import("ol").View | import("ol/View").ViewStateLayerStateExtent | undefined) => boolean;
48
+ getAttributions: (view?: import("ol").View | import("ol/View").ViewStateLayerStateExtent | undefined) => string[];
49
+ unrender: () => void;
50
+ getDeclutter: () => string;
51
+ renderDeclutter: (frameState: import("ol/Map").FrameState, layerState: import("ol/layer/Layer").State) => void;
52
+ renderDeferred: (frameState: import("ol/Map").FrameState) => void;
53
+ getMapInternal: () => OlMap | null;
54
+ setMap: (map: OlMap | null) => void;
55
+ setSource: (source: Source | null) => void;
56
+ getRenderer: () => import("ol/renderer/Layer").default<any> | null;
57
+ hasRenderer: () => boolean;
58
+ getBackground: () => false | import("ol/layer/Base").BackgroundColor;
59
+ getClassName: () => string;
60
+ getLayerState: (managed?: boolean | undefined) => import("ol/layer/Layer").State;
61
+ getLayersArray: (array?: Layer<Source, import("ol/renderer/Layer").default<any>>[] | undefined) => Layer<Source, import("ol/renderer/Layer").default<any>>[];
62
+ getLayerStatesArray: (states?: import("ol/layer/Layer").State[] | undefined) => import("ol/layer/Layer").State[];
63
+ getExtent: () => import("ol/extent").Extent | undefined;
64
+ getMaxResolution: () => number;
65
+ getMinResolution: () => number;
66
+ getMinZoom: () => number;
67
+ getMaxZoom: () => number;
68
+ getOpacity: () => number;
69
+ getSourceState: () => import("ol/source/Source").State;
70
+ getVisible: () => boolean;
71
+ getZIndex: () => number | undefined;
72
+ setBackground: (background?: import("ol/layer/Base").BackgroundColor | undefined) => void;
73
+ setExtent: (extent: import("ol/extent").Extent | undefined) => void;
74
+ setMaxResolution: (maxResolution: number) => void;
75
+ setMinResolution: (minResolution: number) => void;
76
+ setMaxZoom: (maxZoom: number) => void;
77
+ setMinZoom: (minZoom: number) => void;
78
+ setOpacity: (opacity: number) => void;
79
+ setVisible: (visible: boolean) => void;
80
+ setZIndex: (zindex: number) => void;
81
+ get: (key: string) => any;
82
+ getKeys: () => string[];
83
+ getProperties: () => {
84
+ [x: string]: any;
85
+ };
86
+ getPropertiesInternal: () => {
87
+ [x: string]: any;
88
+ } | null;
89
+ hasProperties: () => boolean;
90
+ notify: (key: string, oldValue: any) => void;
91
+ addChangeListener: (key: string, listener: import("ol/events").Listener) => void;
92
+ removeChangeListener: (key: string, listener: import("ol/events").Listener) => void;
93
+ set: (key: string, value: any, silent?: boolean | undefined) => void;
94
+ setProperties: (values: {
95
+ [x: string]: any;
96
+ }, silent?: boolean | undefined) => void;
97
+ unset: (key: string, silent?: boolean | undefined) => void;
98
+ changed: () => void;
99
+ getRevision: () => number;
100
+ dispatchEvent: (event: string | BaseEvent) => boolean | undefined;
101
+ getListeners: (type: string) => import("ol/events").Listener[] | undefined;
102
+ hasListener: (type?: string | undefined) => boolean;
103
+ dispose: () => void;
104
+ };
105
+ } & typeof Layer;
7
106
  /**
8
- * This layer is meant to facilitate the use of the geOps Maps api in an OpenLayers map using Maplibre.
107
+ * An OpenLayers layer able to display data from the [geOps Maps API](https://developer.geops.io/apis/maps).
9
108
  *
10
109
  * @example
11
110
  * import { MaplibreLayer } from 'mobility-toolbox-js/ol';
@@ -31,10 +130,20 @@ export type MaplibreLayerOptions = MapGlLayerOptions & {
31
130
  * @extends {ol/layer/Layer~Layer}
32
131
  * @public
33
132
  */
34
- export default class MaplibreLayer extends MapGlLayer {
35
- options?: MaplibreLayerOptions;
36
- /** @private */
37
- get maplibreMap(): maplibregl.Map | undefined;
133
+ declare class MaplibreLayer extends MaplibreLayer_base {
134
+ loaded: boolean;
135
+ maplibreMap?: Map;
136
+ get apiKey(): string;
137
+ set apiKey(newValue: string);
138
+ get apiKeyName(): string;
139
+ set apiKeyName(newValue: string);
140
+ get mbMap(): maplibregl.Map | undefined;
141
+ get queryRenderedFeaturesOptions(): maplibregl.QueryRenderedFeaturesOptions;
142
+ set queryRenderedFeaturesOptions(newValue: maplibregl.QueryRenderedFeaturesOptions);
143
+ get style(): string;
144
+ set style(newValue: string);
145
+ get url(): string;
146
+ set url(newValue: string);
38
147
  /**
39
148
  * Constructor.
40
149
  *
@@ -47,13 +156,23 @@ export default class MaplibreLayer extends MapGlLayer {
47
156
  */
48
157
  constructor(options: MaplibreLayerOptions);
49
158
  /**
50
- * @private
159
+ * Initialize the layer and listen to feature clicks.
160
+ * @param {ol/Map~Map} map
51
161
  */
52
- createRenderer(): MaplibreLayerRenderer;
162
+ attachToMap(map: OlMap): void;
53
163
  /**
164
+ * Terminate what was initialized in init function. Remove layer, events...
165
+ */
166
+ detachFromMap(): void;
167
+ /**
168
+ * Create the Maplibre map.
54
169
  * @private
55
170
  */
171
+ loadMbMap(): void;
172
+ getStyle(): string;
56
173
  createMap(options: MapOptions): Map;
174
+ createRenderer(): MaplibreLayerRenderer;
175
+ updateMaplibreMap(): void;
57
176
  /**
58
177
  * Create a copy of the MaplibreLayer.
59
178
  * @param {MaplibreLayerOptions} newOptions Options to override
@@ -61,3 +180,4 @@ export default class MaplibreLayer extends MapGlLayer {
61
180
  */
62
181
  clone(newOptions: MaplibreLayerOptions): MaplibreLayer;
63
182
  }
183
+ export default MaplibreLayer;
@@ -1,8 +1,13 @@
1
+ import Source from 'ol/source/Source';
2
+ import BaseEvent from 'ol/events/Event';
3
+ import Layer from 'ol/layer/Layer';
4
+ import debounce from 'lodash.debounce';
1
5
  import { Map } from 'maplibre-gl';
2
- import MapGlLayer from './MapGlLayer';
6
+ import { getUrlWithParams, getMapGlCopyrights } from '../../common/utils';
7
+ import MobilityLayerMixin from '../mixins/MobilityLayerMixin';
3
8
  import MaplibreLayerRenderer from '../renderers/MaplibreLayerRenderer';
4
9
  /**
5
- * This layer is meant to facilitate the use of the geOps Maps api in an OpenLayers map using Maplibre.
10
+ * An OpenLayers layer able to display data from the [geOps Maps API](https://developer.geops.io/apis/maps).
6
11
  *
7
12
  * @example
8
13
  * import { MaplibreLayer } from 'mobility-toolbox-js/ol';
@@ -28,10 +33,40 @@ import MaplibreLayerRenderer from '../renderers/MaplibreLayerRenderer';
28
33
  * @extends {ol/layer/Layer~Layer}
29
34
  * @public
30
35
  */
31
- export default class MaplibreLayer extends MapGlLayer {
32
- /** @private */
33
- get maplibreMap() {
34
- return this.mbMap;
36
+ class MaplibreLayer extends MobilityLayerMixin(Layer) {
37
+ get apiKey() {
38
+ return this.get('apiKey');
39
+ }
40
+ set apiKey(newValue) {
41
+ this.set('apiKey', newValue);
42
+ }
43
+ get apiKeyName() {
44
+ return this.get('apiKeyName');
45
+ }
46
+ set apiKeyName(newValue) {
47
+ this.set('apiKeyName', newValue);
48
+ }
49
+ get mbMap() {
50
+ console.warn('Deprecated. Use layer.maplibreMap.');
51
+ return this.maplibreMap;
52
+ }
53
+ get queryRenderedFeaturesOptions() {
54
+ return this.get('queryRenderedFeaturesOptions');
55
+ }
56
+ set queryRenderedFeaturesOptions(newValue) {
57
+ this.set('queryRenderedFeaturesOptions', newValue);
58
+ }
59
+ get style() {
60
+ return this.get('style');
61
+ }
62
+ set style(newValue) {
63
+ this.set('style', newValue);
64
+ }
65
+ get url() {
66
+ return this.get('url');
67
+ }
68
+ set url(newValue) {
69
+ this.set('url', newValue);
35
70
  }
36
71
  /**
37
72
  * Constructor.
@@ -44,21 +79,108 @@ export default class MaplibreLayer extends MapGlLayer {
44
79
  * @param {string} [options.url="https://maps.geops.io"] The geOps Maps api url.
45
80
  */
46
81
  constructor(options) {
47
- super(Object.assign({}, options));
82
+ super(Object.assign(Object.assign({ source: new Source({
83
+ attributions: () => {
84
+ return ((this.maplibreMap && getMapGlCopyrights(this.maplibreMap)) || []);
85
+ },
86
+ }), apiKeyName: 'key', style: 'travic_v2', url: 'https://maps.geops.io' }, (options || {})), {
87
+ // @ts-expect-error mapOptions must be saved by the mixin in this.options
88
+ mapOptions: Object.assign({ interactive: false, trackResize: false, attributionControl: false }, ((options === null || options === void 0 ? void 0 : options.mapOptions) || {})), queryRenderedFeaturesOptions: Object.assign({}, ((options === null || options === void 0 ? void 0 : options.queryRenderedFeaturesOptions) || {})) }));
48
89
  }
49
90
  /**
50
- * @private
91
+ * Initialize the layer and listen to feature clicks.
92
+ * @param {ol/Map~Map} map
51
93
  */
52
- createRenderer() {
53
- return new MaplibreLayerRenderer(this);
94
+ attachToMap(map) {
95
+ super.attachToMap(map);
96
+ this.loadMbMap();
97
+ const updateMaplibreMapDebounced = debounce(this.updateMaplibreMap.bind(this), 150);
98
+ this.olListenersKeys.push(this.on('propertychange', (evt) => {
99
+ if (/(apiKey|apiKeyName|url|style)/.test(evt.key)) {
100
+ updateMaplibreMapDebounced();
101
+ }
102
+ }));
103
+ }
104
+ /**
105
+ * Terminate what was initialized in init function. Remove layer, events...
106
+ */
107
+ detachFromMap() {
108
+ if (this.maplibreMap) {
109
+ // Some asynchrone repaints are triggered even if the mbMap has been removed,
110
+ // to avoid display of errors we set an empty function.
111
+ this.maplibreMap.triggerRepaint = () => { };
112
+ this.maplibreMap.remove();
113
+ this.maplibreMap = undefined;
114
+ }
115
+ this.loaded = false;
116
+ super.detachFromMap();
54
117
  }
55
118
  /**
119
+ * Create the Maplibre map.
56
120
  * @private
57
121
  */
122
+ loadMbMap() {
123
+ var _a, _b, _c;
124
+ this.loaded = false;
125
+ this.olListenersKeys.push(
126
+ // @ts-ignore
127
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.on('change:target', this.loadMbMap.bind(this)));
128
+ if (!((_b = this.map) === null || _b === void 0 ? void 0 : _b.getTargetElement())) {
129
+ return;
130
+ }
131
+ if (!this.visible) {
132
+ // On next change of visibility we load the map
133
+ this.olListenersKeys.push(
134
+ // @ts-ignore
135
+ this.once('change:visible', this.loadMbMap.bind(this)));
136
+ return;
137
+ }
138
+ const container = document.createElement('div');
139
+ container.style.position = 'absolute';
140
+ container.style.width = '100%';
141
+ container.style.height = '100%';
142
+ /**
143
+ * A Maplibre map
144
+ * @type {maplibregl.Map}
145
+ */
146
+ this.maplibreMap = this.createMap(Object.assign({ style: this.getStyle(), container }, (((_c = this.options) === null || _c === void 0 ? void 0 : _c.mapOptions) || {})));
147
+ this.maplibreMap.on('sourcedata', () => {
148
+ var _a;
149
+ (_a = this.getSource()) === null || _a === void 0 ? void 0 : _a.refresh(); // Refresh attribution
150
+ });
151
+ this.maplibreMap.once('load', () => {
152
+ this.loaded = true;
153
+ this.dispatchEvent(new BaseEvent('load'));
154
+ });
155
+ }
156
+ getStyle() {
157
+ // If the style is a complete style object, use it directly.
158
+ if (this.style &&
159
+ typeof this.style === 'object' &&
160
+ this.style.name &&
161
+ this.style.version) {
162
+ return this.style;
163
+ }
164
+ // If the url set is already a complete style url, use it directly.
165
+ if (this.url.includes('style.json')) {
166
+ return this.url;
167
+ }
168
+ /// Otherwise build the complete style url.
169
+ return getUrlWithParams(`${this.url}/styles/${this.style}/style.json`, {
170
+ [this.apiKeyName]: this.apiKey,
171
+ }).toString();
172
+ }
58
173
  // eslint-disable-next-line class-methods-use-this
59
174
  createMap(options) {
60
175
  return new Map(options);
61
176
  }
177
+ createRenderer() {
178
+ return new MaplibreLayerRenderer(this);
179
+ }
180
+ updateMaplibreMap() {
181
+ var _a;
182
+ (_a = this.maplibreMap) === null || _a === void 0 ? void 0 : _a.setStyle(this.getStyle(), { diff: false });
183
+ }
62
184
  /**
63
185
  * Create a copy of the MaplibreLayer.
64
186
  * @param {MaplibreLayerOptions} newOptions Options to override
@@ -68,3 +190,4 @@ export default class MaplibreLayer extends MapGlLayer {
68
190
  return new MaplibreLayer(Object.assign(Object.assign({}, (this.options || {})), (newOptions || {})));
69
191
  }
70
192
  }
193
+ export default MaplibreLayer;
@@ -2,6 +2,7 @@ import { Feature, Map } from 'ol';
2
2
  import { Coordinate } from 'ol/coordinate';
3
3
  import { ObjectEvent } from 'ol/Object';
4
4
  import { Layer } from 'ol/layer';
5
+ import { FeatureState } from 'maplibre-gl';
5
6
  import { Source } from 'ol/source';
6
7
  import { LayerGetFeatureInfoResponse } from '../../types';
7
8
  import { FilterFunction } from '../../common/typedefs';
@@ -194,6 +195,13 @@ declare class MaplibreStyleLayer extends MaplibreStyleLayer_base {
194
195
  * @private
195
196
  */
196
197
  onLoad(): void;
198
+ /**
199
+ * Set the feature state of the features.
200
+ * @param {Array<ol/Feature~Feature>} features
201
+ * @param {{[key:string]:boolean}} state The feature state
202
+ * @public
203
+ */
204
+ setFeatureState(features: Feature[], state: FeatureState): void;
197
205
  /**
198
206
  * Request feature information for a given coordinate.
199
207
  * @param {ol/coordinate~Coordinate} coordinate Coordinate to request the information at.
@@ -221,8 +229,6 @@ declare class MaplibreStyleLayer extends MaplibreStyleLayer_base {
221
229
  highlight(features?: Feature[]): void;
222
230
  /**
223
231
  * Apply visibility to style layers that fits the styleLayersFilter function.
224
- *
225
- * @private
226
232
  */
227
233
  applyLayoutVisibility(evt?: ObjectEvent): void;
228
234
  /**
@@ -268,6 +268,34 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
268
268
  this.disabled = !styles.length;
269
269
  }
270
270
  }
271
+ /**
272
+ * Set the feature state of the features.
273
+ * @param {Array<ol/Feature~Feature>} features
274
+ * @param {{[key:string]:boolean}} state The feature state
275
+ * @public
276
+ */
277
+ setFeatureState(features, state) {
278
+ var _a;
279
+ if (!((_a = this.maplibreLayer) === null || _a === void 0 ? void 0 : _a.maplibreMap) || !features.length) {
280
+ return;
281
+ }
282
+ const { maplibreMap } = this.maplibreLayer;
283
+ features.forEach((feature) => {
284
+ const { source, sourceLayer } = feature.get(VECTOR_TILE_FEATURE_PROPERTY) || {};
285
+ if ((!source && !sourceLayer) || !feature.getId()) {
286
+ if (!feature.getId()) {
287
+ // eslint-disable-next-line no-console
288
+ console.warn("No feature's id found. To use the feature state functionnality, tiles must be generated with --generate-ids. See https://github.com/Maplibre/tippecanoe#adding-calculated-attributes.", feature.getId(), feature.getProperties());
289
+ }
290
+ return;
291
+ }
292
+ maplibreMap.setFeatureState({
293
+ id: feature.getId(),
294
+ source,
295
+ sourceLayer,
296
+ }, state);
297
+ });
298
+ }
271
299
  /**
272
300
  * Request feature information for a given coordinate.
273
301
  * @param {ol/coordinate~Coordinate} coordinate Coordinate to request the information at.
@@ -275,6 +303,8 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
275
303
  */
276
304
  getFeatureInfoAtCoordinate(coordinate) {
277
305
  var _a;
306
+ // eslint-disable-next-line no-console
307
+ console.warn(`Deprecated. getFeatureInfoAtCoordinate([layer], coordinate) from ol package instead.`);
278
308
  if (!((_a = this.maplibreLayer) === null || _a === void 0 ? void 0 : _a.maplibreMap)) {
279
309
  return Promise.resolve({ coordinate, features: [], layer: this });
280
310
  }
@@ -342,26 +372,9 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
342
372
  * @private
343
373
  */
344
374
  setHoverState(features, state) {
345
- var _a;
346
- if (!((_a = this.maplibreLayer) === null || _a === void 0 ? void 0 : _a.maplibreMap) || !features.length) {
347
- return;
348
- }
349
- const { maplibreMap } = this.maplibreLayer;
350
- features.forEach((feature) => {
351
- const { source, sourceLayer } = feature.get(VECTOR_TILE_FEATURE_PROPERTY) || {};
352
- if ((!source && !sourceLayer) || !feature.getId()) {
353
- if (!feature.getId()) {
354
- // eslint-disable-next-line no-console
355
- console.warn("No feature's id found. To use the feature state functionnality, tiles must be generated with --generate-ids. See https://github.com/Maplibre/tippecanoe#adding-calculated-attributes.", feature.getId(), feature.getProperties());
356
- }
357
- return;
358
- }
359
- maplibreMap.setFeatureState({
360
- id: feature.getId(),
361
- source,
362
- sourceLayer,
363
- }, { hover: state });
364
- });
375
+ // eslint-disable-next-line no-console
376
+ console.warn(`Deprecated. Use layer.setFeatureState(features, {hover: ${state}}) instead.`);
377
+ this.setFeatureState(features, { hover: state });
365
378
  }
366
379
  /**
367
380
  * Select a list of features.
@@ -369,6 +382,8 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
369
382
  * @private
370
383
  */
371
384
  select(features = []) {
385
+ // eslint-disable-next-line no-console
386
+ console.warn(`Deprecated. Use layer.setFeatureState(features, {selected: true}) instead.`);
372
387
  this.setHoverState(this.selectedFeatures || [], false);
373
388
  this.selectedFeatures = features;
374
389
  this.setHoverState(this.selectedFeatures || [], true);
@@ -380,6 +395,8 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
380
395
  */
381
396
  highlight(features = []) {
382
397
  var _a;
398
+ // eslint-disable-next-line no-console
399
+ console.warn(`Deprecated. Use layer.setFeatureState(features, {highlighted: true}) instead.`);
383
400
  // Filter out selected features
384
401
  const filtered = ((_a = this.highlightedFeatures) === null || _a === void 0 ? void 0 : _a.filter((feature) => !(this.selectedFeatures || [])
385
402
  .map((feat) => feat.getId())
@@ -392,8 +409,6 @@ class MaplibreStyleLayer extends MobilityLayerMixin(Layer) {
392
409
  }
393
410
  /**
394
411
  * Apply visibility to style layers that fits the styleLayersFilter function.
395
- *
396
- * @private
397
412
  */
398
413
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
399
414
  applyLayoutVisibility(evt) {
@@ -180,7 +180,7 @@ declare const RealtimeLayer_base: {
180
180
  };
181
181
  } & typeof Layer;
182
182
  /**
183
- * Responsible for loading and display data from the geOps realtime API.
183
+ * An OpenLayers layer able to display data from the [geOps Realtime API](https://developer.geops.io/apis/realtime/).
184
184
  *
185
185
  * @example
186
186
  * import { RealtimeLayer } from 'mobility-toolbox-js/ol';
@@ -208,7 +208,7 @@ declare class RealtimeLayer extends RealtimeLayer_base {
208
208
  * @param {RealtimeLayerOptions} options
209
209
  * @param {boolean} [options.allowRenderWhenAnimating=false] Allow rendering of the layer when the map is animating.
210
210
  * @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
211
- * @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps realtime API url.
211
+ * @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps Realtime API url.
212
212
  *
213
213
  */
214
214
  constructor(options: RealtimeLayerOptions);
@@ -11,7 +11,7 @@ import RealtimeLayerRenderer from '../renderers/RealtimeLayerRenderer';
11
11
  /** @private */
12
12
  const format = new GeoJSON();
13
13
  /**
14
- * Responsible for loading and display data from the geOps realtime API.
14
+ * An OpenLayers layer able to display data from the [geOps Realtime API](https://developer.geops.io/apis/realtime/).
15
15
  *
16
16
  * @example
17
17
  * import { RealtimeLayer } from 'mobility-toolbox-js/ol';
@@ -38,7 +38,7 @@ class RealtimeLayer extends RealtimeLayerMixin(MobilityLayerMixin(Layer)) {
38
38
  * @param {RealtimeLayerOptions} options
39
39
  * @param {boolean} [options.allowRenderWhenAnimating=false] Allow rendering of the layer when the map is animating.
40
40
  * @param {string} options.apiKey Access key for [geOps apis](https://developer.geops.io/).
41
- * @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps realtime API url.
41
+ * @param {string} [options.url="wss://api.geops.io/tracker-ws/v1/"] The geOps Realtime API url.
42
42
  *
43
43
  */
44
44
  constructor(options) {
package/package.json CHANGED
@@ -2,9 +2,8 @@
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.10",
5
+ "version": "3.0.0-beta.11",
6
6
  "homepage": "https://mobility-toolbox-js.geops.io/",
7
- "module": "index.js",
8
7
  "exports": {
9
8
  ".": "./index.js",
10
9
  "./api": "./api/index.js",
@@ -24,10 +23,10 @@
24
23
  "ol": ">=7"
25
24
  },
26
25
  "devDependencies": {
27
- "@babel/preset-env": "^7.24.3",
26
+ "@babel/preset-env": "^7.24.5",
28
27
  "@babel/preset-typescript": "^7.24.1",
29
- "@commitlint/cli": "19.2.1",
30
- "@commitlint/config-conventional": "19.1.0",
28
+ "@commitlint/cli": "19.3.0",
29
+ "@commitlint/config-conventional": "19.2.2",
31
30
  "@types/geojson": "7946.0.14",
32
31
  "@types/lodash.debounce": "4.0.9",
33
32
  "@types/lodash.throttle": "4.1.9",
@@ -35,10 +34,10 @@
35
34
  "@types/offscreencanvas": "2019.7.3",
36
35
  "@types/topojson": "3.2.6",
37
36
  "@types/uuid": "9.0.8",
38
- "@typescript-eslint/eslint-plugin": "7.4.0",
39
- "@typescript-eslint/parser": "7.4.0",
40
- "cypress": "13.7.1",
41
- "esbuild": "0.20.2",
37
+ "@typescript-eslint/eslint-plugin": "7.8.0",
38
+ "@typescript-eslint/parser": "7.8.0",
39
+ "cypress": "13.8.1",
40
+ "esbuild": "0.21.1",
42
41
  "esdoc": "1.1.0",
43
42
  "esdoc-ecmascript-proposal-plugin": "1.0.0",
44
43
  "esdoc-publish-html-plugin": "1.1.2",
@@ -48,7 +47,7 @@
48
47
  "eslint-config-airbnb": "19.0.4",
49
48
  "eslint-config-airbnb-typescript": "18.0.0",
50
49
  "eslint-config-prettier": "9.1.0",
51
- "eslint-plugin-cypress": "2.15.1",
50
+ "eslint-plugin-cypress": "3.2.0",
52
51
  "eslint-plugin-import": "2.29.1",
53
52
  "eslint-plugin-jsx-a11y": "6.8.0",
54
53
  "eslint-plugin-prettier": "5.1.3",
@@ -64,9 +63,9 @@
64
63
  "jest-transformer-svg": "2.0.2",
65
64
  "jest-websocket-mock": "2.5.0",
66
65
  "lint-staged": "15.2.2",
67
- "maplibre-gl": "4.1.2",
66
+ "maplibre-gl": "4.2.0",
68
67
  "mock-socket": "9.3.1",
69
- "next": "14.1.4",
68
+ "next": "14.2.3",
70
69
  "next-transpile-modules": "10.0.1",
71
70
  "ol": "9.1.0",
72
71
  "openapi-typescript": "6.7.5",
@@ -75,11 +74,11 @@
75
74
  "sort-json": "2.0.1",
76
75
  "standard-version": "9.5.0",
77
76
  "start-server-and-test": "2.0.3",
78
- "stylelint": "16.3.1",
77
+ "stylelint": "16.5.0",
79
78
  "stylelint-config-recommended-scss": "14.0.0",
80
79
  "stylelint-config-standard": "36.0.0",
81
- "stylelint-scss": "6.2.1",
82
- "typescript": "5.4.3"
80
+ "stylelint-scss": "6.3.0",
81
+ "typescript": "5.4.5"
83
82
  },
84
83
  "scripts": {
85
84
  "apidoc": "esdoc && cp apidoc/index.json doc/src/components/Esdoc",