Maps Service
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
地圖
這項服務可讓指令碼產生靜態地圖、尋找路線、將地址轉換成地理編碼座標,以及取樣高度範例。
類別
屬性
屬性 | 類型 | 說明 |
TOLLS | Enum | 避開收費站。 |
HIGHWAYS | Enum | 避開高速公路。 |
屬性
屬性 | 類型 | 說明 |
BLACK | Enum | |
BROWN | Enum | |
GREEN | Enum | |
PURPLE | Enum | |
YELLOW | Enum | |
BLUE | Enum | |
GRAY | Enum | |
ORANGE | Enum | |
RED | Enum | |
WHITE | Enum | |
屬性
屬性 | 類型 | 說明 |
PNG | Enum | 8 位元 PNG 格式。 |
PNG8 | Enum | 8 位元 PNG 格式。 |
PNG32 | Enum | 32 位元 PNG 格式。 |
GIF | Enum | GIF 格式。 |
JPG | Enum | JPEG 格式 |
JPG_BASELINE | Enum | 非漸進式 JPEG 格式。 |
屬性
屬性 | 類型 | 說明 |
TINY | Enum | 小型市場 (可用的最小市場)。 |
MID | Enum | 中等大小標記 (可用的最大尺寸)。 |
SMALL | Enum | 小型標記。 |
屬性
屬性 | 類型 | 說明 |
DRIVING | Enum | 規劃行車路線。 |
WALKING | Enum | 行人專用道和人行道 (如果有的話)。 |
BICYCLING | Enum | 單車道,以及單車專用道路 (如果有的話)。 |
TRANSIT | Enum | 大眾運輸路線 (如果有的話) 的路線。 |
方法
方法 | 傳回類型 | 簡短說明 |
addAddress(address) | StaticMap | 將新位址新增至目前的路徑定義。 |
addMarker(latitude, longitude) | StaticMap | 使用點 (lat/lng) 在地圖上新增標記。 |
addMarker(address) | StaticMap | 使用地址在地圖上加入標記。 |
addPath(points) | StaticMap | 使用點陣列新增地圖路徑。 |
addPath(polyline) | StaticMap | 使用編碼的折線為地圖新增路徑。 |
addPoint(latitude, longitude) | StaticMap | 在目前的路徑定義中新增點 (lat/lng)。 |
addVisible(latitude, longitude) | StaticMap | 新增必須在地圖中顯示的點 (lat/lng) 位置。 |
addVisible(address) | StaticMap | 新增必須在地圖上顯示的地址位置。 |
beginPath() | StaticMap | 啟動新的路徑定義。 |
clearMarkers() | StaticMap | 清除目前的標記組合。 |
clearPaths() | StaticMap | 清除目前的路徑組合。 |
clearVisibles() | StaticMap | 清除目前的可見位置組合。 |
endPath() | StaticMap | 完成開頭為 startPath() 的路徑定義。 |
getAs(contentType) | Blob | 傳回此物件中的資料,以轉換為指定內容類型的 blob。 |
getBlob() | Blob | 取得 Blob 的圖片資料。 |
getMapImage() | Byte[] | 取得原始圖像資料做為位元組陣列。 |
getMapUrl() | String | 取得地圖圖片的網址。 |
setCenter(latitude, longitude) | StaticMap | 使用點 (lat/lng) 設定地圖的中心。 |
setCenter(address) | StaticMap | 使用地址設定地圖的中心。 |
setCustomMarkerStyle(imageUrl, useShadow) | StaticMap | 設定建立新標記時使用的自訂標記圖片。 |
setFormat(format) | StaticMap | 設定地圖圖片的格式。 |
setLanguage(language) | StaticMap | 設定地圖上的文字顯示語言 (顯示圖片)。 |
setMapType(mapType) | StaticMap | 設定要顯示的地圖類型。 |
setMarkerStyle(size, color, label) | StaticMap | 設定建立新標記時使用的標記樣式。 |
setMobile(useMobileTiles) | StaticMap | 設定是否針對行動裝置使用專用圖塊集。 |
setPathStyle(weight, color, fillColor) | StaticMap | 設定建立新路徑時使用的路徑樣式。 |
setSize(width, height) | StaticMap | 設定地圖圖片的寬度和高度 (以像素為單位)。 |
setZoom(zoom) | StaticMap | 設定地圖使用的縮放比例係數 (即放大等級)。 |
屬性
屬性 | 類型 | 說明 |
ROADMAP | Enum | 標準路線圖,如 Google 地圖網站所示。 |
SATELLITE | Enum | 衛星地圖。 |
TERRAIN | Enum | 顯示物理和植被的物理救濟地圖。 |
HYBRID | Enum | 衛星和藍圖地圖的混合地圖,在衛星地圖上顯示主要街道和地點名稱的透明層。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
Last updated 2022-08-17 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]