【问题标题】:Debugging openlayers 5 application, using source map使用 source map 调试 openlayers 5 应用程序
【发布时间】:2018-10-19 14:49:31
【问题描述】:

我正在从 openlayers 2 迁移到 5。我已经下载了 distribution 以及缩小的 js 和源映射。然后我在 index.html 中包含了 js 文件:

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

现在我想调试源。当我进入ol.js 时,会出现“检测到源地图”消息。问题是我在源映射文件的 chrome 开发控制台源中看不到:

【问题讨论】:

  • 如果您点击“检测到源地图”旁边的“更多”会发生什么?
  • @geocodezip 我看到关注i.imgur.com/8aF8xxT.png,但如果我按Ctrl + P - 看不到openlayers 源。我从 github repo 输入 proj.js 或其他文件名。

标签: google-chrome openlayers source-maps openlayers-5


【解决方案1】:

现在我使用 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 issue 中的步骤进行操作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-12-31
    • 1970-01-01
    • 2023-03-31
    • 2012-11-23
    • 1970-01-01
    • 2014-02-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多