代码之家  ›  专栏  ›  技术社区  ›  Zufar Muhamadeev

使用源代码映射调试openlayers 5应用程序

  •  0
  • Zufar Muhamadeev  · 技术社区  · 7 年前

    我正在从openlayers 2迁移到5。我已经下载了 distribution 与缩小js和源代码地图。然后我在index.html中包含了js文件:

    <script src="bower_components/openlayers/ol.js"></script>
    

    现在我想调试源代码。当我踏入 ol.js 存在“检测到源映射”消息。问题是我在chrome开发控制台中没有看到源映射文件中的源:

    enter image description here

    1 回复  |  直到 7 年前
        1
  •  1
  •   Zufar Muhamadeev    7 年前

    现在我使用ol-debug.js进行调试。也许源代码映射是更好的调试方法,但仍然无法使其正常工作。我也跟着 https://github.com/openlayers/openlayers/issues/8330 . 它只在linux/mac上工作。所以要编译ol debug.js(应该安装npm):

    git clone https://github.com/openlayers/openlayers.git
    cd openlayers
    npm install
    npm install --global rollup
    

    然后遵循github问题中的步骤。