Groups
Groups
Sign in
Groups
Groups
Google-Maps-API-Japan
Conversations
About
Send feedback
Help
ブラウザからのAPI呼び出しとApache+PHP経由でのAPI呼び出しでXMLの結果が異なる
82 views
Skip to first unread message
石川将行
unread,
Nov 13, 2008, 9:49:22 PM
11/13/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-Maps-API-Japan
PHPからジオコーディングのAPI呼び出してXMLで取得しようとしています。
(なので、JavaScriptは使いません。)
たとえば「福岡」でジオコーディング取得する場合に
http://maps.google.com/maps/geo?output=xml&q=福岡
と送信します。
ブラウザからはAddressに
「日本福岡」
が返ってきますが、Webサーバ、PHPから経由して取得すると
「Fukuoka Japan」
が返ってきて、内容はほぼ同じなのに、国名と都道府県名程度が英語表記になってしまいます。
理想はブラウザからと同じ内容が返ってくる事ですが、なにか指定するパラメータとかあるのでしょうか?
想像だと、国・言語を指定したりできそうですが・・・
Webで検索しましたがそれらしき情報はありませんでした。。。
ちなみにoe=utf-8を指定しても変わらず、PHPではもちろん上述のアドレスに加えてkeyも指定しています。
はまってしまいました。。。
ご存じの方いらっしゃったらご回答よろしくお願いいたします。
Takashi Matsuo
unread,
Nov 13, 2008, 10:05:52 PM
11/13/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-Map...@googlegroups.com
PHPでアクセスする時に、Accept-Language リクエストヘッダを適切に
設定してあげれば日本語で結果が取れそうです。
-- Takashi Matsuo
2008/11/14 石川将行 <
ishi...@nifty.com
>:
ef
unread,
Nov 14, 2008, 12:44:49 AM
11/14/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-Maps-API-Japan
On 11月14日, 午後12:05, "Takashi Matsuo" <
matsuo.taka...@gmail.com
> wrote:
> PHPでアクセスする時に、Accept-Language リクエストヘッダを適切に
> 設定してあげれば日本語で結果が取れそうです。
http://maps.google.com/maps/geo?output=xml&q=福岡&hl=ja
の様に、hl=ja で言語を指定する方法もあります。
えぐち
Mitu-Koike
unread,
Nov 14, 2008, 2:23:24 AM
11/14/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-Maps-API-Japan
これ、
ASP.NET
でアクセスすると
http://maps.google.com/maps/geo
? では取れるのに
http://maps.google.co.jp/maps/geo
? ではエラーになるんですよねぇ・・
不思議なもんだ。
ishi...@nifty.com
unread,
Nov 14, 2008, 3:49:22 AM
11/14/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Google-Map...@googlegroups.com
みなさまありがとうございます!解決しました!
初めて参加し、初めて投稿しましたがレスポンスの早さに驚きです。
結局、hl=ja とすることで解決しました。
StaticMapsAPIを使ったときもたしか同じパラメータがあったのを記憶していましたが、探せずにいました。
ありがとうございます!
石川
Reply all
Reply to author
Forward
0 new messages