dyomedea/src/components/map/TiledLayer.tsx

29 lines
812 B
TypeScript
Raw Normal View History

2022-10-17 10:04:25 +00:00
import react from 'react';
2022-10-17 11:47:35 +00:00
import { Rectangle, TileKeyObject } from './types';
2022-10-17 10:04:25 +00:00
export interface TiledLayerProperties {
/** The key of the first (ie top/left) tile */
2022-10-17 11:47:35 +00:00
keyObject: TileKeyObject;
2022-10-17 10:04:25 +00:00
/** Number of tiles (in each direction since TiledLayers are square)*/
nbTiles: number;
2022-10-17 11:47:35 +00:00
/** The current viewport expressed in tiles coordinates */
viewPort: Rectangle;
2022-10-17 10:04:25 +00:00
}
/**
2022-10-17 11:47:35 +00:00
* A lazily loaded square layer of tiles.
*
* This component is rather dumb and is mainly a sparse array of tiles.
* New tiles are added to the array when the viewport is updated and they stay in the array until
* the component is destroyed or its number of tiles is updated.
2022-10-17 10:04:25 +00:00
*
*/
export const TiledLayer: react.FC<TiledLayerProperties> = (
props: TiledLayerProperties
) => {
return <></>;
};
export default TiledLayer;