* 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
()
| 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 | /** |