Add tile server types

This commit is contained in:
Maciej Ziarkowski 2019-09-17 17:50:46 +01:00
commit bb6966dccb

43
app/src/tiles/types.ts Normal file
View File

@ -0,0 +1,43 @@
import { Image } from 'mapnik';
/**
* Bounding box in the format [w, s, e, n]
*/
type BoundingBox = [number, number, number, number];
interface TileParams {
/**
* Name of tileset to which the tile belongs
*/
tileset: string;
/**
* Zoom level
*/
z: number;
/**
* X coordinate of tile (corresponds to longitude)
*/
x: number;
/**
* Y coordinate of tile (corresponds to latitude)
*/
y: number;
/**
* Resolution scale factor for higher pixel density tiles (e.g. x2)
*/
scale: number;
}
interface TileRenderer {
getTile(tileParams: TileParams, dataParams: any): Promise<Image>
}
export {
BoundingBox,
TileParams,
TileRenderer
};