sandbox/svgmap/src/components/map/SlippyBoard.tsx

25 lines
536 B
TypeScript
Raw Normal View History

2022-10-14 22:03:35 +00:00
import react, { ReactElement, ReactNode } from 'react';
2022-10-13 15:30:05 +00:00
interface SlippyBoardProperties {
boardSize: number;
shift: { x: number; y: number };
zoom: number;
2022-10-15 09:58:02 +00:00
children: any;
2022-10-13 15:30:05 +00:00
}
const SlippyBoard: react.FC<SlippyBoardProperties> = (
props: SlippyBoardProperties
) => {
return (
<svg height={props.boardSize} width={props.boardSize}>
<g
transform={`translate(${props.shift.x}, ${props.shift.y}) scale(${props.zoom})`}
>
2022-10-15 09:58:02 +00:00
{props.children}
2022-10-13 15:30:05 +00:00
</g>
</svg>
);
};
export default SlippyBoard;