mobility-toolbox-js 2.0.0-beta.47 → 2.0.0-beta.49

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.
Files changed (55) hide show
  1. package/common/controls/ControlCommon.d.ts.map +1 -1
  2. package/common/controls/ControlCommon.js +3 -3
  3. package/common/controls/StopFinderControlCommon.d.ts +1 -0
  4. package/common/controls/StopFinderControlCommon.d.ts.map +1 -1
  5. package/common/controls/StopFinderControlCommon.js +3 -2
  6. package/common/utils/getMapboxRender.d.ts +2 -2
  7. package/common/utils/getMapboxRender.d.ts.map +1 -1
  8. package/common/utils/getMapboxRender.js +20 -11
  9. package/mapbox/index.d.ts +1 -0
  10. package/mapbox/index.js +1 -0
  11. package/mapbox/layers/Layer.d.ts +19 -7
  12. package/mapbox/layers/Layer.d.ts.map +1 -1
  13. package/mapbox/layers/Layer.js +8 -4
  14. package/mapbox/layers/RealtimeLayer.d.ts +112 -53
  15. package/mapbox/layers/RealtimeLayer.d.ts.map +1 -1
  16. package/mapbox/layers/RealtimeLayer.js +14 -8
  17. package/mapbox/utils/getMercatorResolution.d.ts +9 -0
  18. package/mapbox/utils/getMercatorResolution.d.ts.map +1 -0
  19. package/mapbox/utils/getMercatorResolution.js +18 -0
  20. package/mapbox/utils/getSourceCoordinates.d.ts +9 -0
  21. package/mapbox/utils/getSourceCoordinates.d.ts.map +1 -0
  22. package/mapbox/{utils.js → utils/getSourceCoordinates.js} +6 -22
  23. package/mapbox/utils/index.d.ts +3 -0
  24. package/mapbox/utils/index.d.ts.map +1 -0
  25. package/mapbox/utils/index.js +2 -0
  26. package/mbt.js +116 -84
  27. package/mbt.js.map +3 -3
  28. package/mbt.min.js +13 -13
  29. package/mbt.min.js.map +3 -3
  30. package/ol/controls/CopyrightControl.d.ts.map +1 -1
  31. package/ol/controls/CopyrightControl.js +0 -1
  32. package/ol/controls/RoutingControl.d.ts +1 -0
  33. package/ol/controls/RoutingControl.d.ts.map +1 -1
  34. package/ol/controls/RoutingControl.js +1 -1
  35. package/ol/controls/StopFinderControl.d.ts.map +1 -1
  36. package/ol/layers/Layer.d.ts +4 -16
  37. package/ol/layers/Layer.d.ts.map +1 -1
  38. package/ol/layers/MapboxLayer.d.ts +11 -1
  39. package/ol/layers/MapboxLayer.d.ts.map +1 -1
  40. package/ol/layers/MapboxLayer.js +4 -4
  41. package/ol/layers/MapboxStyleLayer.d.ts +55 -78
  42. package/ol/layers/MapboxStyleLayer.d.ts.map +1 -1
  43. package/ol/layers/MapboxStyleLayer.js +63 -32
  44. package/ol/layers/VectorLayer.d.ts +6 -4
  45. package/ol/layers/VectorLayer.d.ts.map +1 -1
  46. package/ol/layers/WMSLayer.d.ts +15 -11
  47. package/ol/layers/WMSLayer.d.ts.map +1 -1
  48. package/ol/layers/WMSLayer.js +25 -9
  49. package/ol/styles/fullTrajectoryDelayStyle.d.ts +2 -2
  50. package/ol/styles/fullTrajectoryDelayStyle.d.ts.map +1 -1
  51. package/ol/styles/fullTrajectoryStyle.d.ts.map +1 -1
  52. package/package.json +1 -1
  53. package/types/common.d.ts +1 -0
  54. package/mapbox/utils.d.ts +0 -8
  55. package/mapbox/utils.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CopyrightControl.d.ts","sourceRoot":"","sources":["../../../src/ol/controls/CopyrightControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,sBAAsB,MAAM,8CAA8C,CAAC;AAGlF;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAM,gBAAiB,SAAQ,sBAAsB;IACnD,UAAU,CAAC,EAAE,UAAU,CAAC;gBAEZ,OAAO,EAAE,GAAG;IAKxB,aAAa;IAyBb,QAAQ;IAOR,UAAU;IAOV,YAAY,CAAC,GAAG,EAAE,QAAQ;CAS3B;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"CopyrightControl.d.ts","sourceRoot":"","sources":["../../../src/ol/controls/CopyrightControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,sBAAsB,MAAM,8CAA8C,CAAC;AAGlF;;;;;;;;;;;;;;;;;GAiBG;AACH,cAAM,gBAAiB,SAAQ,sBAAsB;IACnD,UAAU,CAAC,EAAE,UAAU,CAAC;gBAEZ,OAAO,EAAE,GAAG;IAKxB,aAAa;IAyBb,QAAQ;IAOR,UAAU;IAMV,YAAY,CAAC,GAAG,EAAE,QAAQ;CAS3B;AAED,eAAe,gBAAgB,CAAC"}
