Testing the onContextMenu event.
This commit is contained in:
parent
8906bed1e7
commit
c731c6a7e6
|
@ -4,6 +4,7 @@ import { Point } from './types';
|
|||
import './Handler.css';
|
||||
import { handlersConfig } from './config';
|
||||
import { Transformation } from './LiveMap';
|
||||
import cache from '../../lib/cache';
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -292,6 +293,12 @@ export const Handlers: react.FC<HandlersProperties> = (
|
|||
}
|
||||
};
|
||||
|
||||
const contextMenuHandler = (event: any) => {
|
||||
console.log(event);
|
||||
event.preventDefault();
|
||||
console.log(cache.map({ cacheId: 'points' }));
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className='handler'
|
||||
|
@ -306,6 +313,7 @@ export const Handlers: react.FC<HandlersProperties> = (
|
|||
onTouchCancel={touchCancelHandler}
|
||||
onTouchStart={touchStartHandler}
|
||||
onTouchMove={touchMoveHandler}
|
||||
onContextMenu={contextMenuHandler}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue