Skip to content

Commit

Permalink
fix(layer-legend): WMS datasource with multiple style were not update…
Browse files Browse the repository at this point in the history
…d after style selection
  • Loading branch information
pelord committed Oct 14, 2021
1 parent 8908997 commit b1cc06f
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LegendMapViewOptions } from '../shared/layers/layer.interface';
import { CapabilitiesService } from '../../datasource/shared/capabilities.service';
import { catchError, map } from 'rxjs/operators';
import { LanguageService } from '@igo2/core';
import { WMSDataSourceOptions } from '../../datasource';
import { WMSDataSource, WMSDataSourceOptions } from '../../datasource';
import { SecureImagePipe } from '@igo2/common';

@Component({
Expand Down Expand Up @@ -231,12 +231,13 @@ export class LayerLegendComponent implements OnInit, OnDestroy {
onChangeStyle() {
this.updateLegend();
let STYLES = '';
console.log(this.layer.dataSource.ol);
// this.layer.dataSource.ol.getParams().LAYERS.split(',').map(layer =>
// STYLES += this.currentStyle + ','
// );
STYLES = STYLES.slice(0, -1);
// this.layer.dataSource.ol.updateParams({STYLES});
if (this.layer.dataSource instanceof WMSDataSource) {
this.layer.dataSource.ol.getParams().LAYERS.split(',').map(layer =>
STYLES += this.currentStyle + ','
);
STYLES = STYLES.slice(0, -1);
this.layer.dataSource.ol.updateParams({ STYLES });
}
}

onLoadImage(id: string) {
Expand Down

0 comments on commit b1cc06f

Please sign in to comment.