mobility-toolbox-js 3.0.1-beta.0 → 3.0.1-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 +11 -3
- package/api/HttpAPI.js +1 -3
- package/api/RealtimeAPI.d.ts +47 -47
- package/api/RealtimeAPI.js +74 -74
- package/api/WebSocketAPI.js +0 -1
- package/common/controls/StopFinderControlCommon.d.ts +1 -1
- package/common/controls/StopFinderControlCommon.js +1 -1
- package/common/styles/realtimeDefaultStyle.js +0 -5
- package/common/styles/realtimeHeadingStyle.js +0 -5
- package/common/styles/realtimeSimpleStyle.d.ts +0 -1
- package/common/styles/realtimeSimpleStyle.js +0 -1
- package/common/typedefs.d.ts +0 -117
- package/common/typedefs.js +0 -31
- package/common/utils/RealtimeEngine.d.ts +214 -0
- package/common/utils/RealtimeEngine.js +554 -0
- package/common/utils/getLayersAsFlatArray.d.ts +0 -1
- package/common/utils/getLayersAsFlatArray.js +0 -1
- package/common/utils/getVehiclePosition.js +1 -4
- package/common/utils/realtimeConfig.d.ts +1 -1
- package/common/utils/realtimeConfig.js +0 -1
- package/common/utils/renderTrajectories.d.ts +1 -0
- package/common/utils/renderTrajectories.js +1 -0
- package/common/utils/sortAndFilterDepartures.d.ts +1 -0
- package/common/utils/sortAndFilterDepartures.js +1 -0
- package/maplibre/controls/CopyrightControl.d.ts +9 -6
- package/maplibre/controls/CopyrightControl.js +11 -8
- package/maplibre/layers/Layer.d.ts +7 -6
- package/maplibre/layers/Layer.js +1 -2
- package/maplibre/layers/RealtimeLayer.d.ts +54 -111
- package/maplibre/layers/RealtimeLayer.js +126 -114
- package/maplibre/utils/getSourceCoordinates.d.ts +1 -0
- package/maplibre/utils/getSourceCoordinates.js +5 -4
- package/mbt.js +6960 -14605
- package/mbt.js.map +4 -4
- package/mbt.min.js +68 -71
- package/mbt.min.js.map +4 -4
- package/ol/controls/CopyrightControl.d.ts +13 -5
- package/ol/controls/CopyrightControl.js +13 -5
- package/ol/controls/RoutingControl.d.ts +29 -18
- package/ol/controls/RoutingControl.js +44 -56
- package/ol/controls/StopFinderControl.d.ts +21 -2
- package/ol/controls/StopFinderControl.js +22 -3
- package/ol/index.d.ts +0 -1
- package/ol/index.js +0 -1
- package/ol/layers/Layer.d.ts +17 -92
- package/ol/layers/Layer.js +17 -3
- package/ol/layers/MaplibreLayer.d.ts +47 -114
- package/ol/layers/MaplibreLayer.js +102 -46
- package/ol/layers/MaplibreStyleLayer.d.ts +67 -147
- package/ol/layers/MaplibreStyleLayer.js +170 -123
- package/ol/layers/RealtimeLayer.d.ts +85 -218
- package/ol/layers/RealtimeLayer.js +170 -181
- package/ol/layers/VectorLayer.d.ts +1 -2
- package/ol/layers/VectorLayer.js +7 -6
- package/ol/renderers/MaplibreLayerRenderer.d.ts +9 -0
- package/ol/renderers/MaplibreLayerRenderer.js +35 -137
- package/ol/renderers/MaplibreStyleLayerRenderer.js +2 -2
- package/ol/renderers/RealtimeLayerRenderer.d.ts +1 -1
- package/ol/renderers/RealtimeLayerRenderer.js +6 -31
- package/ol/styles/fullTrajectoryDelayStyle.js +5 -7
- package/ol/styles/fullTrajectoryStyle.d.ts +1 -2
- package/ol/styles/fullTrajectoryStyle.js +5 -7
- package/ol/styles/routingStyle.d.ts +0 -1
- package/ol/styles/routingStyle.js +13 -10
- package/ol/utils/defineDeprecatedProperties.d.ts +10 -0
- package/ol/utils/defineDeprecatedProperties.js +180 -0
- package/package.json +40 -39
- package/setupTests.js +14 -0
- package/types/common.d.ts +4 -27
- package/types/realtime.d.ts +7 -2
- package/common/mixins/RealtimeLayerMixin.d.ts +0 -267
- package/common/mixins/RealtimeLayerMixin.js +0 -751
- package/ol/mixins/MobilityLayerMixin.d.ts +0 -96
- package/ol/mixins/MobilityLayerMixin.js +0 -6
- package/ol/mixins/PropertiesLayerMixin.d.ts +0 -136
- package/ol/mixins/PropertiesLayerMixin.js +0 -178
- package/ol/mixins/index.d.ts +0 -1
- package/ol/mixins/index.js +0 -2
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { Layer } from 'ol/layer';
|
|
2
|
-
import { PropertiesLayerMixinOptions } from './PropertiesLayerMixin';
|
|
3
|
-
export type MobilityLayerOptions = PropertiesLayerMixinOptions & Record<string, any>;
|
|
4
|
-
type GConstructor<T = object> = new (...args: any[]) => T;
|
|
5
|
-
export type Layerable = GConstructor<Omit<Layer, keyof string>>;
|
|
6
|
-
declare function MobilityLayerMixin<TBase extends Layerable>(Base: TBase): {
|
|
7
|
-
new (...args: any[]): {
|
|
8
|
-
olEventsKeys: import("ol/events").EventsKey[];
|
|
9
|
-
options?: PropertiesLayerMixinOptions;
|
|
10
|
-
attachToMap(map: import("ol").Map): void;
|
|
11
|
-
detachFromMap(): void;
|
|
12
|
-
flat(): any[];
|
|
13
|
-
onChildrenChange(oldValue: Layer[]): void;
|
|
14
|
-
setMapInternal: ((map: import("ol").Map) => void) & ((map: import("ol").default | null) => void);
|
|
15
|
-
children: Layer<import("ol/source").Source, import("ol/renderer/Layer").default<any>>[];
|
|
16
|
-
get copyrights(): string;
|
|
17
|
-
set copyrights(newCopyrights: string | string[]);
|
|
18
|
-
disabled: boolean;
|
|
19
|
-
readonly group: string;
|
|
20
|
-
readonly hitTolerance: number;
|
|
21
|
-
readonly key: string;
|
|
22
|
-
readonly map: import("ol").Map;
|
|
23
|
-
readonly name: string;
|
|
24
|
-
olLayer: Layer;
|
|
25
|
-
parent: Layer<import("ol/source").Source, import("ol/renderer/Layer").default<any>>;
|
|
26
|
-
visible: boolean;
|
|
27
|
-
on: import("ol/layer/Layer").LayerOnSignature<import("ol/events").EventsKey>;
|
|
28
|
-
once: import("ol/layer/Layer").LayerOnSignature<import("ol/events").EventsKey>;
|
|
29
|
-
un: import("ol/layer/Layer").LayerOnSignature<void>;
|
|
30
|
-
render: (frameState: import("ol/Map").FrameState | null, target: HTMLElement) => HTMLElement | null;
|
|
31
|
-
getSource: () => import("ol/source").Source | null;
|
|
32
|
-
getRenderSource: () => import("ol/source").Source | null;
|
|
33
|
-
getFeatures: (pixel: import("ol/pixel").Pixel) => Promise<Array<import("ol/Feature").FeatureLike>>;
|
|
34
|
-
getData: (pixel: import("ol/pixel").Pixel) => Uint8ClampedArray | Uint8Array | Float32Array | DataView | null;
|
|
35
|
-
isVisible: (view?: import("ol").View | import("ol/View").ViewStateLayerStateExtent | undefined) => boolean;
|
|
36
|
-
getAttributions: (view?: import("ol").View | import("ol/View").ViewStateLayerStateExtent | undefined) => Array<string>;
|
|
37
|
-
unrender: () => void;
|
|
38
|
-
getDeclutter: () => string;
|
|
39
|
-
renderDeclutter: (frameState: import("ol/Map").FrameState, layerState: import("ol/layer/Layer").State) => void;
|
|
40
|
-
renderDeferred: (frameState: import("ol/Map").FrameState) => void;
|
|
41
|
-
getMapInternal: () => import("ol").default | null;
|
|
42
|
-
setMap: (map: import("ol").default | null) => void;
|
|
43
|
-
setSource: (source: import("ol/source").Source | null) => void;
|
|
44
|
-
getRenderer: () => import("ol/renderer/Layer").default<any> | null;
|
|
45
|
-
hasRenderer: () => boolean;
|
|
46
|
-
getBackground: () => import("ol/layer/Base").BackgroundColor | false;
|
|
47
|
-
getClassName: () => string;
|
|
48
|
-
getLayerState: (managed?: boolean | undefined) => import("ol/layer/Layer").State;
|
|
49
|
-
getLayersArray: (array?: import("ol/layer/Layer").default<import("ol/source").default, import("ol/renderer/Layer").default<any>>[] | undefined) => Array<import("ol/layer/Layer").default>;
|
|
50
|
-
getLayerStatesArray: (states?: import("ol/layer/Layer").State[] | undefined) => Array<import("ol/layer/Layer").State>;
|
|
51
|
-
getExtent: () => import("ol/extent").Extent | undefined;
|
|
52
|
-
getMaxResolution: () => number;
|
|
53
|
-
getMinResolution: () => number;
|
|
54
|
-
getMinZoom: () => number;
|
|
55
|
-
getMaxZoom: () => number;
|
|
56
|
-
getOpacity: () => number;
|
|
57
|
-
getSourceState: () => import("ol/source/Source").State;
|
|
58
|
-
getVisible: () => boolean;
|
|
59
|
-
getZIndex: () => number | undefined;
|
|
60
|
-
setBackground: (background?: import("ol/layer/Base").BackgroundColor | undefined) => void;
|
|
61
|
-
setExtent: (extent: import("ol/extent").Extent | undefined) => void;
|
|
62
|
-
setMaxResolution: (maxResolution: number) => void;
|
|
63
|
-
setMinResolution: (minResolution: number) => void;
|
|
64
|
-
setMaxZoom: (maxZoom: number) => void;
|
|
65
|
-
setMinZoom: (minZoom: number) => void;
|
|
66
|
-
setOpacity: (opacity: number) => void;
|
|
67
|
-
setVisible: (visible: boolean) => void;
|
|
68
|
-
setZIndex: (zindex: number) => void;
|
|
69
|
-
get: (key: string) => any;
|
|
70
|
-
getKeys: () => Array<string>;
|
|
71
|
-
getProperties: () => {
|
|
72
|
-
[x: string]: any;
|
|
73
|
-
};
|
|
74
|
-
getPropertiesInternal: () => {
|
|
75
|
-
[x: string]: any;
|
|
76
|
-
} | null;
|
|
77
|
-
hasProperties: () => boolean;
|
|
78
|
-
notify: (key: string, oldValue: any) => void;
|
|
79
|
-
addChangeListener: (key: string, listener: import("ol/events").Listener) => void;
|
|
80
|
-
removeChangeListener: (key: string, listener: import("ol/events").Listener) => void;
|
|
81
|
-
set: (key: string, value: any, silent?: boolean | undefined) => void;
|
|
82
|
-
setProperties: (values: {
|
|
83
|
-
[x: string]: any;
|
|
84
|
-
}, silent?: boolean | undefined) => void;
|
|
85
|
-
unset: (key: string, silent?: boolean | undefined) => void;
|
|
86
|
-
changed: () => void;
|
|
87
|
-
getRevision: () => number;
|
|
88
|
-
addEventListener: (type: string, listener: import("ol/events").Listener) => void;
|
|
89
|
-
dispatchEvent: (event: import("ol/events/Event").default | string) => boolean | undefined;
|
|
90
|
-
getListeners: (type: string) => Array<import("ol/events").Listener> | undefined;
|
|
91
|
-
hasListener: (type?: string | undefined) => boolean;
|
|
92
|
-
removeEventListener: (type: string, listener: import("ol/events").Listener) => void;
|
|
93
|
-
dispose: () => void;
|
|
94
|
-
};
|
|
95
|
-
} & TBase;
|
|
96
|
-
export default MobilityLayerMixin;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { Map } from 'ol';
|
|
2
|
-
import { EventsKey } from 'ol/events';
|
|
3
|
-
import { Layer } from 'ol/layer';
|
|
4
|
-
import type { Options } from 'ol/layer/Layer';
|
|
5
|
-
import type { Layerable } from './MobilityLayerMixin';
|
|
6
|
-
export type PropertiesLayerMixinOptions = {
|
|
7
|
-
children?: any[];
|
|
8
|
-
copyrights?: string[];
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
group?: string;
|
|
11
|
-
hitTolerance?: number;
|
|
12
|
-
key?: string;
|
|
13
|
-
map?: Map;
|
|
14
|
-
name?: string;
|
|
15
|
-
properties?: Record<string, any>;
|
|
16
|
-
visible?: boolean;
|
|
17
|
-
} & Options & Record<string, any>;
|
|
18
|
-
/**
|
|
19
|
-
* This mixin adds some properties to access ol custom properties easily.
|
|
20
|
-
*/
|
|
21
|
-
declare function PropertiesLayerMixin<TBase extends Layerable>(Base: TBase): {
|
|
22
|
-
new (...args: any[]): {
|
|
23
|
-
olEventsKeys: EventsKey[];
|
|
24
|
-
options?: PropertiesLayerMixinOptions;
|
|
25
|
-
/**
|
|
26
|
-
* Initialize the layer with the map passed in parameters.
|
|
27
|
-
*
|
|
28
|
-
* @param {ol/Map~Map} map A map.
|
|
29
|
-
*/
|
|
30
|
-
attachToMap(map: Map): void;
|
|
31
|
-
/**
|
|
32
|
-
* Terminate what was initialized in init function. Remove layer, events...
|
|
33
|
-
*/
|
|
34
|
-
detachFromMap(): void;
|
|
35
|
-
/**
|
|
36
|
-
* Return the an array containing all the descendants of the layer in a flat array. Including the current layer.
|
|
37
|
-
* @deprecated
|
|
38
|
-
*/
|
|
39
|
-
flat(): any[];
|
|
40
|
-
/** @private */
|
|
41
|
-
onChildrenChange(oldValue: Layer[]): void;
|
|
42
|
-
setMapInternal(map: Map): void;
|
|
43
|
-
/** @deprecated */
|
|
44
|
-
children: Layer<import("ol/source").Source, import("ol/renderer/Layer").default<any>>[];
|
|
45
|
-
/** @deprecated */
|
|
46
|
-
get copyrights(): string;
|
|
47
|
-
/** @deprecated */
|
|
48
|
-
set copyrights(newCopyrights: string | string[]);
|
|
49
|
-
/** @deprecated */
|
|
50
|
-
disabled: boolean;
|
|
51
|
-
/** @deprecated */
|
|
52
|
-
/** @deprecated */
|
|
53
|
-
readonly group: string;
|
|
54
|
-
/** @deprecated */
|
|
55
|
-
readonly hitTolerance: number;
|
|
56
|
-
readonly key: string;
|
|
57
|
-
readonly map: Map;
|
|
58
|
-
/** @deprecated */
|
|
59
|
-
readonly name: string;
|
|
60
|
-
/** @deprecated */
|
|
61
|
-
olLayer: Layer;
|
|
62
|
-
/** @deprecated */
|
|
63
|
-
/** @deprecated */
|
|
64
|
-
parent: Layer<import("ol/source").Source, import("ol/renderer/Layer").default<any>>;
|
|
65
|
-
/** @deprecated */
|
|
66
|
-
visible: boolean;
|
|
67
|
-
on: import("ol/layer/Layer").LayerOnSignature<import("ol/events").EventsKey>;
|
|
68
|
-
once: import("ol/layer/Layer").LayerOnSignature<import("ol/events").EventsKey>;
|
|
69
|
-
un: import("ol/layer/Layer").LayerOnSignature<void>;
|
|
70
|
-
render: (frameState: import("ol/Map").FrameState | null, target: HTMLElement) => HTMLElement | null;
|
|
71
|
-
getSource: () => import("ol/source").Source | null;
|
|
72
|
-
getRenderSource: () => import("ol/source").Source | null;
|
|
73
|
-
getFeatures: (pixel: import("ol/pixel").Pixel) => Promise<Array<import("ol/Feature").FeatureLike>>;
|
|
74
|
-
getData: (pixel: import("ol/pixel").Pixel) => Uint8ClampedArray | Uint8Array | Float32Array | DataView | null;
|
|
75
|
-
isVisible: (view?: import("ol").View | import("ol/View").ViewStateLayerStateExtent | undefined) => boolean;
|
|
76
|
-
getAttributions: (view?: import("ol").View | import("ol/View").ViewStateLayerStateExtent | undefined) => Array<string>;
|
|
77
|
-
unrender: () => void;
|
|
78
|
-
getDeclutter: () => string;
|
|
79
|
-
renderDeclutter: (frameState: import("ol/Map").FrameState, layerState: import("ol/layer/Layer").State) => void;
|
|
80
|
-
renderDeferred: (frameState: import("ol/Map").FrameState) => void;
|
|
81
|
-
getMapInternal: () => import("ol/Map").default | null;
|
|
82
|
-
setMap: (map: import("ol/Map").default | null) => void;
|
|
83
|
-
setSource: (source: import("ol/source").Source | null) => void;
|
|
84
|
-
getRenderer: () => import("ol/renderer/Layer").default<any> | null;
|
|
85
|
-
hasRenderer: () => boolean;
|
|
86
|
-
getBackground: () => import("ol/layer/Base").BackgroundColor | false;
|
|
87
|
-
getClassName: () => string;
|
|
88
|
-
getLayerState: (managed?: boolean | undefined) => import("ol/layer/Layer").State;
|
|
89
|
-
getLayersArray: (array?: import("ol/layer/Layer").default<import("ol/source").default, import("ol/renderer/Layer").default<any>>[] | undefined) => Array<import("ol/layer/Layer").default>;
|
|
90
|
-
getLayerStatesArray: (states?: import("ol/layer/Layer").State[] | undefined) => Array<import("ol/layer/Layer").State>;
|
|
91
|
-
getExtent: () => import("ol/extent").Extent | undefined;
|
|
92
|
-
getMaxResolution: () => number;
|
|
93
|
-
getMinResolution: () => number;
|
|
94
|
-
getMinZoom: () => number;
|
|
95
|
-
getMaxZoom: () => number;
|
|
96
|
-
getOpacity: () => number;
|
|
97
|
-
getSourceState: () => import("ol/source/Source").State;
|
|
98
|
-
getVisible: () => boolean;
|
|
99
|
-
getZIndex: () => number | undefined;
|
|
100
|
-
setBackground: (background?: import("ol/layer/Base").BackgroundColor | undefined) => void;
|
|
101
|
-
setExtent: (extent: import("ol/extent").Extent | undefined) => void;
|
|
102
|
-
setMaxResolution: (maxResolution: number) => void;
|
|
103
|
-
setMinResolution: (minResolution: number) => void;
|
|
104
|
-
setMaxZoom: (maxZoom: number) => void;
|
|
105
|
-
setMinZoom: (minZoom: number) => void;
|
|
106
|
-
setOpacity: (opacity: number) => void;
|
|
107
|
-
setVisible: (visible: boolean) => void;
|
|
108
|
-
setZIndex: (zindex: number) => void;
|
|
109
|
-
get: (key: string) => any;
|
|
110
|
-
getKeys: () => Array<string>;
|
|
111
|
-
getProperties: () => {
|
|
112
|
-
[x: string]: any;
|
|
113
|
-
};
|
|
114
|
-
getPropertiesInternal: () => {
|
|
115
|
-
[x: string]: any;
|
|
116
|
-
} | null;
|
|
117
|
-
hasProperties: () => boolean;
|
|
118
|
-
notify: (key: string, oldValue: any) => void;
|
|
119
|
-
addChangeListener: (key: string, listener: import("ol/events").Listener) => void;
|
|
120
|
-
removeChangeListener: (key: string, listener: import("ol/events").Listener) => void;
|
|
121
|
-
set: (key: string, value: any, silent?: boolean | undefined) => void;
|
|
122
|
-
setProperties: (values: {
|
|
123
|
-
[x: string]: any;
|
|
124
|
-
}, silent?: boolean | undefined) => void;
|
|
125
|
-
unset: (key: string, silent?: boolean | undefined) => void;
|
|
126
|
-
changed: () => void;
|
|
127
|
-
getRevision: () => number;
|
|
128
|
-
addEventListener: (type: string, listener: import("ol/events").Listener) => void;
|
|
129
|
-
dispatchEvent: (event: import("ol/events/Event").default | string) => boolean | undefined;
|
|
130
|
-
getListeners: (type: string) => Array<import("ol/events").Listener> | undefined;
|
|
131
|
-
hasListener: (type?: string | undefined) => boolean;
|
|
132
|
-
removeEventListener: (type: string, listener: import("ol/events").Listener) => void;
|
|
133
|
-
dispose: () => void;
|
|
134
|
-
};
|
|
135
|
-
} & TBase;
|
|
136
|
-
export default PropertiesLayerMixin;
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line max-classes-per-file
|
|
2
|
-
import debounce from 'lodash.debounce';
|
|
3
|
-
import { getUid } from 'ol';
|
|
4
|
-
import getLayersAsFlatArray from '../../common/utils/getLayersAsFlatArray';
|
|
5
|
-
let deprecated = () => { };
|
|
6
|
-
if (typeof window !== 'undefined' &&
|
|
7
|
-
new URLSearchParams(window.location.search).get('deprecated')) {
|
|
8
|
-
deprecated = debounce((message) => {
|
|
9
|
-
// eslint-disable-next-line no-console
|
|
10
|
-
console.warn(message);
|
|
11
|
-
}, 1000);
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* This mixin adds some properties to access ol custom properties easily.
|
|
15
|
-
*/
|
|
16
|
-
function PropertiesLayerMixin(Base) {
|
|
17
|
-
return class PropertiesLayer extends Base {
|
|
18
|
-
constructor(...args) {
|
|
19
|
-
var _a;
|
|
20
|
-
const options = args[0];
|
|
21
|
-
super(options);
|
|
22
|
-
this.olEventsKeys = [];
|
|
23
|
-
this.options = {};
|
|
24
|
-
if (options.properties) {
|
|
25
|
-
deprecated("Deprecated. Don't use properties options. Pass the values directly in options object.");
|
|
26
|
-
this.setProperties(options.properties);
|
|
27
|
-
}
|
|
28
|
-
(_a = this.olEventsKeys) === null || _a === void 0 ? void 0 : _a.push(
|
|
29
|
-
// Update parent property
|
|
30
|
-
this.on('propertychange', (evt) => {
|
|
31
|
-
if (evt.key === 'children') {
|
|
32
|
-
this.onChildrenChange(evt.oldValue);
|
|
33
|
-
}
|
|
34
|
-
}));
|
|
35
|
-
this.options = options;
|
|
36
|
-
this.set('children', options.children || []); // Trigger the on children change event
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Initialize the layer with the map passed in parameters.
|
|
40
|
-
*
|
|
41
|
-
* @param {ol/Map~Map} map A map.
|
|
42
|
-
*/
|
|
43
|
-
attachToMap(map) {
|
|
44
|
-
// @ts-expect-error attachToMap not necessarily exists
|
|
45
|
-
(super.attachToMap || (() => { }))(map);
|
|
46
|
-
(this.get('children') || []).forEach((child) => {
|
|
47
|
-
map.addLayer(child);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Terminate what was initialized in init function. Remove layer, events...
|
|
52
|
-
*/
|
|
53
|
-
detachFromMap() {
|
|
54
|
-
(this.get('children') || []).forEach((child) => {
|
|
55
|
-
this.map.removeLayer(child);
|
|
56
|
-
});
|
|
57
|
-
// @ts-expect-error detachToMap not necessarily exists
|
|
58
|
-
(super.detachFromMap || (() => { }))();
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Return the an array containing all the descendants of the layer in a flat array. Including the current layer.
|
|
62
|
-
* @deprecated
|
|
63
|
-
*/
|
|
64
|
-
flat() {
|
|
65
|
-
deprecated('Layer.flat is deprecated. Use getLayersAsFlatArray utils method instead.');
|
|
66
|
-
return getLayersAsFlatArray(this);
|
|
67
|
-
}
|
|
68
|
-
/** @private */
|
|
69
|
-
onChildrenChange(oldValue) {
|
|
70
|
-
// Set the parent property
|
|
71
|
-
(oldValue || []).forEach((child) => {
|
|
72
|
-
child.set('parent', undefined);
|
|
73
|
-
});
|
|
74
|
-
(this.get('children') || []).forEach((child) => {
|
|
75
|
-
child.set('parent', this);
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
// @ts-expect-error - this is a mixin
|
|
79
|
-
setMapInternal(map) {
|
|
80
|
-
super.setMapInternal(map);
|
|
81
|
-
if (map) {
|
|
82
|
-
this.attachToMap(map);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
this.detachFromMap();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
/** @deprecated */
|
|
89
|
-
get children() {
|
|
90
|
-
deprecated("Layer.children is deprecated. Use the Layer.get('children') method instead.");
|
|
91
|
-
return this.get('children') || [];
|
|
92
|
-
}
|
|
93
|
-
/** @deprecated */
|
|
94
|
-
set children(newValue) {
|
|
95
|
-
deprecated("Layer.children is deprecated. Use the Layer.set('children', children) method instead.");
|
|
96
|
-
this.set('children', newValue || []);
|
|
97
|
-
}
|
|
98
|
-
/** @deprecated */
|
|
99
|
-
get copyrights() {
|
|
100
|
-
deprecated('Layer.copyrights is deprecated. Get the attributions from the source object');
|
|
101
|
-
return this.get('copyrights');
|
|
102
|
-
}
|
|
103
|
-
/** @deprecated */
|
|
104
|
-
set copyrights(newCopyrights) {
|
|
105
|
-
deprecated('Layer.copyrights is deprecated. Set the attributions to the source object.');
|
|
106
|
-
const arrValue = newCopyrights && !Array.isArray(newCopyrights)
|
|
107
|
-
? [newCopyrights]
|
|
108
|
-
: newCopyrights;
|
|
109
|
-
this.set('copyrights', arrValue || []);
|
|
110
|
-
}
|
|
111
|
-
/** @deprecated */
|
|
112
|
-
get disabled() {
|
|
113
|
-
deprecated("Layer.disabled is deprecated. Use the Layer.get('disabled') method instead.");
|
|
114
|
-
return this.get('disabled');
|
|
115
|
-
}
|
|
116
|
-
/** @deprecated */
|
|
117
|
-
set disabled(newValue) {
|
|
118
|
-
deprecated("Layer.disabled is deprecated. Use the Layer.set('disabled', newValue) method instead.");
|
|
119
|
-
this.set('disabled', newValue);
|
|
120
|
-
}
|
|
121
|
-
/** @deprecated */
|
|
122
|
-
/** @deprecated */
|
|
123
|
-
get group() {
|
|
124
|
-
deprecated("Layer.group is deprecated. Use the Layer.get('group') method instead.");
|
|
125
|
-
return this.get('group');
|
|
126
|
-
}
|
|
127
|
-
/** @deprecated */
|
|
128
|
-
get hitTolerance() {
|
|
129
|
-
deprecated('Layer.hitTolerance is deprecated.Pass the hitTolerance when you request the features.');
|
|
130
|
-
return this.get('hitTolerance') || 5;
|
|
131
|
-
}
|
|
132
|
-
get key() {
|
|
133
|
-
return this.get('key') || this.get('name') || getUid(this);
|
|
134
|
-
}
|
|
135
|
-
get map() {
|
|
136
|
-
return this.getMapInternal();
|
|
137
|
-
}
|
|
138
|
-
/** @deprecated */
|
|
139
|
-
get name() {
|
|
140
|
-
deprecated("Layer.name is deprecated. Use the Layer.get('name') method instead.");
|
|
141
|
-
return this.get('name');
|
|
142
|
-
}
|
|
143
|
-
/** @deprecated */
|
|
144
|
-
get olLayer() {
|
|
145
|
-
deprecated("Layer.olLayer is deprecated. mobility-toolbox-js/ol layers inherits now from ol/layer/Layer class. This getter is only a redirect to the current 'this' object.");
|
|
146
|
-
return this;
|
|
147
|
-
}
|
|
148
|
-
// eslint-disable-next-line class-methods-use-this
|
|
149
|
-
set olLayer(newValue) {
|
|
150
|
-
deprecated('Layer.olLayer is deprecated. mobility-toolbox-js/ol layers inherits now from ol/layer/Layer class. This setter has no effect.');
|
|
151
|
-
}
|
|
152
|
-
/** @deprecated */
|
|
153
|
-
// get olListenersKeys(): EventsKey[] {
|
|
154
|
-
// return this.olEventsKeys;
|
|
155
|
-
// }
|
|
156
|
-
/** @deprecated */
|
|
157
|
-
get parent() {
|
|
158
|
-
deprecated("Layer.parent is deprecated. Use the Layer.get('parent') method instead.");
|
|
159
|
-
return this.get('parent');
|
|
160
|
-
}
|
|
161
|
-
/** @deprecated */
|
|
162
|
-
set parent(newValue) {
|
|
163
|
-
deprecated("Layer.parent is deprecated. Use the Layer.set('parent', parent) method instead.");
|
|
164
|
-
this.set('parent', newValue);
|
|
165
|
-
}
|
|
166
|
-
/** @deprecated */
|
|
167
|
-
get visible() {
|
|
168
|
-
deprecated('Layer.visible is deprecated. Use the Layer.getVisible() method instead.');
|
|
169
|
-
return this.getVisible();
|
|
170
|
-
}
|
|
171
|
-
/** @deprecated */
|
|
172
|
-
set visible(newValue) {
|
|
173
|
-
deprecated('Layer.visible is deprecated. Use the Layer.setVisible(newValue) method instead.');
|
|
174
|
-
this.setVisible(newValue);
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
export default PropertiesLayerMixin;
|
package/ol/mixins/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as MobilityLayerMixin } from './MobilityLayerMixin';
|
package/ol/mixins/index.js
DELETED