@@ -54,7 +54,6 @@ class CopyrightControl extends CopyrightControlCommon {
54
54
  if (this.map) {
55
55
  this.map.un('postrender', this.onPostRender);
56
56
  }
57
- super.deactivate();
58
57
  }
59
58
  onPostRender(evt) {
60
59
  if (this.map && this.element) {
@@ -181,6 +181,7 @@ declare class RoutingControl implements RoutingInterface {
181
181
  /** @ignore */
182
182
  graphsResolutions: any;
183
183
  deactivate(): void;
184
+ render(): void;
184
185
  }
185
186
  import { RoutingAPI } from "../../api";
186
187
  import { Feature } from "ol";
@@ -1 +1 @@
1
- {"version":3,"file":"RoutingControl.d.ts","sourceRoot":"","sources":["../../../src/ol/controls/RoutingControl.js"],"names":[],"mappings":";AAiDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wCAFgB,gBAAgB;IAoH9B;;;;OAIG;IACH,oCAMC;IA5HD,0BA+GC;IAlFC,qDAAqD;IACrD,iBAAoB;IAEpB,cAAc;IACd,YAAgD;IAEhD,cAAc;IACd,SAA+B;IAE/B,cAAc;IACd,gBAAsC;IAEtC,cAAc;IACd,sBAAsD;IAEtD,cAAc;IACd,qBAAuD;IAEvD,cAAc;IACd,0BAAiE;IAEjE,cAAc;IACd,qBAA0B;IAE1B,cAAc;IACd,wBAA0B;IAE1B,cAAc;IACd,YAA4B;IAE5B,cAAc;IACd,iBAAqD;IAErD,cAAc;IACd,gBAAkB;IAElB,cAAc;IACd,iBAA0E;IAE1E,cAAc;IACd,gBAEE;IAEF,cAAc;IACd,kBAKI;IAEJ,cAAc;IACd,kBAUI;IAEJ,cAAc;IACd,iBAAmB;IAoXrB;;;;;OAKG;IACH,mBAeC;IA4CD;;;;;OAKG;IACH,oBAqBC;IArED;;;;OAIG;IACH,sBAmCC;IAxaC,cAAc;IACd,2KAA+C;IAmBjD;;;;;;;;;OASG;IACH,wGAYC;IAED;;;;OAIG;IACH,uBAFW,MAAM,QAYhB;IAED;;;OAGG;IACH,8BAFW,MAAM,MAAM,MAAM,CAAC,CAAC,QAS9B;IAED;;OAEG;IACH,cASC;IAED;;;OAGG;IACH,sBAeC;IAED;;;;;;OAMG;IACH,kBA0HC;IAED;;;;OAIG;IACH,qBAkHC;IA2DC,cAAc;IACd;;;;kBAIC;IAgCH;;;;OAIG;IACH,6BAYC;IAXC,cAAc;IACd,uCAA+C;IAYjD;;;OAGG;IACH,gCA8BC;IA7BC;;;OAGG;IAEH,0BAoBE;IAMJ;;;OAGG;IACH,qBAOC;IAFC,cAAc;IACd,mBAAgE;IAGlE;;;OAGG;IACH,wBAEC;IAED,iBA2BC;IAxBG,cAAc;IACd,4BAEE;IAEF,cAAc;IACd,uBAGC;IAiBL,mBASC;CACF"}
1
+ {"version":3,"file":"RoutingControl.d.ts","sourceRoot":"","sources":["../../../src/ol/controls/RoutingControl.js"],"names":[],"mappings":";AAiDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wCAFgB,gBAAgB;IAoH9B;;;;OAIG;IACH,oCAMC;IA5HD,0BA+GC;IAlFC,qDAAqD;IACrD,iBAAoB;IAEpB,cAAc;IACd,YAAgD;IAEhD,cAAc;IACd,SAA+B;IAE/B,cAAc;IACd,gBAAsC;IAEtC,cAAc;IACd,sBAAsD;IAEtD,cAAc;IACd,qBAAuD;IAEvD,cAAc;IACd,0BAAiE;IAEjE,cAAc;IACd,qBAA0B;IAE1B,cAAc;IACd,wBAA0B;IAE1B,cAAc;IACd,YAA4B;IAE5B,cAAc;IACd,iBAAqD;IAErD,cAAc;IACd,gBAAkB;IAElB,cAAc;IACd,iBAA0E;IAE1E,cAAc;IACd,gBAEE;IAEF,cAAc;IACd,kBAKI;IAEJ,cAAc;IACd,kBAUI;IAEJ,cAAc;IACd,iBAAmB;IAoXrB;;;;;OAKG;IACH,mBAeC;IA4CD;;;;;OAKG;IACH,oBAqBC;IArED;;;;OAIG;IACH,sBAmCC;IAxaC,cAAc;IACd,2KAA+C;IAmBjD;;;;;;;;;OASG;IACH,wGAYC;IAED;;;;OAIG;IACH,uBAFW,MAAM,QAYhB;IAED;;;OAGG;IACH,8BAFW,MAAM,MAAM,MAAM,CAAC,CAAC,QAS9B;IAED;;OAEG;IACH,cASC;IAED;;;OAGG;IACH,sBAeC;IAED;;;;;;OAMG;IACH,kBA0HC;IAED;;;;OAIG;IACH,qBAkHC;IA2DC,cAAc;IACd;;;;kBAIC;IAgCH;;;;OAIG;IACH,6BAYC;IAXC,cAAc;IACd,uCAA+C;IAYjD;;;OAGG;IACH,gCA8BC;IA7BC;;;OAGG;IAEH,0BAoBE;IAMJ;;;OAGG;IACH,qBAOC;IAFC,cAAc;IACd,mBAAgE;IAGlE;;;OAGG;IACH,wBAEC;IAED,iBA2BC;IAxBG,cAAc;IACd,4BAEE;IAEF,cAAc;IACd,uBAGC;IAiBL,mBAQC;IAED,eAAW;CACZ"}
@@ -616,7 +616,7 @@ class RoutingControl extends ControlCommon {
616
616
  this.removeListeners();
617
617
  this.reset();
618
618
  }
619
- super.deactivate();
620
619
  }
620
+ render() { }
621
621
  }
622
622
  export default RoutingControl;
@@ -1 +1 @@
1
- {"version":3,"file":"StopFinderControl.d.ts","sourceRoot":"","sources":["../../../src/ol/controls/StopFinderControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,SAAS,CAAC;AAGzC,OAAO,uBAAuB,MAAM,+CAA+C,CAAC;AAEpF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,cAAM,iBAAkB,SAAQ,uBAAuB;IACrD;;OAEG;IACH,iBAAiB,CAAC,UAAU,EAAE,OAAO;CAItC;AAED,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"StopFinderControl.d.ts","sourceRoot":"","sources":["../../../src/ol/controls/StopFinderControl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,MAAM,SAAS,CAAC;AAEzC,OAAO,uBAAuB,MAAM,+CAA+C,CAAC;AAEpF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,cAAM,iBAAkB,SAAQ,uBAAuB;IACrD;;OAEG;IACH,iBAAiB,CAAC,UAAU,EAAE,OAAO;CAItC;AAED,eAAe,iBAAiB,CAAC"}
@@ -3,20 +3,8 @@ import { EventsKey } from 'ol/events';
3
3
  import LayerGroup from 'ol/layer/Group';
4
4
  import OlLayer from 'ol/layer/Layer';
5
5
  import LayerCommon from '../../common/layers/LayerCommon';
6
- import type { AnyMap, UserInteractionCallback } from '../../types';
7
- export declare type OlLayerOptions = {
8
- key?: string;
9
- name?: string;
10
- group?: string;
11
- copyrights?: string[];
12
- children?: Layer[];
13
- visible?: boolean;
14
- disabled?: Boolean;
15
- hitTolerance?: Number;
16
- properties?: {
17
- [x: string]: any;
18
- };
19
- map?: AnyMap;
6
+ import type { UserInteractionCallback } from '../../types';
7
+ export declare type OlLayerOptions = LayerCommonOptions & {
20
8
  olLayer: OlLayer | LayerGroup;
21
9
  };
22
10
  declare const Layer_base: typeof LayerCommon;
@@ -42,14 +30,14 @@ declare class Layer extends Layer_base {
42
30
  visible: boolean;
43
31
  copyrights: string[];
44
32
  map?: Map;
33
+ singleClickListenerKey: EventsKey;
34
+ pointerMoveListenerKey: EventsKey;
45
35
  userInteractions?: boolean;
46
36
  userClickInteractions?: boolean;
47
37
  userHoverInteractions?: boolean;
48
38
  userClickCallbacks?: UserInteractionCallback[];
49
39
  userHoverCallbacks?: UserInteractionCallback[];
50
40
  onUserClickCallback: () => void;
51
- singleClickListenerKey: EventsKey;
52
- pointerMoveListenerKey: EventsKey;
53
41
  onUserMoveCallback: () => void;
54
42
  /**
55
43
  * Constructor.
@@ -1 +1 @@
1
- {"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/Layer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,UAAU,MAAM,gBAAgB,CAAC;AACxC,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAErC,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEnE,oBAAY,cAAc,GAAG;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,GAAG,UAAU,CAAC;CAC/B,CAAC;;AAEF;;;;;;;;;;;;;;GAcG;AACH,cAAM,KAAM,SAAQ,UAAkC;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,eAAe,EAAG,SAAS,EAAE,CAAC;IAI9B,OAAO,EAAG,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C;CAC/B,CAAC;;AAEF;;;;;;;;;;;;;;GAcG;AACH,cAAM,KAAM,SAAQ,UAAkC;IACpD,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,eAAe,EAAG,SAAS,EAAE,CAAC;IAI9B,OAAO,EAAG,cAAc,CAAC;IAEzB,OAAO,EAAG,OAAO,CAAC;IAElB,UAAU,EAAG,MAAM,EAAE,CAAC;IAEtB,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,sBAAsB,EAAG,SAAS,CAAC;IAEnC,sBAAsB,EAAG,SAAS,CAAC;IAInC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,kBAAkB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAE/C,kBAAkB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAE/C,mBAAmB,EAAG,MAAM,IAAI,CAAC;IAEjC,kBAAkB,EAAG,MAAM,IAAI,CAAC;IAEhC;;;;;;;;;;;OAWG;gBACS,OAAO,EAAE,cAAc;IAQnC;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,EAAE,cAAc;IAUxC;;;OAGG;IACH,WAAW,CAAC,GAAG,EAAE,GAAG;IAyDpB;;OAEG;IACH,aAAa;IAcb,wBAAwB;IA2BxB,0BAA0B;IAI1B;;;OAGG;IACH,sBAAsB;IAQtB;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,cAAc;CAGjC;AACD,eAAe,KAAK,CAAC"}
@@ -1,5 +1,7 @@
1
1
  import { Map } from 'mapbox-gl';
2
+ import { Coordinate } from 'ol/coordinate';
2
3
  import type OlMap from 'ol/Map';
4
+ import { Size } from 'ol/size';
3
5
  import MapGlLayer, { MapGlLayerOptions } from './MapGlLayer';
4
6
  /**
5
7
  * A class representing Mapboxlayer to display on BasicMap
@@ -16,7 +18,15 @@ import MapGlLayer, { MapGlLayerOptions } from './MapGlLayer';
16
18
  * @extends {Layer}
17
19
  */
18
20
  export default class MapboxLayer extends MapGlLayer {
19
- renderState?: {};
21
+ renderState?: {
22
+ center?: Coordinate;
23
+ zoom?: number;
24
+ visible?: boolean;
25
+ opacity?: number;
26
+ resolution?: number;
27
+ rotation?: number;
28
+ size?: Size;
29
+ };
20
30
  tabIndex?: number;
21
31
  /**
22
32
  * Initialize the layer and listen to feature clicks.
@@ -1 +1 @@
1
- {"version":3,"file":"MapboxLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MapboxLayer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAEhC,OAAO,UAAU,EAAE,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU;IACjD,WAAW,CAAC,EAAE,EAAE,CAAC;IAEjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,GAAG,EAAE,KAAK;IAsBtB;;;OAGG;IACH,SAAS;IAoDT,gBAAgB;IAKhB,iBAAiB;IAIjB;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,iBAAiB;CAGpC"}
1
+ {"version":3,"file":"MapboxLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MapboxLayer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,UAAU,EAAE,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU;IACjD,WAAW,CAAC,EAAE;QACZ,MAAM,CAAC,EAAE,UAAU,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,IAAI,CAAC;KACb,CAAC;IAEF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,GAAG,EAAE,KAAK;IAsBtB;;;OAGG;IACH,SAAS;IAoDT,gBAAgB;IAKhB,iBAAiB;IAIjB;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,iBAAiB;CAGpC"}
@@ -57,10 +57,10 @@ export default class MapboxLayer extends MapGlLayer {
57
57
  /** @ignore */
58
58
  this.renderState = {
59
59
  center: [x, y],
60
- zoom: null,
61
- rotation: null,
62
- visible: null,
63
- opacity: null,
60
+ zoom: undefined,
61
+ rotation: undefined,
62
+ visible: undefined,
63
+ opacity: undefined,
64
64
  size: [0, 0],
65
65
  };
66
66
  super.loadMbMap();
@@ -1,4 +1,28 @@
1
- export default MapboxStyleLayer;
1
+ import { Feature, Map } from 'ol';
2
+ import { Coordinate } from 'ol/coordinate';
3
+ import { ObjectEvent } from 'ol/Object';
4
+ import { AnyMapboxLayer, LayerGetFeatureInfoResponse } from '../../types';
5
+ import Layer, { OlLayerOptions } from './Layer';
6
+ export declare type MapboxStyleLayerOptions = OlLayerOptions & {
7
+ beforeId?: string;
8
+ mapboxLayer?: AnyMapboxLayer;
9
+ styleLayer?: {
10
+ [key: string]: any;
11
+ };
12
+ styleLayers?: {
13
+ [key: string]: any;
14
+ }[];
15
+ styleLayersFilter?: FilterFunction;
16
+ filters: FilterFunction | {
17
+ [key: string]: any;
18
+ }[];
19
+ featureInfoFilter?: FilterFunction;
20
+ queryRenderedLayersFilter?: FilterFunction;
21
+ };
22
+ export declare type StyleLayer = {
23
+ id?: string;
24
+ [key: string]: any;
25
+ };
2
26
  /**
3
27
  * Layer for visualizing a specific set of layer from a MapboxLayer.
4
28
  *
@@ -18,6 +42,16 @@ export default MapboxStyleLayer;
18
42
  * @extends {Layer}
19
43
  */
20
44
  declare class MapboxStyleLayer extends Layer {
45
+ beforeId?: string;
46
+ mapboxLayer?: AnyMapboxLayer;
47
+ styleLayersFilter?: FilterFunction;
48
+ featureInfoFilter?: FilterFunction;
49
+ queryRenderedLayersFilter?: FilterFunction;
50
+ selectedFeatures?: Feature[];
51
+ highlightedFeatures?: Feature[];
52
+ styleLayer?: StyleLayer;
53
+ styleLayers: StyleLayer[];
54
+ addDynamicFilters?: () => void;
21
55
  /**
22
56
  * Constructor.
23
57
  *
@@ -25,128 +59,71 @@ declare class MapboxStyleLayer extends Layer {
25
59
  * @param {MapboxLayer} [options.mapboxLayer] The MapboxLayer to use.
26
60
  * @param {Function} [options.styleLayersFilter] Filter function to decide which style layer to display.
27
61
  */
28
- constructor(options?: {
29
- mapboxLayer?: any;
30
- styleLayersFilter?: Function | undefined;
31
- });
32
- /**
33
- * MapboxLayer provided for the style Layer.
34
- * @type {MapboxLayer}
35
- * @private
36
- */
37
- private mapboxLayer;
38
- /**
39
- * Define if the layer has data to display in the current mapbox layer.
40
- */
41
- disabled: boolean;
42
- /**
43
- * Function to filter features to be displayed.
44
- * @type {function}
45
- * @private
46
- */
47
- private styleLayersFilter;
48
- /**
49
- * Mapbox style layer id where to add the style layers.
50
- * See [mapbox.map.addLayer](https://docs.mapbox.com/mapbox-gl-js/api/map/#map#addlayer) documentation.
51
- * @type {String}
52
- * @private
53
- */
54
- private beforeId;
55
- /**
56
- * Function to filter features for getFeatureInfoAtCoordinate method.
57
- * @type {function}
58
- * @private
59
- */
60
- private featureInfoFilter;
61
- /**
62
- * Function to query the rendered features.
63
- * @type {function}
64
- * @private
65
- */
66
- private queryRenderedLayersFilter;
67
- /**
68
- * Array of features to highlight.
69
- * @type {Array<ol/Feature~Feature>}
70
- * @private
71
- */
72
- private highlightedFeatures;
62
+ constructor(options: MapboxStyleLayerOptions);
73
63
  /**
74
- * Array of selected features.
75
- * @type {Array<ol/Feature~Feature>}
76
- * @private
64
+ * Initialize the layer.
65
+ * @param {ol/Map~Map} map the mapbox map.
66
+ * @override
77
67
  */
78
- private selectedFeatures;
68
+ attachToMap(map: Map): void;
79
69
  /**
80
- * Array of mapbox style layers to add.
81
- * @type {Array<mapboxgl.styleLayer>}
82
- * @private
70
+ * Terminate the layer.
71
+ * @override
83
72
  */
84
- private styleLayers;
73
+ detachFromMap(): void;
85
74
  /** @ignore */
86
75
  addStyleLayers(): void;
76
+ /** @ignore */
77
+ removeStyleLayers(): void;
87
78
  /**
88
79
  * On Mapbox map load callback function. Add style layers and dynaimc filters.
89
80
  * @ignore
90
81
  */
91
82
  onLoad(): void;
92
- /** @private */
93
- private addDynamicFilters;
94
- /**
95
- * Initialize the layer.
96
- * @param {mapboxgl.Map} map the mapbox map.
97
- * @override
98
- */
99
- override attachToMap(map: mapboxgl.Map): void;
100
- /**
101
- * Terminate the layer.
102
- * @param {mapboxgl.Map} map the mapbox map.
103
- * @override
104
- */
105
- override detachFromMap(map: mapboxgl.Map): void;
106
- /** @ignore */
107
- removeStyleLayers(): void;
108
83
  /**
109
84
  * Request feature information for a given coordinate.
110
85
  * @param {ol/coordinate~Coordinate} coordinate Coordinate to request the information at.
111
86
  * @return {Promise<FeatureInfo>} Promise with features, layer and coordinate.
112
87
  */
113
- getFeatureInfoAtCoordinate(coordinate: any): Promise<FeatureInfo>;
88
+ getFeatureInfoAtCoordinate(coordinate: Coordinate): Promise<LayerGetFeatureInfoResponse>;
114
89
  /**
115
90
  * Set filter that determines which features should be rendered in a style layer.
116
91
  * @param {mapboxgl.filter} filter Determines which features should be rendered in a style layer.
117
92
  */
118
- setFilter(filter: mapboxgl.filter): void;
93
+ setFilter(filter: {
94
+ [key: string]: any;
95
+ }): void;
119
96
  /**
120
97
  * Set if features are hovered or not.
121
98
  * @param {Array<ol/Feature~Feature>} features
122
99
  * @param {boolean} state Is the feature hovered
123
100
  * @private
124
101
  */
125
- private setHoverState;
102
+ setHoverState(features: Feature[], state: boolean): void;
126
103
  /**
127
104
  * Select a list of features.
128
105
  * @param {Array<ol/Feature~Feature>} [features=[]] Features to select.
129
106
  * @private
130
107
  */
131
- private select;
108
+ select(features?: Feature[]): void;
132
109
  /**
133
110
  * Highlight a list of features.
134
111
  * @param {Array<ol/Feature~Feature>} [features=[]] Features to highlight.
135
112
  * @private
136
113
  */
137
- private highlight;
114
+ highlight(features?: Feature[]): void;
138
115
  /**
139
116
  * Apply visibility to style layers that fits the styleLayersFilter function.
140
117
  * @param {Event} evt Layer's event that has called the function.
141
118
  * @private
142
119
  */
143
- private applyLayoutVisibility;
120
+ applyLayoutVisibility(evt?: ObjectEvent): void;
144
121
  /**
145
122
  * Create a copy of the MapboxStyleLayer.
146
123
  * @param {Object} newOptions Options to override.
147
124
  * @return {MapboxStyleLayer} A MapboxStyleLayer.
148
125
  */
149
- clone(newOptions: Object): MapboxStyleLayer;
126
+ clone(newOptions: MapboxStyleLayerOptions): MapboxStyleLayer;
150
127
  }
151
- import Layer from "./Layer";
128
+ export default MapboxStyleLayer;
152
129
  //# sourceMappingURL=MapboxStyleLayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MapboxStyleLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/MapboxStyleLayer.js"],"names":[],"mappings":";AAGA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACE;;;;;;OAMG;IACH;QAHiC,WAAW;QACd,iBAAiB;OA4F9C;IAvFC;;;;OAIG;IACH,oBAAsC;IAEtC;;OAEG;IACH,kBAAqB;IAErB;;;;OAIG;IACH,0BAAkD;IAElD;;;;;OAKG;IACH,iBAAgC;IAEhC;;;;OAIG;IACH,0BAAoE;IAEpE;;;;OAIG;IACH,kCAAkE;IAElE;;;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AO;IAmCjD;;;;OAIG;IACH,MAAM,CAAC,QAAQ,GAAE,OAAO,EAAO;IAM/B;;;;OAIG;IACH,SAAS,CAAC,QAAQ,GAAE,OAAO,EAAO;IAkBlC;;;;OAIG;IAEH,qBAAqB,CAAC,GAAG,CAAC,EAAE,WAAW;IAgCvC;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,uBAAuB;CAG1C;AAED,eAAe,gBAAgB,CAAC"}
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-param-reassign */
2
1
  import Layer from './Layer';
3
2
  /**
4
3
  * Layer for visualizing a specific set of layer from a MapboxLayer.
@@ -26,7 +25,7 @@ class MapboxStyleLayer extends Layer {
26
25
  * @param {MapboxLayer} [options.mapboxLayer] The MapboxLayer to use.
27
26
  * @param {Function} [options.styleLayersFilter] Filter function to decide which style layer to display.
28
27
  */
29
- constructor(options = {}) {
28
+ constructor(options) {
30
29
  super(options);
31
30
  /**
32
31
  * MapboxLayer provided for the style Layer.
@@ -105,15 +104,16 @@ class MapboxStyleLayer extends Layer {
105
104
  }
106
105
  /**
107
106
  * Initialize the layer.
108
- * @param {mapboxgl.Map} map the mapbox map.
107
+ * @param {ol/Map~Map} map the mapbox map.
109
108
  * @override
110
109
  */
111
110
  attachToMap(map) {
112
- if (!this.mapboxLayer.map) {
113
- this.mapboxLayer.attachToMap(map);
111
+ var _a;
112
+ if (this.mapboxLayer && !this.mapboxLayer.map) {
113
+ (_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.attachToMap(map);
114
114
  }
115
115
  super.attachToMap(map);
116
- if (!this.map) {
116
+ if (!this.map || !this.mapboxLayer) {
117
117
  return;
118
118
  }
119
119
  // Apply the initial visibiltity.
@@ -137,37 +137,43 @@ class MapboxStyleLayer extends Layer {
137
137
  mbMap.once('load', this.onLoad);
138
138
  }
139
139
  // Apply the visibiltity when layer's visibility change.
140
- this.olListenersKeys.push(this.on('change:visible', (evt) => {
140
+ this.olListenersKeys.push(
141
+ // @ts-ignore
142
+ this.on('change:visible', (evt) => {
141
143
  // Once the map is loaded we can apply vsiiblity without waiting
142
144
  // the style. Mapbox take care of the application of style changes.
143
145
  this.applyLayoutVisibility(evt);
144
146
  }));
145
- this.olListenersKeys.push(this.mapboxLayer.on('load', () => {
147
+ this.olListenersKeys.push(
148
+ // @ts-ignore
149
+ this.mapboxLayer.on('load', () => {
146
150
  this.onLoad();
147
151
  }));
148
152
  }
149
153
  /**
150
154
  * Terminate the layer.
151
- * @param {mapboxgl.Map} map the mapbox map.
152
155
  * @override
153
156
  */
154
- detachFromMap(map) {
155
- const { mbMap } = this.mapboxLayer;
156
- if (mbMap) {
157
+ detachFromMap() {
158
+ var _a;
159
+ if ((_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.mbMap) {
160
+ const { mbMap } = this.mapboxLayer;
157
161
  mbMap.off('load', this.onLoad);
158
162
  this.removeStyleLayers();
159
163
  }
160
- super.detachFromMap(map);
164
+ super.detachFromMap();
161
165
  }
162
166
  /** @ignore */
163
167
  addStyleLayers() {
164
- const { mbMap } = this.mapboxLayer;
165
- if (!mbMap) {
168
+ var _a;
169
+ if (!((_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.mbMap)) {
166
170
  return;
167
171
  }
172
+ const { mbMap } = this.mapboxLayer;
168
173
  this.styleLayers.forEach((styleLayer) => {
169
174
  const { id, source } = styleLayer;
170
- if (mbMap.getSource(source) && !mbMap.getLayer(id)) {
175
+ if (mbMap.getSource(source) && id && !mbMap.getLayer(id)) {
176
+ // @ts-ignore
171
177
  mbMap.addLayer(styleLayer, this.beforeId);
172
178
  }
173
179
  });
@@ -175,13 +181,15 @@ class MapboxStyleLayer extends Layer {
175
181
  }
176
182
  /** @ignore */
177
183
  removeStyleLayers() {
178
- const { mbMap } = this.mapboxLayer;
179
- if (!mbMap) {
184
+ var _a;
185
+ if (!((_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.mbMap)) {
180
186
  return;
181
187
  }
188
+ const { mbMap } = this.mapboxLayer;
182
189
  this.styleLayers.forEach((styleLayer) => {
183
- if (mbMap.getLayer(styleLayer.id)) {
184
- mbMap.removeLayer(styleLayer.id);
190
+ const { id } = styleLayer;
191
+ if (id && mbMap.getLayer(id)) {
192
+ mbMap.removeLayer(id);
185
193
  }
186
194
  });
187
195
  }
@@ -190,13 +198,18 @@ class MapboxStyleLayer extends Layer {
190
198
  * @ignore
191
199
  */
192
200
  onLoad() {
201
+ var _a;
193
202
  this.addStyleLayers();
194
203
  if (this.addDynamicFilters) {
195
204
  this.addDynamicFilters();
196
205
  }
206
+ if (!((_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.mbMap)) {
207
+ return;
208
+ }
197
209
  const { mbMap } = this.mapboxLayer;
198
210
  const style = mbMap.getStyle();
199
211
  if (style && this.styleLayersFilter) {
212
+ // @ts-ignore
200
213
  const styles = style.layers.filter(this.styleLayersFilter);
201
214
  this.disabled = !styles.length;
202
215
  }
@@ -207,17 +220,23 @@ class MapboxStyleLayer extends Layer {
207
220
  * @return {Promise<FeatureInfo>} Promise with features, layer and coordinate.
208
221
  */
209
222
  getFeatureInfoAtCoordinate(coordinate) {
223
+ var _a;
224
+ if (!((_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.mbMap)) {
225
+ return Promise.resolve({ coordinate, features: [], layer: this });
226
+ }
210
227
  const { mbMap } = this.mapboxLayer;
211
228
  // Ignore the getFeatureInfo until the mapbox map is loaded
212
- if (!mbMap || !mbMap.isStyleLoaded()) {
229
+ if (!mbMap.isStyleLoaded()) {
213
230
  return Promise.resolve({ coordinate, features: [], layer: this });
214
231
  }
215
232
  // We query features only on style layers used by this layer.
216
233
  let layers = this.styleLayers || [];
217
234
  if (this.styleLayersFilter) {
235
+ // @ts-ignore
218
236
  layers = mbMap.getStyle().layers.filter(this.styleLayersFilter);
219
237
  }
220
238
  if (this.queryRenderedLayersFilter) {
239
+ // @ts-ignore
221
240
  layers = mbMap.getStyle().layers.filter(this.queryRenderedLayersFilter);
222
241
  }
223
242
  return this.mapboxLayer
@@ -226,7 +245,11 @@ class MapboxStyleLayer extends Layer {
226
245
  validate: false,
227
246
  })
228
247
  .then((featureInfo) => {
229
- const features = featureInfo.features.filter((feature) => this.featureInfoFilter(feature, this.map.getView().getResolution()));
248
+ const features = featureInfo.features.filter((feature) => {
249
+ var _a;
250
+ // @ts-ignore
251
+ return this.featureInfoFilter(feature, (_a = this.map) === null || _a === void 0 ? void 0 : _a.getView().getResolution());
252
+ });
230
253
  this.highlight(features);
231
254
  return Object.assign(Object.assign({}, featureInfo), { features, layer: this });
232
255
  });
@@ -236,12 +259,14 @@ class MapboxStyleLayer extends Layer {
236
259
  * @param {mapboxgl.filter} filter Determines which features should be rendered in a style layer.
237
260
  */
238
261
  setFilter(filter) {
239
- const { mbMap } = this.mapboxLayer;
240
- if (!mbMap) {
262
+ var _a;
263
+ if (!((_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.mbMap)) {
241
264
  return;
242
265
  }
266
+ const { mbMap } = this.mapboxLayer;
243
267
  this.styleLayers.forEach(({ id }) => {
244
- if (mbMap.getLayer(id)) {
268
+ if (id && filter && mbMap.getLayer(id)) {
269
+ // @ts-ignore
245
270
  mbMap.setFilter(id, filter);
246
271
  }
247
272
  });
@@ -253,6 +278,10 @@ class MapboxStyleLayer extends Layer {
253
278
  * @private
254
279
  */
255
280
  setHoverState(features, state) {
281
+ var _a;
282
+ if (!((_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.mbMap)) {
283
+ return;
284
+ }
256
285
  const { mbMap } = this.mapboxLayer;
257
286
  if (!features || !mbMap) {
258
287
  return;
@@ -279,9 +308,9 @@ class MapboxStyleLayer extends Layer {
279
308
  * @private
280
309
  */
281
310
  select(features = []) {
282
- this.setHoverState(this.selectedFeatures, false);
311
+ this.setHoverState(this.selectedFeatures || [], false);
283
312
  this.selectedFeatures = features;
284
- this.setHoverState(this.selectedFeatures, true);
313
+ this.setHoverState(this.selectedFeatures || [], true);
285
314
  }
286
315
  /**
287
316
  * Highlight a list of features.
@@ -289,10 +318,11 @@ class MapboxStyleLayer extends Layer {
289
318
  * @private
290
319
  */
291
320
  highlight(features = []) {
321
+ var _a;
292
322
  // Filter out selected features
293
- const filtered = this.highlightedFeatures.filter((feature) => !this.selectedFeatures
323
+ const filtered = ((_a = this.highlightedFeatures) === null || _a === void 0 ? void 0 : _a.filter((feature) => !(this.selectedFeatures || [])
294
324
  .map((feat) => feat.getId())
295
- .includes(feature.getId()));
325
+ .includes(feature.getId()))) || [];
296
326
  // Remove previous highlight
297
327
  this.setHoverState(filtered, false);
298
328
  this.highlightedFeatures = features;
@@ -304,14 +334,15 @@ class MapboxStyleLayer extends Layer {
304
334
  * @param {Event} evt Layer's event that has called the function.
305
335
  * @private
306
336
  */
307
- // eslint-disable-next-line no-unused-vars
337
+ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
308
338
  applyLayoutVisibility(evt) {
339
+ var _a;
309
340
  const { visible } = this;
310
- const { mbMap } = this.mapboxLayer;
311
341
  const filterFunc = this.styleLayersFilter;
312
- if (!mbMap) {
342
+ if (!((_a = this.mapboxLayer) === null || _a === void 0 ? void 0 : _a.mbMap)) {
313
343
  return;
314
344
  }
345
+ const { mbMap } = this.mapboxLayer;
315
346
  const style = mbMap.getStyle();
316
347
  if (!style) {
317
348
  return;
@@ -1,4 +1,6 @@
1
- export default VectorLayer;
1
+ import { Coordinate } from 'ol/coordinate';
2
+ import { LayerGetFeatureInfoResponse } from '../../types';
3
+ import Layer, { OlLayerOptions } from './Layer';
2
4
  /**
3
5
  * A class use to display vector data.
4
6
  *
@@ -11,13 +13,13 @@ declare class VectorLayer extends Layer {
11
13
  * @param {ol/coordinate~Coordinate} coordinate the coordinate to request the information at.
12
14
  * @return {Promise<FeatureInfo>} Promise with features, layer and coordinate.
13
15
  */
14
- getFeatureInfoAtCoordinate(coordinate: any): Promise<FeatureInfo>;
16
+ getFeatureInfoAtCoordinate(coordinate: Coordinate): Promise<LayerGetFeatureInfoResponse>;
15
17
  /**
16
18
  * Create a copy of the VectorLayer.
17
19
  * @param {Object} newOptions Options to override
18
20
  * @return {VectorLayer} A VectorLayer
19
21
  */
20
- clone(newOptions: Object): VectorLayer;
22
+ clone(newOptions: OlLayerOptions): VectorLayer;
21
23
  }
22
- import Layer from "./Layer";
24
+ export default VectorLayer;
23
25
  //# sourceMappingURL=VectorLayer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/VectorLayer.js"],"names":[],"mappings":";AAEA;;;;;GAKG;AACH;IACE;;;;OAIG;IACH,6CAFY,QAAQ,WAAW,CAAC,CAkB/B;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACL,WAAW,CAItB;CACF"}
1
+ {"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["../../../src/ol/layers/VectorLayer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEhD;;;;;GAKG;AACH,cAAM,WAAY,SAAQ,KAAK;IAC7B;;;;OAIG;IACH,0BAA0B,CACxB,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,2BAA2B,CAAC;IAkBvC;;;;OAIG;IACH,KAAK,CAAC,UAAU,EAAE,cAAc;CAGjC;AAED,eAAe,WAAW,CAAC"}