let app = null; let mapContainer = null; export function syncApp(param) { app = param; } export function syncMapContainer(param) { mapContainer = param; } export const getRealPosition = (x, y, mapContainer) => { const rect = app.view.getBoundingClientRect(); return { mapX: (x - rect.left) / mapContainer.scale.x - mapContainer.x / mapContainer.scale.x, mapY: (y - rect.top) / mapContainer.scale.y - mapContainer.y / mapContainer.scale.y } }