openlayer5以后,代码模块化,传统的f12调试不好使了,下面尝试了如何使用webstorm+node进行ol的debug的,

为贪图方便,直接下载的ol-5.1.3的源码,webstrom中打开,

terminal中,npm install

安装完成中,npm run 查看可以使用的命令,npm run serve-exmples

webstrom+node+oldebug

跑起来后8081端口,

webstrom+node+oldebug

任意选择一例子,作为debug测试对象,例如http://localhost:8081/mousewheel-zoom.html

webstrom edit configurations,添加javascript debug

webstrom+node+oldebug

配置如下,url选择以及跑起来的地图例子

webstrom+node+oldebug

然后可以对所有的代码进行断点调试,包括openlayer的源码

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2022-01-16
  • 2021-06-02
  • 2021-04-03
  • 2022-01-15
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2021-11-04
  • 2021-06-13
  • 2021-05-28
  • 2022-12-23
  • 2021-04-02
相关资源
相似解决方案