gpt4 book ai didi

javascript - Openlayers DragRotate map 交互不起作用

转载 作者:行者123 更新时间:2023-12-04 13:46:36 26 4
gpt4 key购买 nike

这是我在这里的第一个问题,所以请对我好一点:)

我在尝试使用 OpenLayers 的 DragRotate 交互时遇到问题。我的 map 通过使用 QWebView 小部件嵌入到 Qt 应用程序中。据我所知,默认情况下将 DragRotate 交互添加到 map 中,如您在文档中所见:/image/nr3yv.png

此外,默认情况下,DragRotate 交互通过按 Alt+Shift 来工作:/image/McIn3.png

但是当我加载它并尝试使 map 旋转时,它不起作用。其余的交互似乎工作正常。我还尝试使用 map.addInteraction(new ol.interaction.DragRotate()); 手动添加交互没有成功

相关信息:

  • Windows 10
  • Qt 5.9.1。 QWebEngine 库
  • OpenLayers 4.3.2

  • 我希望你能帮助我。提前致谢

    更新 : 刚刚在 Chrome 浏览器中测试过, map 可以通过按 Shift+Alt 并通过左键单击拖动来旋转。但是在 Qt 应用程序中仍然没有成功。有什么猜想吗?

    最佳答案

    已经有几年了,但我也在寻找这个,并弄清楚了。

    import { altKeyOnly } from "ol/events/condition"

    [...rest of your code here]

    const dragDragRotateInteraction = new DragRotate({
    condition: altKeyOnly,
    });

    关于javascript - Openlayers DragRotate map 交互不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46239518/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com