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

I have a RichFaces 3.3.3 based web application that uses Google Maps (maps-api v3), which worked until recently.

Recently, you cannot draw custom controls. The map is drawn fine, but the controls are not displayed, such as map type or zoom control.

A bit of investigation seems to be a compatibility issue with prototype.js.

If you just 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 browsers:

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

And the user controls dissapear ...

Does anyone know how to solve this problem?

Now I will try to change prototype.js in richfaces for a more modern version ... I will update when I learn more.

!

--- UPDATE ---

  • Google Maps . v = 3 src script. Dr.Molle.
  • prototypejs (1.7.2). . @eepete.

--- 2 ---

  • v = 3 richfaces 3.3.3 (prototype-1.6.0.3.js), , v = 3.17 google.

, backguards prototype-1.6.0.3.js:

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

. , , , . prototype.js (1.7.2) ​​ (1.7), . google maps api V3, . , prototype.js, Google - , -, .

+8

!! :

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

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

!!

+3

v3, , ​​ , .

0

This function on line 629ish in prototype.js throws an exception. Just add catch 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;
}
Run code
0
source

All Articles