Adding tests for the <Map> component.
This commit is contained in:
parent
b3a8f60f1e
commit
b5dd10e920
|
@ -1,4 +1,4 @@
|
||||||
import react, { useCallback, useState } from 'react';
|
import react, { useCallback } from 'react';
|
||||||
import { atom, useAtom } from 'jotai';
|
import { atom, useAtom } from 'jotai';
|
||||||
|
|
||||||
import Handlers from './Handlers';
|
import Handlers from './Handlers';
|
||||||
|
@ -8,12 +8,26 @@ import { Point, TileFactory } from './types';
|
||||||
|
|
||||||
export interface MapProperties {}
|
export interface MapProperties {}
|
||||||
|
|
||||||
const initialCoordinateSystem = {
|
/**
|
||||||
|
* Definition of a coordinate system
|
||||||
|
*
|
||||||
|
* The coordinate system is shifted and zoomed (from the viewport origin)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export interface CoordinateSystem {
|
||||||
|
/** Zoom relative to the origin */
|
||||||
|
zoom: number;
|
||||||
|
/** Origin's shift (in pixels) */
|
||||||
|
shift: Point;
|
||||||
|
}
|
||||||
|
|
||||||
|
const initialCoordinateSystem: CoordinateSystem = {
|
||||||
zoom: 1,
|
zoom: 1,
|
||||||
shift: { x: 0, y: 0 },
|
shift: { x: 0, y: 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
const coordinateSystemAtom = atom(initialCoordinateSystem);
|
/** An atom to store the map coordinates system */
|
||||||
|
export const coordinateSystemAtom = atom(initialCoordinateSystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description of coordinates system transformation
|
* Description of coordinates system transformation
|
||||||
|
|
Loading…
Reference in New Issue