MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / setVisibleScales

Method setVisibleScales

src/openlayers/mapping/WebMap.js:3325–3331  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.setVisibleScales * @description 改变图层可视范围 * @param {Object} layer - 图层对象。ol.Layer * @param {Object} visibleScale - 图层样式参数

(layer, visibleScale)

Source from the content-addressed store, hash-verified

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

Callers 4

addLayerMethod · 0.95
addLabelLayerMethod · 0.95
createDataflowLayerMethod · 0.95
WebMap2Spec.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected