MCPcopy Index your code
hub / github.com/google-map-react/google-map-react / meters2ScreenPixels

Function meters2ScreenPixels

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

Source from the content-addressed store, hash-verified

170// Helpers to calc some markers size
171
172export function meters2ScreenPixels(meters, { lat, lng }, zoom) {
173 const { w, h } = meters2WorldSize(meters, { lat, lng });
174 const scale = Math.pow(2, zoom);
175 const wScreen = w * scale * GOOGLE_TILE_SIZE;
176 const hScreen = h * scale * GOOGLE_TILE_SIZE;
177 return {
178 w: wScreen,
179 h: hScreen,
180 };
181}
182
183// --------------------------------------------------
184// Helper functions for working with svg tiles, (examples coming soon)

Callers

nothing calls this directly

Calls 1

meters2WorldSizeFunction · 0.85

Tested by

no test coverage detected