如何在本地服务器上托管 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 示例?

我尝试了什么:

我想它需要特定版本的 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 版本即可获得它