mobility-toolbox-js 3.0.0-beta.2 → 3.0.0-beta.3

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/mbt.js CHANGED
@@ -46128,13 +46128,12 @@ uniform ${i3} ${s3} u_${a3};
46128
46128
  }
46129
46129
  /** @private */
46130
46130
  addSources() {
46131
- if (!this.maplibreLayer?.maplibreMap || !Array.isArray(this.sources)) {
46131
+ if (!this.maplibreLayer?.maplibreMap || !this.sources) {
46132
46132
  return;
46133
46133
  }
46134
46134
  const { maplibreMap } = this.maplibreLayer;
46135
46135
  if (maplibreMap) {
46136
- this.sources.forEach((source) => {
46137
- const { id } = source;
46136
+ Object.entries(this.sources).forEach(([id, source]) => {
46138
46137
  if (!maplibreMap.getSource(id)) {
46139
46138
  maplibreMap.addSource(id, source);
46140
46139
  }
@@ -46143,13 +46142,12 @@ uniform ${i3} ${s3} u_${a3};
46143
46142
  }
46144
46143
  /** @private */
46145
46144
  removeSources() {
46146
- if (!this.maplibreLayer?.maplibreMap || !Array.isArray(this.layers)) {
46145
+ if (!this.maplibreLayer?.maplibreMap || !this.sources) {
46147
46146
  return;
46148
46147
  }
46149
46148
  const { maplibreMap } = this.maplibreLayer;
46150
46149
  if (maplibreMap) {
46151
- this.sources.forEach((source) => {
46152
- const { id } = source;
46150
+ Object.keys(this.sources).forEach((id) => {
46153
46151
  if (maplibreMap.getSource(id)) {
46154
46152
  maplibreMap.removeSource(id);
46155
46153
  }