MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / getStyleResolutions

Method getStyleResolutions

src/openlayers/mapping/WebMap.js:5192–5205  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.getStyleResolutions * @description 创建图层分辨率。 * @param {Object} bounds 图层上下左右范围。 * @returns {Array} styleResolutions 样式分辨率。

(bounds, minZoom = 0, maxZoom = 22)

Source from the content-addressed store, hash-verified

5190 * @returns {Array} styleResolutions 样式分辨率。
5191 */
5192 getStyleResolutions(bounds, minZoom = 0, maxZoom = 22) {
5193 let styleResolutions = [];
5194 const TILE_SIZE = 512;
5195 let temp = Math.abs(bounds.left - bounds.right) / TILE_SIZE;
5196 for (let i = minZoom; i <= maxZoom; i++) {
5197 if (i === 0) {
5198 styleResolutions[i] = temp;
5199 continue;
5200 }
5201 temp = temp / 2;
5202 styleResolutions[i] = temp;
5203 }
5204 return styleResolutions;
5205 }
5206
5207 /**
5208 * @private

Callers 2

createMVTLayerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected