Note that there are some explanatory texts on larger screens.

plurals
  1. POUncaught SyntaxError: Unexpected token )
    primarykey
    data
    text
    <p>*NOTE - This code is from a third party extension. I had no part of it's creation and several years ago when used it was the only extension available at the time. So while I appreciate your opinions, I do hope all comments can be just for suggestions on a resolution. Thanks!</p> <p>We have many sites running a Google Maps component for a CMS that allows for clients to add markers and outlines (polygons) to their Google Maps.</p> <p>This has been working for years. To note, it uses Google Maps JS API 2, which has been discontinued rather than API 3. However, Google has noted API 2 will still work well into 2013 so that is not the issue. However, they must have changed something because as of the other day, on all our sites though the Maps appear the markers and polygons do not. They are on different servers.</p> <p>Before there was no errors but now in Chrome it says:</p> <p>"Uncaught SyntaxError: Unexpected token )" for line 1669 in a JS File. You can see the file in the following Gist:</p> <p><a href="https://gist.github.com/2238148" rel="nofollow">https://gist.github.com/2238148</a></p> <p>As you can see there is no missing ")" and the code has work unmodified for years on nearly 100 sites, so assume something on Google's end must have changed. But is there something we can adjust to this code to help counter there change? -Update on March 25th when all of this broke Google made an update to their Google Maps API 2.</p> <p>Searched the web and here is an example site using the same component with the same error: <a href="http://goo.gl/GMgOs" rel="nofollow">http://goo.gl/GMgOs</a></p> <p>This issue appears to be near:</p> <pre> // extract current digraph from overlay function var digraph = GMap.addOverlay.toString().replace(/\s/g,'').replace(/.push\([^{]+\);a.initialize\([^{]+\);a.redraw\([^{]+\).+$/,'').replace(/^.+\./,''); // add multiple overlays at once (api hack to improve loading speed) GMap2.prototype.addOverlays = function(a) { var b = eval('this.' + digraph); var i = a.length; while (i--) { b.push(a[i]); a[i].initialize(this); a[i].redraw(true); } } </pre> <p>If that code needs to be alterted could someone post the modified version on a gist or pastie?</p> <p>Another Update - That code in the pre above I commented out since it supposively is not needed by was a hack to speed things up. Still gets an error however noted in the comments. I did notice however here: <a href="https://developers.google.com/maps/documentation/javascript/v2/reference#GMap2.Methods.Overlays" rel="nofollow">https://developers.google.com/maps/documentation/javascript/v2/reference#GMap2.Methods.Overlays</a> that it calls the code, "addOverlay" rather than "addOverlays" so wondering if maybe the s was taken off in the most recent API Google update. Removing the s in all three locations just shoots out a new error which repeats [object] many times.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload