MCPcopy Create free account
hub / github.com/facebook/Rapid / effectiveZoom

Method effectiveZoom

modules/core/MapSystem.js:842–850  ·  view source on GitHub ↗

* effectiveZoom * The "effective" zoom can be more useful for controlling the experience of the user. * This zoom is adjusted by latitude. * You can think of it as "what the zoom would be if we were editing at the equator" * For example, if we are editing in Murmansk, Russia, at about 69

()

Source from the content-addressed store, hash-verified

840 * @return effective zoom
841 */
842 effectiveZoom() {
843 const viewport = this.context.viewport;
844 const lat = viewport.centerLoc()[1];
845 const z = viewport.transform.zoom;
846 const atLatitude = geoMetersToLon(1, lat);
847 const atEquator = geoMetersToLon(1, 0);
848 const extraZoom = Math.log(atLatitude / atEquator) / Math.LN2;
849 return Math.min(z + extraZoom, MAX_Z);
850 }
851
852
853 /**

Callers 1

_appMethod · 0.80

Calls 1

centerLocMethod · 0.80

Tested by

no test coverage detected