Service

StreetViewService 類別

google.maps.StreetViewService 類別

StreetViewService 物件會搜尋街景服務資料。

呼叫 const {StreetViewService} = await google.maps.importLibrary("streetView") 即可存取。請參閱 Maps JavaScript API 中的程式庫

StreetViewService
StreetViewService()
參數:
建立 StreetViewService,提供介面,以儲存「街景服務」服務中儲存的資料。
getPanorama
getPanorama(request[, callback])
參數: 
傳回值:  Promise<StreetViewResponse>
為符合所提供街景服務查詢要求的全景擷取 StreetViewPanoramaDataStreetViewPanoramaData 會傳遞至提供的回呼。

StreetViewStatus 常數

google.maps.StreetViewStatus 常數

「街景服務」要求完成後,StreetViewService 傳回的狀態。您可以使用值或透過常數名稱來指定這些項目。例如 'OK'google.maps.StreetViewStatus.OK

呼叫 const {StreetViewStatus} = await google.maps.importLibrary("streetView") 即可存取。請參閱 Maps JavaScript API 中的程式庫

OK 要求成功。
UNKNOWN_ERROR 無法成功處理要求,但確切的失敗原因不明。
ZERO_RESULTS 找不到任何符合搜尋條件的全景。

StreetViewLocationRequest 介面

google.maps.StreetViewLocationRequest 介面

getPanorama 傳送的街景服務要求。StreetViewLocationRequest 可讓您搜尋指定位置的街景服務全景。

location optional
類型:  LatLng|LatLngLiteral optional
指定搜尋街景服務全景的地點。
preference optional
類型:  StreetViewPreference optional
設定在半徑內應找到的全景的偏好設定:最接近指定位置的距離,或半徑範圍內的最佳全景。
radius optional
類型:  number optional
預設: 50
設定用來搜尋全景的半徑 (單位為公尺)。
source optional
類型:  StreetViewSource optional
指定要搜尋的全景相片來源。這可讓您限定只搜尋室外全景。

StreetViewPanoRequest 介面

google.maps.StreetViewPanoRequest 介面

StreetViewPanoRequest 會與 getPanorama 搭配使用,找出具有指定 ID 的全景。

pano optional
類型:  string optional
指定要搜尋的全景 ID。

StreetViewResponse 介面

google.maps.StreetViewResponse 介面

StreetViewService.getPanorama 的 Promise 回應已解決。

data
全景的表示。

StreetViewLocation 介面

google.maps.StreetViewLocation 介面

表示「街景服務」全景中的位置。

pano
類型:  string
全景的唯一識別碼。這在單一工作階段內是穩定的,但是如果橫跨多個工作階段就會不穩定。
description optional
類型:  string optional
描述位置的本地化字串。
latLng optional
類型:  LatLng optional
全景的經緯度。
shortDescription optional
類型:  string optional
地點的簡短說明。

StreetViewPreference 常數

google.maps.StreetViewPreference 常數

將搜尋結果偏向傳回最接近要求位置的「街景服務」全景選項,或認為使用者最有可能看到的全景。您可以使用值或透過常數名稱指定這些值。例如 'best'google.maps.StreetViewPreference.BEST

呼叫 const {StreetViewPreference} = await google.maps.importLibrary("streetView") 即可存取。請參閱 Maps JavaScript API 中的程式庫

BEST 傳回使用者最可能想看到的街景服務全景。演算法會根據使用者的研究資料和參數 (例如可辨識的搜尋點、圖片品質,以及指定位置的距離) 來判定最佳結果。
NEAREST 傳回與指定位置最短距離的街景服務全景。這個限制僅適用於半徑範圍限制。建議半徑不得超過 1 公里。

StreetViewSource 常數

google.maps.StreetViewSource 常數

將「街景服務」搜尋限制為所選來源的識別碼。這些值會以字串的形式指定。例如 'outdoor'

呼叫 const {StreetViewSource} = await google.maps.importLibrary("streetView") 即可存取。請參閱 Maps JavaScript API 中的程式庫

DEFAULT 使用街景服務的預設來源,搜尋範圍不限於特定來源。
OUTDOOR 將街景服務搜尋範圍限制在室外集錦。室內集合不顯示在搜尋結果中。另請注意,搜尋只會傳回能判斷室內或室外的全景。例如,系統不會傳回 PhotoSpheres,因為不知道是室內還是室外。

StreetViewPanoramaData 介面

google.maps.StreetViewPanoramaData 介面

使用 registerPanoProvider 定義的提供者傳回的全景表示法。

tiles
類型:  StreetViewTileData
指定這個位置的自訂方塊。
copyright optional
類型:  string optional
指定這個全景的版權文字。
imageDate optional
類型:  string optional
指定全景圖像的年度和月份。日期字串的格式為 YYYY-MM。
location optional
類型:  StreetViewLocation optional
為這個位置指定位置的中繼資料。

google.maps.StreetViewLink 介面

一組相鄰「街景服務」全景的參考。

description optional
類型:  string optional
描述連結的的本地化字串。
heading optional
類型:  number optional
連結的方向。
pano optional
類型:  string optional
全景的唯一識別碼。這個 ID 在單一工作階段內是穩定的,但是如果橫跨多個工作階段就會不穩定。