Google Maps and Richfaces 3.3.3 (prototype.js 1.6.0.3) possible incompatibility

前端 未结 4 1685
有刺的猬
有刺的猬 2020-12-04 02:30

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 use

相关标签:
4条回答
  • 2020-12-04 02:53

    This function at line number 629ish in prototype.js is causing the exception. Simply add try catch blocks as shown below. It works with any Google Maps API.

    collect: function(iterator, context) {
      iterator = iterator ? iterator.bind(context) : Prototype.K;
      var results = [];
      try {
        this.each(function(value, index) {
          results.push(iterator(value, index));
        });
      } catch (err) {}
      return results;
    }

    0 讨论(0)
  • 2020-12-04 02:56

    Change to version v3, the conflict with prototype will disappear, I have tried in my site, it works fine.

    0 讨论(0)
  • 2020-12-04 03:04

    Yes!! the solution for me was change the line from:

    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false" />
    

    to

    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&v=3" />
    

    Thanks!!

    0 讨论(0)
  • 2020-12-04 03:18

    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.

    0 讨论(0)
提交回复
热议问题