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

Method _getResolution

src/mapboxgl/overlay/MapvLayer.js:116–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114 }
115
116 _getResolution() {
117 var bounds = this.map.getBounds();
118 var dw = bounds.getEast() - bounds.getWest();
119 var rect = this.map.getCanvas().getBoundingClientRect();
120 var resolutionX = dw / rect.width;
121 // 一个像素是多少米
122 return getMeterPerMapUnit('DEGREE') * resolutionX;
123 }
124
125 _getCenterPixel() {
126 return this.map.project(new mapboxgl.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