Skip to content

Commit

Permalink
fix(layer-list): fix baselayer with select all and opacity CSS (#632)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeLafreniere18 authored and mbarbeau committed May 11, 2020
1 parent c44378b commit f57405c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 20 deletions.
8 changes: 3 additions & 5 deletions packages/geo/src/lib/layer/layer-item/layer-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ export class LayerItemComponent implements OnInit, OnDestroy {
}
set selectAll(value: boolean) {
this._selectAll = value;
if (value) {
if (!this.layer.baseLayer) {
this.layerCheck = true;
}
if (value === true) {
this.layerCheck = true;
} else {
this.layerCheck = false;
}
}
private _selectAll = false;

public layerCheck = false;
public layerCheck;

private resolution$$: Subscription;

Expand Down
28 changes: 15 additions & 13 deletions packages/geo/src/lib/layer/layer-list/layer-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,21 @@
</button>

<mat-menu #opacityMenu="matMenu">
<mat-slider *ngIf="layersChecked.length"
id="opacity-slider"
color="primary"
thumbLabel
tickInterval="5"
step="5"
[min]="0"
[max]="100"
[(ngModel)]="checkOpacity"
[matTooltip]="'igo.geo.layer.opacity' | translate"
matTooltipShowDelay="500"
tooltip-position="below">
</mat-slider>
<div id="opacity-menu">
<mat-slider *ngIf="layersChecked.length"
id="opacity-slider"
color="primary"
thumbLabel
tickInterval="5"
step="5"
[min]="0"
[max]="100"
[(ngModel)]="checkOpacity"
[matTooltip]="'igo.geo.layer.opacity' | translate"
matTooltipShowDelay="500"
tooltip-position="below">
</mat-slider>
</div>
</mat-menu>

<button
Expand Down
8 changes: 8 additions & 0 deletions packages/geo/src/lib/layer/layer-list/layer-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ export class LayerListComponent implements OnInit, OnDestroy {
response = true;
}
}

if (this.layersChecked.length === 1 && this.layersChecked[0].baseLayer) {
response = false;
}
return response;
}

Expand All @@ -249,6 +253,10 @@ export class LayerListComponent implements OnInit, OnDestroy {
response = true;
}
}

if (this.layersChecked.length === 1 && this.layersChecked[0].baseLayer) {
response = false;
}
return response;
}

Expand Down
8 changes: 6 additions & 2 deletions packages/geo/src/lib/map/shared/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ export class IgoMap {

raiseLayers(layers: Layer[]) {
for (const layer of layers) {
this.raiseLayer(layer);
if (layer.baseLayer !== true) {
this.raiseLayer(layer);
}
}
}

Expand All @@ -293,7 +295,9 @@ export class IgoMap {
lowerLayers(layers: Layer[]) {
const reverseLayers = layers.reverse();
for (const layer of reverseLayers) {
this.lowerLayer(layer);
if (layer.baseLayer !== true) {
this.lowerLayer(layer);
}
}
}

Expand Down

0 comments on commit f57405c

Please sign in to comment.