MCPcopy Create free account
hub / github.com/carbonplan/maps / zoomToLevel

Function zoomToLevel

src/utils.js:76–79  ·  view source on GitHub ↗
(zoom, maxZoom)

Source from the content-addressed store, hash-verified

74}
75
76export const zoomToLevel = (zoom, maxZoom) => {
77 if (maxZoom) return Math.min(Math.max(0, Math.floor(zoom)), maxZoom)
78 return Math.max(0, Math.floor(zoom))
79}
80
81export const mercatorYFromLat = (lat) => {
82 return (

Callers 1

TilesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected