Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7776465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:53:28+00:00 2026-06-01T17:53:28+00:00

*NOTE – This code is from a third party extension. I had no part

  • 0

*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!

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.

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.

Before there was no errors but now in Chrome it says:

“Uncaught SyntaxError: Unexpected token )” for line 1669 in a JS File. You can see the file in the following Gist:

https://gist.github.com/2238148

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.

Searched the web and here is an example site using the same component with the same error: http://goo.gl/GMgOs

This issue appears to be near:

// 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);
        }
    }

If that code needs to be alterted could someone post the modified version on a gist or pastie?

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: https://developers.google.com/maps/documentation/javascript/v2/reference#GMap2.Methods.Overlays 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:53:30+00:00Added an answer on June 1, 2026 at 5:53 pm

    The code is an abomination, in fact I’ve not seen a worse add-on in five years of working with and helping users of Version 2. It overwrites GMap (part of the Version 2 API to provide compatibility with Version 1) with no redeclaration. The error you’re getting is a direct result of a hack to minified code: this was bound to fail at some point and should never have been implemented.

    The best thing you can do is to remove the var digraph line and then redefine the new method GMap2.prototype.addOverlays which follows it. That will allow the code to use the API’s addOverlay() function and should eliminate the problem.

    GMap2.prototype.addOverlays = function(a) {
            var i = a.length;
            while (i--) {
                 this.addOverlay(a[i]);
            }
    

    It appears that addOverlays() takes an array of overlays. The existing method attempts to add them directly to the internal array of overlays, which has moved. The suggested method simply uses GMap2’s own addOverlay() method to add each member of the array of objects. Thus we use an exposed method and don’t try and hijack the minified code of the API — if we did that again, it would almost certainly break again.


    GMarker.prototype.openInfoWindowFX and GMarker.prototype.updateInfoWindow are additions to GMarker and unlikely to cause problems (especially if they currently work), although even they use properties of GMarker — which isn’t really recommnded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note : The code in this question is part of deSleeper if you want
Note: This question has broadened in scope from previous revisions. I have tried to
Note The question below was asked in 2008 about some code from 2003. As
Note: This question was originally part of Magento SOAP API V2 with C#: Issue
Note: I have seen this and tried to take as much from it as
Note: this was inspired by WebBrowser Event Properties? Why am I able to access
Note this question was originally posted in 2009, before C++11 was ratified and before
NOTE: I have solved the majority of this problem but have run into a
Note: This issue appears to be limited to SQL Server 2005 SP2 I have
Note: I've read this and its not quite what I'm looking for: I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.