2009年5月18日 星期一

Google Maps 常用參數說明及相關製作文件介紹

在地圖上您可套用以下任何內置控制件:
map.addControl(new GSmallMapControl()); //加入地圖縮放工具,無拉桿(擇一使用)
map.addControl(new GLargeMapControl()); //加入地圖縮放工具,有拉桿(擇一使用)
map.addControl(new GScaleControl()); //加上比例尺
map.addControl(new GMapTypeControl()); //加入地圖切換類型
map.addControl(new GOverviewMapControl()); //位於又下角可折疊縮略圖
map.setCenter(new GLatLng(25.001689, 121.460809), 8); //設定台灣經度,緯度
map.addControl(new google.maps.LocalSearch()); //加入搜尋功能
map.addMapType(G_NORMAL_MAP); //加入一般道路圖(預設)
map.addMapType(G_SATELLITE_MAP); //加入衛星空照圖
map.addMapType(G_PHYSICAL_MAP); //加入地形圖
map.addMapType(G_HYBRID_MAP); //混合地形圖

Google Maps API 內建四種控制項:
1. GLargeMapControl : 適合給大型地圖的控制項。
2. GSmallMapControl : 適合給小型地圖的控制項。
3. GSmallZoomControl : 只有 Zoom Level 的調整,沒有地圖移動控制。
4. GMapTypeControl : 顯示地圖型態切換的控制項。

設置按鈕 CSS 元素。
TextualZoomControl.prototype.setButtonStyle_ = function(button) {
button.style.textDecoration = "underline";
button.style.color = "#0000cc";
button.style.backgroundColor = "white";
button.style.font = "small Arial";
button.style.border = "1px solid black";
button.style.padding = "2px";
button.style.marginBottom = "3px";
button.style.textAlign = "center";
button.style.width = "6em";
button.style.cursor = "pointer";
}

http://www.webpage.idv.tw/maillist/maillist3/skill/09/09.htm

沒有留言:

張貼留言