Google Maps API V3 Infobox.js removed

假装没事ソ 提交于 2019-11-26 11:51:42

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.

Chris Cook

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.

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.

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.

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!