问题
One of our production pages stopped working properly. Tracked it down to the fact that one of the dependencies does not exist anymore:
http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js
This URL is used in most of the example codes that were the basis of the webpage.
This is probably easily solved but a quick google showed no one has noticed this, I think it has happened in the last hour and just wanted to put the information out there in case people are panicking.
回答1:
It seems that the library is being moved to Github (it seems the infobox.js wasn't moved yet), see the announcement on main page: https://code.google.com/p/google-maps-utility-library-v3/ But still, the problem with your code is that it's not a good practise to reference code from code.google.com svn repository. It's like referencing a code from Github, it can be changed/moved/removed any time. You should either download the code and include it in your project as .js file or host it yourself on some CDN server.
UPDATE
The google utility library (including infobox) is hosted here on github now. As said before, it's not mean to be referenced from there in projects.
回答2:
As Google moved the source over to GitHub a while back, the new GitHub version can be accessed from RawGit by using the following script urls (standard and packed versions):
https://cdn.rawgit.com/googlemaps/v3-utility-library/master/infobox/src/infobox.js
https://cdn.rawgit.com/googlemaps/v3-utility-library/master/infobox/src/infobox_packed.js
Whilst the above urls (with the cdn prefixes) have no traffic limits or throttling and the files are served via a super fast global CDN, please bear in mind that RawGit is a free hosting service and offers no uptime or support guarantees.
Accessing files maintained via GitHub is covered in more detail in the following SO answer:
Link and execute external JavaScript file hosted on GitHub
This post also covers that, if you're linking to files on GitHub, in production you should consider targeting a specific release tag to ensure you're getting a specific release version of the script.
For example, you could target the 1.1.13 release of the InfoBox library with the following script urls (standard and packed versions):
https://cdn.rawgit.com/googlemaps/v3-utility-library/infobox/1.1.13/src/infobox.js
https://cdn.rawgit.com/googlemaps/v3-utility-library/infobox/1.1.13/src/infobox_packed.js
Alternatively, you could download and include the library directly in your project for production purposes.
回答3:
As an emergency fix I copied the code from here: https://code.google.com/p/google-maps-utility-library-v3/source/browse/trunk/infobox/src/infobox.js?r=466
and linked locally. This appears to work fine for a quick fix but I will need to look for an alternative that see active updates.
回答4:
Google code is apparently shut down per the announcement
Bidding farewell to Google Code
Thursday, March 12, 2015
- January 25, 2016 - The project hosting service is closed. You will be able to download a tarball of project source, issues, and wikis. These tarballs will be available throughout the rest of 2016.
Certainly wasn't clear from the post that they were going to stop making the hosted code available for use externally.
回答5:
Managed to get back the Infobox (v.1.1.13) script from the browser cache. Can be downloaded from http://pastebin.com/PGciVVur, hope this helps someone
回答6:
I linked to this github repo that seems to be a similar one and my site works again:
https://raw.githubusercontent.com/oytunyuksel/Google-Maps-Infobox.js/master/src/infobox.js
来源:https://stackoverflow.com/questions/37171426/google-maps-api-v3-infobox-js-removed