openlayers,使用 YUI 进行错误压缩

发布于 2024-10-17 23:53:23 字数 307 浏览 2 评论 0原文

当我尝试使用 YUI 2.4.2(默认版本,而不是自定义构建)压缩 OpenLayers.js 2.10 时,我遇到了问题。即使我使用位于此处的 js 托管版本,也已经从 OL 站点下载了新包: OpenLayers Hosted

问题是除了加载地图之外几乎所有功能都被破坏了(我使用谷歌作为地图提供商) ,而在过去(OL 2.8)我有成功的尝试。

那么有人有解决方案吗?或者也许愿意分享已经成功的压缩版本?

谢谢

I have an issue when i tried to compress OpenLayers.js 2.10 with YUI 2.4.2 (the default one, not custom build). Already download the new package from OL site even i use hosted version of their js located here:
OpenLayers Hosted

The problem was almost every feature broken except for loading map (i use google as map provider), while in past (OL 2.8) i have successful attempt.

So anyone has solution for this? Or maybe willing to share the already successful compressed version?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

橘味果▽酱 2024-10-24 23:53:23

http://comments.gmane.org/gmane.comp.gis。 openlayers.user/17193

FTA:

我不确定这是否与 YUI 压缩器相关,但我发现 minify 项目中的 JSMin 进程对于包含以“/”字符开头的行的文件会失败。具体请参见:http://code.google.com/p/ minify/issues/detail?id=205

我特别必须修改文件 XYZ.js(或单文件构建中的相应代码),并删除开头带有斜杠的行中的回车符。之后,缩小过程运行良好。也许您在 YUI 压缩器方面也会有类似的运气...否则,您可能必须尝试手动缩小 OpenLayers 代码中导致 YUI 崩溃的特定部分。

如果做不到这一点,问题可能是单文件构建与多文件构建。请参阅此处: http://docs.openlayers.org/library/deploying .html#single-file-build

http://comments.gmane.org/gmane.comp.gis.openlayers.user/17193

FTA:

I'm not sure if this is relevant to the YUI compressor, but I found that the JSMin process from the minify project would fail for files that contain lines that start with a '/' character. Specifically, see: http://code.google.com/p/minify/issues/detail?id=205

I specifically had to modify the file XYZ.js (or the corresponding code in a single-file build), and removed the carriage returns in the lines that had slashes at the start. After that, the minify process worked fine. Maybe you'll have similar luck with YUI compressor...otherwise, you may have to try to manully narrow-down the specific parts of the OpenLayers code that's tripping up YUI.

Failing that, the problem might be that single vs. multi file build. See here: http://docs.openlayers.org/library/deploying.html#single-file-build

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文