mobility-toolbox-js 2.0.0-beta.30 → 2.0.0-beta.34
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/RealtimeAPI.d.ts +268 -0
- package/api/RealtimeAPI.d.ts.map +1 -0
- package/api/RealtimeAPI.js +626 -343
- package/api/RoutingAPI.d.ts +33 -0
- package/api/RoutingAPI.d.ts.map +1 -0
- package/api/RoutingAPI.js +65 -15
- package/api/StopsAPI.d.ts +36 -0
- package/api/StopsAPI.d.ts.map +1 -0
- package/api/StopsAPI.js +70 -12
- package/api/index.d.ts +5 -0
- package/api/index.d.ts.map +1 -0
- package/api/index.js +10 -3
- package/api/typedefs.d.ts +105 -0
- package/api/typedefs.d.ts.map +1 -0
- package/api/typedefs.js +72 -0
- package/common/api/HttpAPI.d.ts +31 -0
- package/common/api/HttpAPI.d.ts.map +1 -0
- package/common/api/HttpAPI.js +82 -30
- package/common/api/WebSocketAPI.d.ts +95 -0
- package/common/api/WebSocketAPI.d.ts.map +1 -0
- package/common/api/WebSocketAPI.js +313 -168
- package/common/controls/Control.d.ts +74 -0
- package/common/controls/Control.d.ts.map +1 -0
- package/common/controls/Control.js +167 -78
- package/common/index.d.ts +3 -0
- package/common/index.d.ts.map +1 -0
- package/common/index.js +18 -2
- package/common/layers/Layer.d.ts +80 -0
- package/common/layers/Layer.d.ts.map +1 -0
- package/common/layers/Layer.js +251 -134
- package/common/mixins/CopyrightMixin.d.ts +22 -0
- package/common/mixins/CopyrightMixin.d.ts.map +1 -0
- package/common/mixins/CopyrightMixin.js +70 -22
- package/common/mixins/MapboxLayerMixin.d.ts +27 -0
- package/common/mixins/MapboxLayerMixin.d.ts.map +1 -0
- package/common/mixins/MapboxLayerMixin.js +240 -0
- package/common/mixins/RealtimeLayerMixin.d.ts +58 -0
- package/common/mixins/RealtimeLayerMixin.d.ts.map +1 -0
- package/common/mixins/RealtimeLayerMixin.js +698 -429
- package/common/mixins/StopFinderMixin.d.ts +40 -0
- package/common/mixins/StopFinderMixin.d.ts.map +1 -0
- package/common/mixins/StopFinderMixin.js +195 -107
- package/common/mixins/UserInteractionsLayerMixin.d.ts +42 -0
- package/common/mixins/UserInteractionsLayerMixin.d.ts.map +1 -0
- package/common/mixins/UserInteractionsLayerMixin.js +222 -121
- package/common/styles/index.d.ts +5 -0
- package/common/styles/index.d.ts.map +1 -0
- package/common/styles/index.js +24 -4
- package/common/styles/realtimeDefaultStyle.d.ts +15 -0
- package/common/styles/realtimeDefaultStyle.d.ts.map +1 -0
- package/common/styles/realtimeDefaultStyle.js +236 -190
- package/common/styles/realtimeDelayStyle.d.ts +11 -0
- package/common/styles/realtimeDelayStyle.d.ts.map +1 -0
- package/common/styles/realtimeDelayStyle.js +25 -7
- package/common/styles/realtimeSimpleStyle.d.ts +3 -0
- package/common/styles/realtimeSimpleStyle.d.ts.map +1 -0
- package/common/styles/realtimeSimpleStyle.js +23 -17
- package/common/typedefs.d.ts +50 -0
- package/common/typedefs.d.ts.map +1 -0
- package/common/typedefs.js +21 -0
- package/common/utils/cleanStopTime.d.ts +7 -0
- package/common/utils/cleanStopTime.d.ts.map +1 -0
- package/common/utils/cleanStopTime.js +28 -17
- package/common/utils/compareDepartures.d.ts +9 -0
- package/common/utils/compareDepartures.d.ts.map +1 -0
- package/common/utils/compareDepartures.js +34 -22
- package/common/utils/createCanvas.d.ts +9 -0
- package/common/utils/createCanvas.d.ts.map +1 -0
- package/common/utils/createCanvas.js +28 -16
- package/common/utils/createTrackerFilters.d.ts +12 -0
- package/common/utils/createTrackerFilters.d.ts.map +1 -0
- package/common/utils/createTrackerFilters.js +75 -54
- package/common/utils/getLayersAsFlatArray.d.ts +3 -0
- package/common/utils/getLayersAsFlatArray.d.ts.map +1 -0
- package/common/utils/getLayersAsFlatArray.js +15 -13
- package/common/utils/getMapboxMapCopyrights.d.ts +8 -0
- package/common/utils/getMapboxMapCopyrights.d.ts.map +1 -0
- package/common/utils/getMapboxMapCopyrights.js +24 -17
- package/common/utils/getMapboxRender.d.ts +5 -0
- package/common/utils/getMapboxRender.d.ts.map +1 -0
- package/common/utils/getMapboxRender.js +77 -0
- package/common/utils/getMaplibreRender.d.ts +5 -0
- package/common/utils/getMaplibreRender.d.ts.map +1 -0
- package/common/utils/getMaplibreRender.js +38 -0
- package/common/utils/getRealtimeModeSuffix.d.ts +8 -0
- package/common/utils/getRealtimeModeSuffix.d.ts.map +1 -0
- package/common/utils/getRealtimeModeSuffix.js +11 -2
- package/common/utils/getUrlWithParams.d.ts +9 -0
- package/common/utils/getUrlWithParams.d.ts.map +1 -0
- package/common/utils/getUrlWithParams.js +20 -10
- package/common/utils/getVehiclePosition.d.ts +14 -0
- package/common/utils/getVehiclePosition.d.ts.map +1 -0
- package/common/utils/getVehiclePosition.js +63 -39
- package/common/utils/index.d.ts +12 -0
- package/common/utils/index.d.ts.map +1 -0
- package/common/utils/index.js +37 -9
- package/common/utils/removeDuplicate.d.ts +10 -0
- package/common/utils/removeDuplicate.d.ts.map +1 -0
- package/common/utils/removeDuplicate.js +29 -7
- package/common/utils/renderTrajectories.d.ts +20 -0
- package/common/utils/renderTrajectories.d.ts.map +1 -0
- package/common/utils/renderTrajectories.js +111 -78
- package/common/utils/sortByDelay.d.ts +3 -0
- package/common/utils/sortByDelay.d.ts.map +1 -0
- package/common/utils/sortByDelay.js +21 -17
- package/common/utils/timeUtils.d.ts +5 -0
- package/common/utils/timeUtils.d.ts.map +1 -0
- package/common/utils/timeUtils.js +47 -18
- package/common/utils/trackerConfig.d.ts +24 -0
- package/common/utils/trackerConfig.d.ts.map +1 -0
- package/common/utils/trackerConfig.js +171 -118
- package/iife.d.ts +3 -0
- package/iife.d.ts.map +1 -0
- package/iife.js +7 -0
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +10 -7
- package/mapbox/controls/CopyrightControl.d.ts +32 -0
- package/mapbox/controls/CopyrightControl.d.ts.map +1 -0
- package/mapbox/controls/CopyrightControl.js +72 -28
- package/mapbox/controls/index.d.ts +2 -0
- package/mapbox/controls/index.d.ts.map +1 -0
- package/mapbox/controls/index.js +6 -1
- package/mapbox/index.d.ts +5 -0
- package/mapbox/index.d.ts.map +1 -0
- package/mapbox/index.js +20 -4
- package/mapbox/layers/Layer.d.ts +47 -0
- package/mapbox/layers/Layer.d.ts.map +1 -0
- package/mapbox/layers/Layer.js +137 -54
- package/mapbox/layers/RealtimeLayer.d.ts +118 -0
- package/mapbox/layers/RealtimeLayer.d.ts.map +1 -0
- package/mapbox/layers/RealtimeLayer.js +310 -183
- package/mapbox/layers/index.d.ts +3 -0
- package/mapbox/layers/index.d.ts.map +1 -0
- package/mapbox/layers/index.js +7 -2
- package/mapbox/utils.d.ts +8 -0
- package/mapbox/utils.d.ts.map +1 -0
- package/mapbox/utils.js +54 -29
- package/mbt.js +2052 -2109
- package/mbt.js.map +3 -3
- package/mbt.min.js +18 -18
- package/mbt.min.js.map +3 -3
- package/ol/controls/CopyrightControl.d.ts +31 -0
- package/ol/controls/CopyrightControl.d.ts.map +1 -0
- package/ol/controls/CopyrightControl.js +89 -41
- package/ol/controls/RoutingControl.d.ts +180 -0
- package/ol/controls/RoutingControl.d.ts.map +1 -0
- package/ol/controls/RoutingControl.js +666 -371
- package/ol/controls/StopFinderControl.d.ts +32 -0
- package/ol/controls/StopFinderControl.d.ts.map +1 -0
- package/ol/controls/StopFinderControl.js +59 -10
- package/ol/controls/index.d.ts +4 -0
- package/ol/controls/index.d.ts.map +1 -0
- package/ol/controls/index.js +9 -3
- package/ol/index.d.ts +6 -0
- package/ol/index.d.ts.map +1 -0
- package/ol/index.js +21 -5
- package/ol/layers/Layer.d.ts +49 -0
- package/ol/layers/Layer.d.ts.map +1 -0
- package/ol/layers/Layer.js +178 -81
- package/ol/layers/MapboxLayer.d.ts +42 -0
- package/ol/layers/MapboxLayer.d.ts.map +1 -0
- package/ol/layers/MapboxLayer.js +131 -198
- package/ol/layers/MapboxStyleLayer.d.ts +146 -0
- package/ol/layers/MapboxStyleLayer.d.ts.map +1 -0
- package/ol/layers/MapboxStyleLayer.js +382 -186
- package/ol/layers/MaplibreLayer.d.ts +27 -0
- package/ol/layers/MaplibreLayer.d.ts.map +1 -0
- package/ol/layers/MaplibreLayer.js +67 -138
- package/ol/layers/RealtimeLayer.d.ts +119 -0
- package/ol/layers/RealtimeLayer.d.ts.map +1 -0
- package/ol/layers/RealtimeLayer.js +327 -184
- package/ol/layers/RoutingLayer.d.ts +24 -0
- package/ol/layers/RoutingLayer.d.ts.map +1 -0
- package/ol/layers/RoutingLayer.js +111 -56
- package/ol/layers/VectorLayer.d.ts +23 -0
- package/ol/layers/VectorLayer.d.ts.map +1 -0
- package/ol/layers/VectorLayer.js +71 -21
- package/ol/layers/WMSLayer.d.ts +38 -0
- package/ol/layers/WMSLayer.d.ts.map +1 -0
- package/ol/layers/WMSLayer.js +105 -37
- package/ol/layers/index.d.ts +9 -0
- package/ol/layers/index.d.ts.map +1 -0
- package/ol/layers/index.js +19 -8
- package/ol/styles/fullTrajectoryDelayStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryDelayStyle.js +32 -28
- package/ol/styles/fullTrajectoryStyle.d.ts +4 -0
- package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -0
- package/ol/styles/fullTrajectoryStyle.js +44 -40
- package/ol/styles/index.d.ts +3 -0
- package/ol/styles/index.d.ts.map +1 -0
- package/ol/styles/index.js +7 -2
- package/package.json +14 -36
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -0
- package/setupTests.js +15 -0
- package/types/index.d.ts +7 -6
- package/types/routing.d.ts +25 -25
- package/types/stops.d.ts +19 -19
- package/api/RealtimeAPI.test.js +0 -67
- package/api/RoutingAPI.test.js +0 -25
- package/api/StopsAPI.test.js +0 -22
- package/common/api/HttpAPI.test.js +0 -50
- package/common/api/WebSocketAPI.test.js +0 -311
- package/common/controls/Control.test.js +0 -87
- package/common/layers/Layer.test.js +0 -134
- package/common/mixins/UserInteractionsLayerMixin.test.js +0 -199
- package/common/utils/createTrackerFilters.test.js +0 -79
- package/common/utils/getMapboxMapCopyrights.test.js +0 -40
- package/common/utils/removeDuplicate.test.js +0 -19
- package/common/utils/timeUtils.test.js +0 -10
- package/common/utils/trackerConfig.test.js +0 -23
- package/mapbox/layers/Layer.test.js +0 -182
- package/mapbox/layers/RealtimeLayer.test.js +0 -10
- package/ol/controls/CopyrightControl.test.js +0 -165
- package/ol/controls/RoutingControl.test.js +0 -146
- package/ol/controls/StopFinderControl.test.js +0 -48
- package/ol/layers/Layer.test.js +0 -175
- package/ol/layers/MapboxLayer.test.js +0 -160
- package/ol/layers/MapboxStyleLayer.test.js +0 -226
- package/ol/layers/RealtimeLayer.test.js +0 -67
- package/ol/layers/RoutingLayer.test.js +0 -39
- package/ol/layers/VectorLayer.test.js +0 -76
- package/ol/layers/WMSLayer.test.js +0 -57
|
@@ -1,81 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
...options
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
9
8
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} else {
|
|
24
|
-
this.deactivate();
|
|
25
|
-
}
|
|
26
|
-
this.render();
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
27
23
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
var Object_1 = require("ol/Object");
|
|
30
|
+
/**
|
|
31
|
+
* A class representing a control to display on map.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const control = new Control();
|
|
35
|
+
*
|
|
36
|
+
* @classproperty {ol/Map~Map|mapboxgl.Map} map - The map which the control refers to.
|
|
37
|
+
* @classproperty {boolean} active - Active the control.
|
|
38
|
+
* @classproperty {HTMLElement} element - The HTML element used to render the control.
|
|
39
|
+
* @classproperty {HTMLElement} target - The HTML element where to render the element property. Default is the map's element. Read only.
|
|
40
|
+
*/
|
|
41
|
+
var Control = /** @class */ (function (_super) {
|
|
42
|
+
__extends(Control, _super);
|
|
43
|
+
/**
|
|
44
|
+
* Constructor
|
|
45
|
+
*
|
|
46
|
+
* @param {Object} [options] Control options.
|
|
47
|
+
* @param {boolean} [options.active = true] Whether the control is active or not.
|
|
48
|
+
* @param {HTMLElement} [options.element] The HTML element used to render the control.
|
|
49
|
+
* @param {HTMLElement} [options.target] The HTML element where to render the element property. Default is the map's element.
|
|
50
|
+
* @param {function} [options.render] Render function called whenever the control needs to be rerendered.
|
|
51
|
+
*/
|
|
52
|
+
function Control(options) {
|
|
53
|
+
if (options === void 0) { options = {}; }
|
|
54
|
+
var _this = _super.call(this, options) || this;
|
|
55
|
+
_this.defineProperties(options);
|
|
56
|
+
var active = __assign({ active: options.active !== false }, options).active;
|
|
57
|
+
/**
|
|
58
|
+
* @ignore
|
|
59
|
+
*/
|
|
60
|
+
_this.active = active;
|
|
61
|
+
return _this;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Define control's properties.
|
|
65
|
+
*
|
|
66
|
+
* @private
|
|
67
|
+
*/
|
|
68
|
+
Control.prototype.defineProperties = function (options) {
|
|
69
|
+
var _this = this;
|
|
70
|
+
var _a = __assign({}, options), target = _a.target, element = _a.element, render = _a.render;
|
|
71
|
+
Object.defineProperties(this, {
|
|
72
|
+
active: {
|
|
73
|
+
get: function () { return _this.get('active'); },
|
|
74
|
+
set: function (newActive) {
|
|
75
|
+
_this.set('active', newActive);
|
|
76
|
+
if (newActive) {
|
|
77
|
+
_this.activate();
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
_this.deactivate();
|
|
81
|
+
}
|
|
82
|
+
_this.render();
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
map: {
|
|
86
|
+
get: function () { return _this.get('map'); },
|
|
87
|
+
set: function (map) {
|
|
88
|
+
// Remove previous node.
|
|
89
|
+
if (_this.map && _this.element && _this.element.parentNode) {
|
|
90
|
+
_this.element.parentNode.removeChild(_this.element);
|
|
91
|
+
}
|
|
92
|
+
// Clean listeners
|
|
93
|
+
_this.deactivate();
|
|
94
|
+
_this.set('map', map);
|
|
95
|
+
if (_this.map) {
|
|
96
|
+
// Add new node
|
|
97
|
+
var targett = _this.target ||
|
|
98
|
+
(_this.map.getTargetElement && _this.map.getTargetElement()) ||
|
|
99
|
+
(_this.map.getContainer && _this.map.getContainer());
|
|
100
|
+
if (!_this.element) {
|
|
101
|
+
_this.createDefaultElement();
|
|
102
|
+
}
|
|
103
|
+
if (_this.element) {
|
|
104
|
+
targett.appendChild(_this.element);
|
|
105
|
+
}
|
|
106
|
+
// Add listeners
|
|
107
|
+
if (_this.active) {
|
|
108
|
+
_this.activate();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
_this.render();
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
target: {
|
|
115
|
+
value: target,
|
|
116
|
+
},
|
|
117
|
+
element: {
|
|
118
|
+
value: element,
|
|
119
|
+
writable: true,
|
|
120
|
+
},
|
|
121
|
+
render: {
|
|
122
|
+
/** @ignore */
|
|
123
|
+
value: render || this.render,
|
|
124
|
+
writable: true,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Attach the control to the map. Add events, html element ...
|
|
130
|
+
*/
|
|
131
|
+
Control.prototype.attachToMap = function (map) {
|
|
132
|
+
this.map = map;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Detach the control From the map. Remove events, html element ..
|
|
136
|
+
*/
|
|
137
|
+
Control.prototype.detachFromMap = function () {
|
|
138
|
+
this.map = null;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Add listeners then renders the control.
|
|
142
|
+
* To be defined in inherited classes.
|
|
143
|
+
*/
|
|
144
|
+
Control.prototype.activate = function () {
|
|
145
|
+
this.deactivate();
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Remove listeners added by activate() function then renders the control.
|
|
149
|
+
* To be defined in inherited classes.
|
|
150
|
+
*/
|
|
151
|
+
// eslint-disable-next-line class-methods-use-this
|
|
152
|
+
Control.prototype.deactivate = function () { };
|
|
153
|
+
/**
|
|
154
|
+
* The default render function. It renders content in the HTML element.
|
|
155
|
+
* To be defined in inherited classes.
|
|
156
|
+
*
|
|
157
|
+
* @private
|
|
158
|
+
*/
|
|
159
|
+
Control.prototype.render = function () { };
|
|
160
|
+
/**
|
|
161
|
+
* The default element to display if this.element is not defined.
|
|
162
|
+
* To be defined in inherited classes.
|
|
163
|
+
*
|
|
164
|
+
* @private
|
|
165
|
+
*/
|
|
166
|
+
// eslint-disable-next-line class-methods-use-this
|
|
167
|
+
Control.prototype.createDefaultElement = function () { };
|
|
168
|
+
return Control;
|
|
169
|
+
}(Object_1.default));
|
|
170
|
+
exports.default = Control;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.js"],"names":[],"mappings":""}
|
package/common/index.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./utils"), exports);
|
|
18
|
+
__exportStar(require("./styles"), exports);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A class representing a layer to display on map.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* const layer = new Layer({
|
|
6
|
+
* name: 'My Layer',
|
|
7
|
+
* });
|
|
8
|
+
*
|
|
9
|
+
* @classproperty {string} key - Identifier of the layer. Must be unique.
|
|
10
|
+
* @classproperty {string} name - Name of the layer
|
|
11
|
+
* @classproperty {string[]} copyrights - Array of copyrights.
|
|
12
|
+
* @classproperty {Layer[]} children - List of children layers.
|
|
13
|
+
* @classproperty {boolean} visible - Define if the layer is currently display on the map.
|
|
14
|
+
* @classproperty {boolean} disabled - Define if the layer is currently display on the map but can't be seen (extent, zoom ,data restrictions).
|
|
15
|
+
* @classproperty {number} hitTolerance - Hit-detection tolerance in css pixels. Pixels inside the radius around the given position will be checked for features.
|
|
16
|
+
* @classproperty {Object} properties - Custom properties.
|
|
17
|
+
* @classproperty {ol/Map~Map|mapboxgl.Map} map - The map where the layer is displayed.
|
|
18
|
+
*/
|
|
19
|
+
export default class Layer extends BaseObject {
|
|
20
|
+
/**
|
|
21
|
+
* Constructor
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} options
|
|
24
|
+
* @param {string} [options.key=uuid()] Identifier of the layer. Muste be unique. Default use a generated uuid.
|
|
25
|
+
* @param {string} [options.name] Name of the layer.
|
|
26
|
+
* @param {string[]} [options.copyrights] Array of copyrights.
|
|
27
|
+
* @param {Array<Layer>} [options.children=[]] Sublayers, all child layers will have a parent property associated to this layer.
|
|
28
|
+
* @param {boolean} [options.visible=true] Define if the layer is currently display on the map.
|
|
29
|
+
* @param {boolean} [options.disabled=false] Define if the layer is currently display on the map but can't be seen (extent, zoom ,data restrictions).
|
|
30
|
+
* @param {number} [options.hitTolerance=5] Hit-detection tolerance in css pixels. Pixels inside the radius around the given position will be checked for features.
|
|
31
|
+
* @param {Object} [options.properties={}] Application-specific layer properties.
|
|
32
|
+
*/
|
|
33
|
+
constructor(options?: {
|
|
34
|
+
key?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
copyrights?: string[];
|
|
37
|
+
children?: Array<Layer>;
|
|
38
|
+
visible?: boolean;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
hitTolerance?: number;
|
|
41
|
+
properties?: any;
|
|
42
|
+
});
|
|
43
|
+
visible: boolean;
|
|
44
|
+
group: any;
|
|
45
|
+
copyrights: string[];
|
|
46
|
+
children: Layer[];
|
|
47
|
+
/**
|
|
48
|
+
* Define layer's properties that needs custom get and set.
|
|
49
|
+
*
|
|
50
|
+
* @ignore
|
|
51
|
+
*/
|
|
52
|
+
defineProperties(options: any): void;
|
|
53
|
+
/**
|
|
54
|
+
* Initialize the layer with the map passed in parameters.
|
|
55
|
+
*
|
|
56
|
+
* @param {ol/Map~Map|mapboxgl.Map} map A map.
|
|
57
|
+
*/
|
|
58
|
+
attachToMap(map: any): void;
|
|
59
|
+
/** @ignore */
|
|
60
|
+
map: any;
|
|
61
|
+
/**
|
|
62
|
+
* Terminate what was initialized in init function. Remove layer, events...
|
|
63
|
+
*/
|
|
64
|
+
detachFromMap(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Request feature information for a given coordinate.
|
|
67
|
+
* This function must be implemented by inheriting layers.
|
|
68
|
+
*
|
|
69
|
+
* @param {ol/coordinate~Coordinate} coordinate Coordinate.
|
|
70
|
+
* @param {Object} options Some options. See child classes to see which are supported.
|
|
71
|
+
* @return {Promise<FeatureInfo>} An empty response.
|
|
72
|
+
*/
|
|
73
|
+
getFeatureInfoAtCoordinate(coordinate: any, options: any): Promise<FeatureInfo>;
|
|
74
|
+
/**
|
|
75
|
+
* Return the an array containing all the descendants of the layer in a flat array. Including the current layer.
|
|
76
|
+
*/
|
|
77
|
+
flat(): any[];
|
|
78
|
+
}
|
|
79
|
+
import BaseObject from "ol/Object";
|
|
80
|
+
//# sourceMappingURL=Layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["../../../src/common/layers/Layer.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACE;;;;;;;;;;;;OAYG;IACH;QAT4B,GAAG,GAApB,MAAM;QACW,IAAI,GAArB,MAAM;QACa,UAAU,GAA7B,MAAM,EAAE;QACe,QAAQ,GAA/B,MAAM,KAAK,CAAC;QACM,OAAO,GAAzB,OAAO;QACW,QAAQ,GAA1B,OAAO;QACU,YAAY,GAA7B,MAAM;QACW,UAAU;OA+BrC;IAvBC,iBAAuE;IAEvE,WAA0B;IAE1B,qBAAoC;IAEpC,kBAAgC;IAmBlC;;;;OAIG;IACH,qCA0HC;IAED;;;;OAIG;IACH,4BAUC;IARC,cAAc;IACd,SAAc;IAShB;;OAEG;IAEH,sBAGC;IAED;;;;;;;OAOG;IAEH,2DAHY,QAAQ,WAAW,CAAC,CAiB/B;IAED;;OAEG;IACH,cAEC;CACF"}
|