Google Maps JavaScript StreetView bug

I also have the same issue. So, I reopened a relevant GM API tkt: https://issuetracker.google.com/issues/72690631

I tried to rename the function collect into prototype.js but it didn't work.


So the problem is that PrototypeJS is overwriting Array.from as an alias to $A() which creates an extended Array object.

IF (big IF) you are not using Array.from to create a shallow copy of an array and expecting the Prototype extended methods, you can remove/comment out the line in prototype.js that is only

Array.from = $A;

In my copy of 1.7.3 it is line 1114


I also struggled with the conflict between Prototype.js and Google API. Removing Prototype.js was not an option as it is deeply engrained in the project. I decided to replace

Array.from = $A;

by

Array.from = Array.from || $A;

in the prototype.js file. It keeps the support for older browsers which do not have Array.from implemented natively. This does not solve the conflict between Prototype.js and Google API on older browsers though!

This site overrides Array.from() with an implementation that doesn't support iterables, which could cause Google Maps JavaScript API v3 to not work correctly.