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

Method _getResolution

src/maplibregl/overlay/MapvLayer.js:124–131  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 }
123
124 _getResolution() {
125 var bounds = this.map.getBounds();
126 var dw = bounds.getEast() - bounds.getWest();
127 var rect = this.map.getCanvas().getBoundingClientRect();
128 var resolutionX = dw / rect.width;
129 // 一个像素是多少米
130 return getMeterPerMapUnit('DEGREE') * resolutionX;
131 }
132
133 _getCenterPixel() {
134 return this.map.project(new maplibregl.LngLat(0, 0));

Callers

nothing calls this directly

Calls 3

getMeterPerMapUnitFunction · 0.90
getBoundsMethod · 0.45
getCanvasMethod · 0.45

Tested by

no test coverage detected