2007年12月6日木曜日

Google map APIでエラーが発生 a has no properies.

前に作った(遊んだ?)Google Map APIを使った会社の地図を、久しぶりに触って見たら動かなくなってる!!!

firefoxのエラーコンソールを見るはa has no properies.とエラーメッセージが出てる。

まあ、私の場合、半分遊びだからいいけど、とりあえず動く物を作って置いておいたら、いつのまにか動かなくなってるというのも困ったもんだよね。お仕事だったらって、お仕事で作った地図なんだけど(^^;
結構、大きな問題になりかねないと思うんだが。

SAASだ、マッシュアップだと言っても、メンテの問題が残りますね。

で、どうしたもんだとAPIドキュメントを読んでみたら、なんか追加されてる。
API Updates

The v parameter within the http://maps.google.com/maps?file=api&v=2 URL refers to the version number of the Google Maps API to use. Most users of the API will want to use the current "Version 2" API by passing the v=2 parameter within that URL. You may instead obtain the latest release (including the latest features) by passing v=2.x instead. However, be aware that the latest release may not be as reliable as the v=2 release. We update the Google Maps API often (sometimes every week), at which point features within the v=2.x release are migrated into the v=2 release unless problems are discovered.

In addition, you may use a "stable" version of the API by passing the v=2.s parameter. This version is updated less often, about every few months. Since the v=2 and v=2.x releases are updated about every two weeks, some developers will prefer to use the stable v=2.s. Please note that the stable version may be several versions behind the current version and therefore may not include some of the latest features.

Each version of the API is labeled as we update it (for example, "Version 2.76"). As we update the API, older code based on previous versions may occasionally not work as advertised. If you absolutely need to peg your application to a particular release of the API, you can do so by explicitly including that version within the v parameter (e.g. v=2.75). However, this is not recommended. It is always best to base your products on the code as it gets updated.

When we do a significant update to the API in the future, we will change up the major version number and post a notice on Google Code and the Maps API developer forum. When that happens we expect to support both versions for at least a month in order to allow you to migrate your code.

The Maps team also transparently updates the API with the most recent bug fixes and performance enhancements. These bug fixes should only improve performance and fix bugs, but we may inadvertently break some API clients. Please use the Maps API developer forum to report such issues.


と、書いてあったので、拾い読みして、
script src="http://maps.google.co.jp/maps?file=api&v=2&key=KEY" type="text/javascript" charset="utf-8"
と書いてあったコードのv=2の部分を安定バージョンを指定するためv=2.sとしたら、元のとおり動作してくれました。
script src="http://maps.google.co.jp/maps?file=api&v=2.s&key=KEY" type="text/javascript" charset="utf-8"


やれやれ(^^;

0 件のコメント: