mobility-toolbox-js 2.0.0-beta.48 → 2.0.0-beta.50

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ControlCommon.d.ts","sourceRoot":"","sources":["../../../src/common/controls/ControlCommon.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,oBAAY,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,cAAM,aAAc,SAAQ,UAAU;IACpC,MAAM,EAAE,OAAO,CAAC;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;;;OAQG;gBACS,OAAO,GAAE,oBAAyB;IAe9C;;;;;OAKG;IACH,gBAAgB,CAAC,OAAO,EAAE,oBAAoB;IAuE9C;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM;IAIvB;;OAEG;IACH,aAAa;IAIb;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IAEH,UAAU;IAKV;;;;;OAKG;IAEH,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG;IAKpB;;;;;OAKG;IAEH,oBAAoB;CAIrB;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"ControlCommon.d.ts","sourceRoot":"","sources":["../../../src/common/controls/ControlCommon.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAC;AAEnD,oBAAY,oBAAoB,GAAG;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,cAAM,aAAc,SAAQ,UAAU;IACpC,MAAM,EAAE,OAAO,CAAC;IAEhB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;;;;;;OAQG;gBACS,OAAO,GAAE,oBAAyB;IAe9C;;;;;OAKG;IACH,gBAAgB,CAAC,OAAO,EAAE,oBAAoB;IAuE9C;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM;IAIvB;;OAEG;IACH,aAAa;IAIb;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IAEH,UAAU;IAOV;;;;;OAKG;IAEH,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG;IAKpB;;;;;OAKG;IAEH,oBAAoB;CAMrB;AAED,eAAe,aAAa,CAAC"}
@@ -122,7 +122,7 @@ class ControlCommon extends BaseObject {
122
122
  // eslint-disable-next-line class-methods-use-this
123
123
  deactivate() {
124
124
  // eslint-disable-next-line no-console
125
- console.error('This function must be implemented in subclasses');
125
+ console.error('The function deactivate() must be implemented in subclasses');
126
126
  }
127
127
  /**
128
128
  * The default render function. It renders content in the HTML element.
@@ -133,7 +133,7 @@ class ControlCommon extends BaseObject {
133
133
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
134
134
  render(options) {
135
135
  // eslint-disable-next-line no-console
136
- console.error('This function must be implemented in subclasses');
136
+ console.error('The function render() must be implemented in subclasses');
137
137
  }
138
138
  /**
139
139
  * The default element to display if this.element is not defined.
@@ -144,7 +144,7 @@ class ControlCommon extends BaseObject {
144
144
  // eslint-disable-next-line class-methods-use-this
145
145
  createDefaultElement() {
146
146
  // eslint-disable-next-line no-console
147
- console.error('This function must be implemented in subclasses');
147
+ console.error('The function createDefaultElement() must be implemented in subclasses');
148
148
  }
149
149
  }
150
150
  export default ControlCommon;
@@ -31,6 +31,7 @@ declare class StopFinderControlCommon extends ControlCommon {
31
31
  * @param {StopsSearchParams} [options.apiParams={ limit: 20 }] Request parameters. See [Stops service documentation](https://developer.geops.io/apis/5dcbd702a256d90001cf1361/).
32
32
  */
33
33
  constructor(options: StopFinderControlCommonOptions);
34
+ deactivate(): void;
34
35
  render(featureCollection?: FeatureCollection): void;
35
36
  createDefaultElement(): void;
36
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"StopFinderControlCommon.d.ts","sourceRoot":"","sources":["../../../src/common/controls/StopFinderControlCommon.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,aAAa,EAAE,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEtE,oBAAY,8BAA8B,GAAG,oBAAoB,GAC/D,eAAe,GAAG;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEJ;;;;GAIG;AACH,cAAM,uBAAwB,SAAQ,aAAa;IACjD,SAAS,EAAE,eAAe,CAAC;IAE3B,WAAW,EAAE,MAAM,CAAC;IAEpB,GAAG,EAAE,QAAQ,CAAC;IAEd,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC,cAAc,CAAC,EAAE,WAAW,CAAC;IAE7B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAE5B,QAAQ,CAAC,EAAE,cA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AiB,CAAC,EAAE,iBAAiB;IAwB5C,oBAAoB;IAuDpB;;;;;;OAMG;IACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,eAAe;IAsBlD;;OAEG;IAEH,iBAAiB,CAAC,UAAU,EAAE,OAAO;IAErC;;OAEG;IACH,KAAK;CASN;AAED,eAAe,uBAAuB,CAAC"}
@@ -17,9 +17,9 @@ class StopFinderControlCommon extends ControlCommon {
17
17
  */
18
18
  constructor(options) {
19
19
  super(options);
20
- const { apiParams, apiKey, url } = options;
20
+ const { apiParams, apiKey, url, placeholder } = options || {};
21
21
  this.apiParams = Object.assign({ limit: 20 }, (apiParams || {}));
22
- this.placeholder = options.placeholder || 'Search for a stop...';
22
+ this.placeholder = placeholder || 'Search for a stop...';
23
23
  const apiOptions = { apiKey };
24
24
  if (url) {
25
25
  apiOptions.url = url;
@@ -27,6 +27,7 @@ class StopFinderControlCommon extends ControlCommon {
27
27
  this.api = new StopsAPI(apiOptions);
28
28
  this.abortController = new AbortController();
29
29
  }
30
+ deactivate() { }
30
31
  render(featureCollection) {
31
32
  const suggestions = (featureCollection === null || featureCollection === void 0 ? void 0 : featureCollection.features) || [];
32
33
  if (!this.suggestionsElt) {
package/mbt.js CHANGED
@@ -36795,13 +36795,13 @@ uniform ${i3} ${o3} u_${a3};
36795
36795
  this.deactivate();
36796
36796
  }
36797
36797
  deactivate() {
36798
- console.error("This function must be implemented in subclasses");
36798
+ console.error("The function deactivate() must be implemented in subclasses");
36799
36799
  }
36800
36800
  render(options) {
36801
- console.error("This function must be implemented in subclasses");
36801
+ console.error("The function render() must be implemented in subclasses");
36802
36802
  }
36803
36803
  createDefaultElement() {
36804
- console.error("This function must be implemented in subclasses");
36804
+ console.error("The function createDefaultElement() must be implemented in subclasses");
36805
36805
  }
36806
36806
  };
36807
36807
  var ControlCommon_default = ControlCommon;
@@ -36861,7 +36861,6 @@ uniform ${i3} ${o3} u_${a3};
36861
36861
  if (this.map) {
36862
36862
  this.map.un("postrender", this.onPostRender);
36863
36863
  }
36864
- super.deactivate();
36865
36864
  }
36866
36865
  onPostRender(evt) {
36867
36866
  if (this.map && this.element) {
@@ -48644,7 +48643,8 @@ uniform ${i3} ${o3} u_${a3};
48644
48643
  this.removeListeners();
48645
48644
  this.reset();
48646
48645
  }
48647
- super.deactivate();
48646
+ }
48647
+ render() {
48648
48648
  }
48649
48649
  };
48650
48650
  var RoutingControl_default = RoutingControl;
@@ -48653,9 +48653,9 @@ uniform ${i3} ${o3} u_${a3};
48653
48653
  var StopFinderControlCommon = class extends ControlCommon_default {
48654
48654
  constructor(options) {
48655
48655
  super(options);
48656
- const { apiParams, apiKey, url } = options;
48656
+ const { apiParams, apiKey, url, placeholder } = options || {};
48657
48657
  this.apiParams = { limit: 20, ...apiParams || {} };
48658
- this.placeholder = options.placeholder || "Search for a stop...";
48658
+ this.placeholder = placeholder || "Search for a stop...";
48659
48659
  const apiOptions = { apiKey };
48660
48660
  if (url) {
48661
48661
  apiOptions.url = url;
@@ -48663,6 +48663,8 @@ uniform ${i3} ${o3} u_${a3};
48663
48663
  this.api = new StopsAPI_default(apiOptions);
48664
48664
  this.abortController = new AbortController();
48665
48665
  }
48666
+ deactivate() {
48667
+ }
48666
48668
  render(featureCollection) {
48667
48669
  const suggestions = featureCollection?.features || [];
48668
48670
  if (!this.suggestionsElt) {
@@ -49761,7 +49763,7 @@ uniform ${i3} ${o3} u_${a3};
49761
49763
  super.attachToMap(map);
49762
49764
  if (this.map) {
49763
49765
  this.olListenersKeys.push(...this.map.on(["moveend", "change:target"], (evt) => {
49764
- const view = evt.map.getView();
49766
+ const view = (evt.map || evt.target).getView();
49765
49767
  if (view.getAnimating() || view.getInteracting()) {
49766
49768
  return;
49767
49769
  }