Google Maps和Richfaces 3.3.3(prototype.js 1.6.0.3)可能不兼容 [英] Google Maps and Richfaces 3.3.3 (prototype.js 1.6.0.3) possible incompatibility

查看:94
本文介绍了Google Maps和Richfaces 3.3.3(prototype.js 1.6.0.3)可能不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个基于RichFaces 3.3.3的Web应用程序,它使用Google Maps(maps-api v3),直到最近才开始工作。

最近失败了绘制地图的用户控件。例如,地图绘制良好,但控件不显示,地图类型或缩放控制。

调查一下,它似乎与prototype.js的兼容性问题。



如果您只是将此行添加到 developers.google.com

 < script src =http: //prototypejs.org/assets/2008/9/29/prototype-1.6.0.3.js\"></script> 

js控制台在Chrome浏览器中记录日志:

  Uncaught TypeError:undefined不是函数prototype-1.6.0.3.js:641 

以及用户控件消失...



有人知道如何解决这个问题??

现在我要尝试更改richfaces中的prototype.js以获得更新的版本......我会在知道更多内容时进行更新。



提前致谢!

---更新---




  • 使用产品谷歌地图版本解决了这个问题。现在有必要明确地把v = 3放在脚本标签的src中。感谢Dr.Molle。

  • 将prototypejs更新为(1.7.2)。也可以和实验一起使用。谢谢@eepete。



---更新2 ---


  • 如果您需要使用旧版本的原型,那么使用v = 3不再适用于richfaces 3.3.3(prototype-1.6.0.3.js),现在您需要明确使用v = 3.17在google地图中。



  • 换句话说,在你的页面中使用这个来保护与prototype-1.6.0.3.js的兼容性: p>

     < script src =https://maps.googleapis.com/maps/api/js?v=3.17> < /脚本> 


    解决方案

    今天早上我有同样的问题。得到相同的错误,像缩放控制控件不会呈现。我将prototype.js从版本(1.7)升级到最新版本(1.7.2),并重新开始工作。我使用谷歌地图api V3,生产版本。不知道它是新版本的prototype.js,还是Google改变了一些东西然后修正了一些东西,但现在很开心。


    I have a web application based on RichFaces 3.3.3 that uses Google Maps (maps-api v3), that was working fine until recently.

    Lately is failing to draw the map's user controls. Map is drawn fine but the controls don't appear, map type or zoom control, for example.

    Investigating a little, it seems a compatibility problem with prototype.js.

    If you simply add this line to the example in developers.google.com:

    <script src="http://prototypejs.org/assets/2008/9/29/prototype-1.6.0.3.js"></script>
    

    js console in chrome browser logs this:

    Uncaught TypeError: undefined is not a function       prototype-1.6.0.3.js:641
    

    And the user controls dissapear...

    Somebody knows how to solve this problem??

    Now I'm going to try to change prototype.js in richfaces for a more modern version... I'll update when I know more.

    Thanks in advance!

    --- UPDATE ---

    • Using production version of Google Maps solves the problem. Now is necessary explicitly put v=3 in src in script tag. Thanks Dr.Molle.
    • Updating prototypejs to (1.7.2). Works fine with experimental too. Thanks @eepete.

    --- UPDATE 2 ---

    • Using v=3 isn't working anymore with richfaces 3.3.3 (prototype-1.6.0.3.js) if you need to use this old version of prototype, now you need to explicitly use v=3.17 in google maps.

    In other words, use this in your page for backguards compatibility with prototype-1.6.0.3.js:

    <script src="https://maps.googleapis.com/maps/api/js?v=3.17"></script>
    

    解决方案

    I had the same problem this morning. Got the same error, controls like the zoom control would not render. I upgraded my prototype.js to the latest version (1.7.2) from version (1.7) and things worked again. Am using google maps api V3, the production version. Don't know if it was the newer version prototype.js or if Google changed something and then fixed something, but it's happy now.

    这篇关于Google Maps和Richfaces 3.3.3(prototype.js 1.6.0.3)可能不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