* @private * @function WebMap.prototype.setVisibleScales * @description 改变图层可视范围 * @param {Object} layer - 图层对象。ol.Layer * @param {Object} visibleScale - 图层样式参数
(layer, visibleScale)
| 3323 | * @param {Object} visibleScale - 图层样式参数 |
| 3324 | */ |
| 3325 | setVisibleScales(layer, visibleScale) { |
| 3326 | let maxResolution = this.resolutions[visibleScale.minScale], |
| 3327 | minResolution = this.resolutions[visibleScale.maxScale]; |
| 3328 | //比例尺和分别率是反比的关系 |
| 3329 | maxResolution > 1 ? layer.setMaxResolution(Math.ceil(maxResolution)) : layer.setMaxResolution(maxResolution * 1.1); |
| 3330 | layer.setMinResolution(minResolution); |
| 3331 | } |
| 3332 | |
| 3333 | /** |
| 3334 | * @private |
no outgoing calls
no test coverage detected