2016年5月2日 星期一

[ MAP ] google map api 顯示語言設定

<script src="https://maps.googleapis.com/maps/api/js?sensor=false&language=語系"></script>

地區當地語系化
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&language=ja" type="text/javascript">
key=YOUR_API_KEY 這段可以不用

Unicode 地區子標記識別碼
http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers

Ex:
http://test.grnet.com.tw/bliksen/tw/contact.php
http://test.grnet.com.tw/bliksen/en/contact.php
http://www.fushin-hotel.com.tw/taipei/en/location.php


zh-CN 簡中
zh-TW 繁中
EN 英文
en-US 美國
ja-JP 日本

https://developers.google.com/maps/documentation/javascript/basics?hl=zh-tw
https://developers.google.com/maps/documentation/embed/guide?hl=zh-tw
https://developers.google.com/maps/documentation/embed/start

iframe引入的方法
<iframe src="https://maps.google.com.ua/maps?q=231新北市新店區民權路52號&hl=en&output=embed" allowfullscreen></iframe>
Ex:
http://test.grnet.com.tw/pixon/en/contact_us.php
hl=語系,用 output=embed 方式開
參考:
https://stackoverflow.com/questions/22503945/set-language-for-google-maps-iframe

簡易Google Map 置入方式,非API模式
http://jbear.net/blogs/black/archive/2009/05/18/google-map-api.aspx
<iframe width="400" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src=http://maps.google.com.tw/maps?f=q&hl=zh-TW&geocode=&q=輸入查詢的地址&z=比例大小&output=embed&t=地圖模式></iframe>
其中包含了幾個重要的參數可做修改
width=寬度
height=高度
q=輸入查詢的完整地址或經緯度,如果需要標明可在結尾加上(),於()中輸入表示名稱
z=地圖比例大小,可輸入 1-18
t=模式,沒輸入值時為預設地圖;h為衛星圖加路線;p為地形圖
output=embed 指定Google Map為崁入模式