MCPcopy
hub / github.com/google-map-react/google-map-react / latLng2Tile

Function latLng2Tile

src/lib/index.js:195–203  ·  view source on GitHub ↗
({ lat, lng }, zoom)

Source from the content-addressed store, hash-verified

193}
194
195export function latLng2Tile({ lat, lng }, zoom) {
196 const worldCoords = latLng2World({ lat, lng });
197 const scale = Math.pow(2, zoom);
198
199 return {
200 x: Math.floor(worldCoords.x * scale),
201 y: Math.floor(worldCoords.y * scale),
202 };
203}
204
205export function getTilesIds({ from, to }, zoom) {
206 const scale = Math.pow(2, zoom);

Callers

nothing calls this directly

Calls 1

latLng2WorldFunction · 0.85

Tested by

no test coverage detected