Skip to content

Commit

Permalink
fix(mapOfflineDirective): keep layer's maxResolution on online/offlin…
Browse files Browse the repository at this point in the history
…e toggle (#1166)
  • Loading branch information
pelord authored Jan 18, 2023
1 parent 1f281d2 commit 1a5f238
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/geo/src/lib/map/shared/mapOffline.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ export class MapOfflineDirective implements AfterViewInit {
this.networkState.connection === false ||
this.offlineButtonState.connection === false
) {
layer.ol.setMaxResolution(0);
layer.maxResolution = 0;
return;
} else if (
this.networkState.connection === true ||
this.offlineButtonState.connection === true
) {
layer.ol.setMaxResolution(Infinity);
layer.maxResolution = layer.options.maxResolution || Infinity;
return;
}
}
Expand Down Expand Up @@ -163,25 +163,25 @@ export class MapOfflineDirective implements AfterViewInit {
this.networkState.connection === false ||
this.offlineButtonState.connection === false
) {
layer.ol.setMaxResolution(0);
layer.maxResolution = 0;
} else if (
this.networkState.connection === true ||
this.offlineButtonState.connection === true
) {
layer.ol.setMaxResolution(Infinity);
layer.maxResolution = layer.options.maxResolution || Infinity;
}
}
} else {
if (
this.networkState.connection === false ||
this.offlineButtonState.connection === false
) {
layer.ol.setMaxResolution(0);
layer.maxResolution = 0;
} else if (
this.networkState.connection === true ||
this.offlineButtonState.connection === true
) {
layer.ol.setMaxResolution(Infinity);
layer.maxResolution = layer.options.maxResolution || Infinity;
}
}
});
Expand Down

0 comments on commit 1a5f238

Please sign in to comment.