DefinitelyTyped/types/google-map-react/utils.d.ts
JamieS1211 212f80a60c google-map-react - Added types for util functions (#41598)
* google-map-react Added types for util functions

* Populate other files data

* Capitalise interface name
2020-01-22 10:06:47 -08:00

23 lines
838 B
TypeScript

import { Bounds, Coords, Point, Size } from '.';
interface Tile extends Point {
zoom: number;
}
export function convertNeSwToNwSe(boundCorder: { ne: Coords; sw: Coords }): { nw: Coords; se: Coords };
export function convertNwSeToNeSw(boundCorder: { nw: Coords; se: Coords }): { ne: Coords; sw: Coords };
export function fitBounds(
bounds: Bounds,
size: Size,
): { center: { metersPerLatDegree: number; metersPerLngDegree: number }; zoom: number; newBounds: Bounds };
export function meters2ScreenPixels(meters: number, coords: Coords, zoom: number): { w: number; h: number };
export function tile2LatLng(point: Point, zoom: number): { coords: Coords };
export function latLng2Tile(coords: Coords, zoom: number): { point: Point };
export function getTilesIds(start: { from: number; to: number }, zoom: number): Tile[];