updateClusterSource() {
    if (!this.visible || !this.map || !this.mapboxLayer.mbMap) {
      return;
    }
    const { mbMap } = this.mapboxLayer;
    const source = mbMap.getSource(this.clusterSource.id);
    if (!source) {
      return;
    }

    let features;
    try {
      features = mbMap.querySourceFeatures('ch.sbb.zweitausbildung_pois', {
        sourceLayer: 'ch.sbb.zweitausbildung_pois',
        filter: this.filter,
      });
    } catch (e) {
      // eslint-disable-next-line no-console
      // console.error(e);
    }

    if (!features?.length) {
      return;
    }

    // Remove duplicated features.
    const ids = [];
    const uniqueFeatures = [];
    features.forEach((linee) => {
      const indexOf = ids.indexOf(linee.id);
      if (indexOf === -1) {
        ids.push(linee.id);
        uniqueFeatures.push(linee);
      }
    });

    source.setData({
      type: 'FeatureCollection',
      features: uniqueFeatures,
    });
  }
// Upodate sources for features with multiple lines.
Upodate sources for features with multiple lines.
Upodate sources for features with multiple lines .
updateClusterSource() {
    if (!this.visible || !this.map || !this.mapboxLayer.mbMap) {
      return;
    }
    const { mbMap } = this.mapboxLayer;
    const source = mbMap.getSource(this.clusterSource.id);
    if (!source) {
      return;
    }
    let features;
    try {
      features = mbMap.querySourceFeatures('ch.sbb.zweitausbildung_pois', {
        sourceLayer: 'ch.sbb.zweitausbildung_pois',
        filter: this.filter,
      });
    } catch (e) {
    }
    if (!features?.length) {
      return;
    }
    const ids = [];
    const uniqueFeatures = [];
    features.forEach((linee) => {
      const indexOf = ids.indexOf(linee.id);
      if (indexOf === -1) {
        ids.push(linee.id);
        uniqueFeatures.push(linee);
      }
    });
    source.setData({
      type: 'FeatureCollection',
      features: uniqueFeatures,
    });
  }
updateClusterSource ( ) { if ( ! this . visible || ! this . map || ! this . mapboxLayer . mbMap ) { return ; } const { mbMap } = this . mapboxLayer ; const source = mbMap . getSource ( this . clusterSource . id ) ; if ( ! source ) { return ; } let features ; try { features = mbMap . querySourceFeatures ( 'ch.sbb.zweitausbildung_pois' , { sourceLayer : 'ch.sbb.zweitausbildung_pois' , filter : this . filter , } ) ; } catch ( e ) { } if ( ! features ?. length ) { return ; } const ids = [ ] ; const uniqueFeatures = [ ] ; features . forEach ( ( linee ) => { const indexOf = ids . indexOf ( linee . id ) ; if ( indexOf === - 1 ) { ids . push ( linee . id ) ; uniqueFeatures . push ( linee ) ; } } ) ; source . setData ( { type : 'FeatureCollection' , features : uniqueFeatures , } ) ; }
Upodate sources for features with multiple lines.
Upodate sources for features with multiple lines .
// eslint-disable-next-line no-console // console.error(e); // Remove duplicated features.