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

[Bugfix] Apply min and max resolutions to base layers removed by single WMS Layer #4365

Merged
merged 2 commits into from
Apr 15, 2024
Merged
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
27 changes: 13 additions & 14 deletions assets/src/modules/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { mainLizmap, mainEventDispatcher } from './Globals.js';
import Utils from './Utils.js';
import { BaseLayerTypes } from './config/BaseLayer.js';
import { MapLayerLoadStatus } from './state/MapLayer.js';
import { MapLayerLoadStatus, MapLayerState } from './state/MapLayer.js';
import olMap from 'ol/Map.js';
import View from 'ol/View.js';
import { ADJUSTED_DPI } from '../utils/Constants.js';
Expand Down Expand Up @@ -443,13 +443,13 @@ export default class map extends olMap {
} else {
if(mainLizmap.state.map.singleWMSLayer){
baseLayerState.singleWMSLayer = true;
this._statesSingleWMSLayers.set(baseLayerState.name, baseLayerState);
this._statesSingleWMSLayers.set(baseLayerState.name, baseLayerState);
} else {
if (this._useTileWms) {
baseLayer = new TileLayer({
// extent: extent,
minResolution: minResolution,
maxResolution: maxResolution,
minResolution: layerMinResolution,
maxResolution: layerMaxResolution,
source: new TileWMS({
url: mainLizmap.serviceURL,
projection: qgisProjectProjection,
Expand Down Expand Up @@ -760,7 +760,7 @@ export default class map extends olMap {
}
/**
* Map and base Layers are loaded as TileWMS
* @type {Boolean}
* @type {boolean}
*/
get useTileWms(){
return this._useTileWms;
Expand All @@ -774,14 +774,14 @@ export default class map extends olMap {
}
/**
* WMS/TileWMS high dpi support
* @type {Boolean}
* @type {boolean}
*/
get hidpi(){
return this._hidpi;
}
/**
* Is dragZoom active?
* @type {Boolean}
* @type {boolean}
*/
get isDragZoomActive(){
return this._dragZoom.getActive();
Expand Down Expand Up @@ -891,8 +891,8 @@ export default class map extends olMap {
/**
* Return overlay layer if `name` matches.
* `name` is unique for every layers
* @param name
* @returns {Layer|undefined}
* @param {string} name The layer name.
* @returns {ImageLayer|undefined} The OpenLayers layer or undefined
*/
getLayerByName(name){
return this.overlayLayers.find(
Expand All @@ -903,8 +903,8 @@ export default class map extends olMap {
/**
* Return overlay layer or group if `name` matches.
* `name` is unique for every layers/groups
* @param name
* @returns {Layer|LayerGroup|undefined}
* @param {string} name The layer or group name.
* @returns {ImageLayer|LayerGroup|undefined} The OpenLayers layer or OpenLayers group or undefined
*/
getLayerOrGroupByName(name){
return this.overlayLayersAndGroups.find(
Expand All @@ -914,9 +914,8 @@ export default class map extends olMap {

/**
* Return MapLayerState instance of WMS layer or group if the layer is loaded in the single WMS image, undefined if not.
*
* @param name
* @returns {MapLayerState|undefined}
* @param {string} name the WMS layer or group name
* @returns {MapLayerState|undefined} the MapLayerState instance of WMS layer or group if the layer is loaded in the single WMS image or undefined.
*/
isSingleWMSLayer(name){

Expand Down
Loading