Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(layer-list): fix baselayer with select all and opacity CSS #632

Merged
merged 1 commit into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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