如何在本地服务器上托管 openlayer 示例?
How to host openlayer examples on a local server?
我必须使用旧版本的 OpenLayers(4.6.2). The examples are really useful to try out and to copy paste from. However the web page with examples 包含最新版本。
是否可以在本地托管 OpenLayers 示例?
我尝试了什么:
- 签出 4.6.2 版本
- npm 安装
- npm 运行-script start --> 启动服务器,但示例不起作用
npm 运行-script transform --> 抛出如下错误
npm 错误!代码生命周期
错误!错误号 1
错误! openlayers@4.6.2 棉绒:eslint tasks test src examples transforms "--fix"
错误!退出状态 1
错误!
错误!在 openlayers@4.6.2 lint 脚本中失败。
错误!这可能不是 npm 的问题。上面可能有额外的日志输出。
npm 错误!此 运行 的完整日志可在以下位置找到:
错误! D:\Users\liptak\AppData\Roaming\npm-cache_logs18-08-07T14_58_46_839Z-debug.log
错误!代码生命周期
错误!错误号 1
错误! openlayers@4.6.2 变换:npm run changecase-src && npm run transform-src && npm run transform-examples && npm run transform-test && npm run lint -- --fix
错误!退出状态 1
错误!
错误! openlayers@4.6.2 转换脚本失败。
错误!这可能不是 npm 的问题。上面可能有额外的日志输出。
npm 错误!此 运行 的完整日志可在以下位置找到:
错误! D:\Users\liptak\AppData\Roaming\npm-cache_logs18-08-07T14_58_46_895Z-debug.log
我想它需要特定版本的 Node 和 NPM 才能构建,但我不知道如何找到它。
有人可以帮我吗?我必须构建 OpenLayers,还是有更简单的解决方案来启动示例?
您可以尝试在本地构建示例,而不是费力地使用本地构建系统,您可以简单地访问旧版本的 OpenLayers API 和示例。
如图所示,对于v4.6.2(至少升级到v4.6.5)你可以使用http://openlayers.org/en/v4.6.2/examples/ and http://openlayers.org/en/v4.6.2/apidoc/
您只需更改 url OpenLayers 版本即可获得它
我必须使用旧版本的 OpenLayers(4.6.2). The examples are really useful to try out and to copy paste from. However the web page with examples 包含最新版本。
是否可以在本地托管 OpenLayers 示例?
我尝试了什么:
- 签出 4.6.2 版本
- npm 安装
- npm 运行-script start --> 启动服务器,但示例不起作用
npm 运行-script transform --> 抛出如下错误
npm 错误!代码生命周期 错误!错误号 1 错误! openlayers@4.6.2 棉绒:
eslint tasks test src examples transforms "--fix"
错误!退出状态 1 错误! 错误!在 openlayers@4.6.2 lint 脚本中失败。 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。npm 错误!此 运行 的完整日志可在以下位置找到: 错误! D:\Users\liptak\AppData\Roaming\npm-cache_logs18-08-07T14_58_46_839Z-debug.log 错误!代码生命周期 错误!错误号 1 错误! openlayers@4.6.2 变换:
npm run changecase-src && npm run transform-src && npm run transform-examples && npm run transform-test && npm run lint -- --fix
错误!退出状态 1 错误! 错误! openlayers@4.6.2 转换脚本失败。 错误!这可能不是 npm 的问题。上面可能有额外的日志输出。npm 错误!此 运行 的完整日志可在以下位置找到: 错误! D:\Users\liptak\AppData\Roaming\npm-cache_logs18-08-07T14_58_46_895Z-debug.log
我想它需要特定版本的 Node 和 NPM 才能构建,但我不知道如何找到它。
有人可以帮我吗?我必须构建 OpenLayers,还是有更简单的解决方案来启动示例?
您可以尝试在本地构建示例,而不是费力地使用本地构建系统,您可以简单地访问旧版本的 OpenLayers API 和示例。
如图所示,对于v4.6.2(至少升级到v4.6.5)你可以使用http://openlayers.org/en/v4.6.2/examples/ and http://openlayers.org/en/v4.6.2/apidoc/
您只需更改 url OpenLayers 版本即可获得它