#
luxiaotao1123
2024-03-03 81ec08bd0f5a2ffc8acc9955f7cf80654ab480e8
zy-asrs-flow/src/pages/map/utils.js
@@ -12,10 +12,10 @@
    mapContainer = param;
}
export const getRealPosition = (x, y, scale) => {
export const getRealPosition = (x, y, mapContainer) => {
    const rect = app.view.getBoundingClientRect();
    return {
        mapX: (x - rect.left) / scale,
        mapY: (y - rect.top) / scale
        mapX: (x - rect.left) / mapContainer.scale.x - mapContainer.x / mapContainer.scale.x,
        mapY: (y - rect.top) / mapContainer.scale.y - mapContainer.y / mapContainer.scale.y
    }
}