MCPcopy Create free account
hub / github.com/OpenSIST/OpenSIST.github.io / clickHandler

Function clickHandler

src/Components/WorldMap/display.js:307–319  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

305}
306
307export function clickHandler(e) {
308 const {left, top} = e.currentTarget.getBoundingClientRect();
309 const clickX = e.clientX - left;
310 const clickY = e.clientY - top;
311
312 if ((shanghai_projected[0] - clickX) ** 2 + (shanghai_projected[1] - clickY) ** 2 < (10 * proportion) ** 2) {
313 force = true;
314 }
315 clearTimeout(forceTimeoutId);
316 forceTimeoutId = setTimeout(() => {
317 force = false
318 }, 2000);
319}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected