diff --git a/src/components/map/Handlers.tsx b/src/components/map/Handlers.tsx index 4fb4c7a..2d949b4 100644 --- a/src/components/map/Handlers.tsx +++ b/src/components/map/Handlers.tsx @@ -4,10 +4,11 @@ import { Point } from './types'; import './Handler.css'; import { handlersConfig } from './config'; import { Transformation } from './LiveMap'; +import cache from '../../lib/cache'; /** * - * + * * */ export interface HandlersProperties { @@ -292,6 +293,12 @@ export const Handlers: react.FC = ( } }; + const contextMenuHandler = (event: any) => { + console.log(event); + event.preventDefault(); + console.log(cache.map({ cacheId: 'points' })); + }; + return (
= ( onTouchCancel={touchCancelHandler} onTouchStart={touchStartHandler} onTouchMove={touchMoveHandler} + onContextMenu={contextMenuHandler} /> ); }; diff --git a/src/lib/cache.ts b/src/lib/cache.ts index f239234..14e3dc6 100644 --- a/src/lib/cache.ts +++ b/src/lib/cache.ts @@ -49,6 +49,13 @@ const cache = { k.delete(key); return value; }, + map: (params: any) => { + const { cacheId } = params; + if (!_allCaches.has(cacheId)) { + return null; + } + return _allCaches.get(cacheId); + }, }; export default cache;