GMSPanoramaView 類別參考資料

GMSPanoramaView 類別參考

總覽

全景是用來顯示街景服務圖像。

應該透過 [[GMSPanoramaView alloc] initWithFrame:] 建構,並設定初始化後。

所有屬性和方法都應在主執行緒上存取,類似於所有 UIKit 物件。也會在主執行緒上呼叫GMSPanoramaViewDelegate方法。

未顯示全景時 (例如,載入全景或全景之後設為 nil),則會顯示此檢視的 backgroundColor。不支援 backgroundColor 的 Alpha 顏色。

公開成員函式

(void) - setAllGesturesEnabled:
 設定是否應啟用所有手勢的偏好設定 (預設) 或停用狀態。
(void) - animateToCamera:animationDuration:
 建立這個相機的動畫GMSPanoramaViewcamera,超過 duration (指定秒數)。
(void) - updateCamera:animationDuration:
 根據超過 duration (以秒為單位指定時間) 的 cameraUpdate 修改相機。
(void) - moveNearCoordinate:
 要求在 coordinate 附近拍攝全景。
(void) - moveNearCoordinate:radius:
 與 MoveNearCoordinate 類似,但允許指定 coordinate 附近的搜尋半徑 (公尺)。
(void) - moveNearCoordinate:source:
 與 MoveNearCoordinate 類似,但允許在 coordinate 附近指定來源。
(void) - moveNearCoordinate:radius:source:
 與 MoveNearCoordinate 類似,但允許在 coordinate 和來源周圍指定搜尋半徑 (公尺)。
(void) - moveToPanoramaID:
 使用 panoramaID 要求全景。
(CGPoint)- pointForOrientation:
 針對目前的檢視畫面,傳回 orientation 點穿過的畫面點。
(GMSOrientation)- orientationForPoint:
 針對這個檢視畫面,傳回指向該畫面位置的目前相機方向。

靜態公開成員函式

(執行個體類型)+ panoramaWithFrame:nearCoordinate:
 便利建構函式 GMSPanoramaView:會搜尋並顯示 coordinate 附近的 GMSPanorama
(執行個體類型)+ panoramaWithFrame:nearCoordinate:radius:
 與 profileWithFrame:nearCoordinate 類似,但允許指定 coordinate 周圍的搜尋半徑 (公尺)。
(執行個體類型)+ panoramaWithFrame:nearCoordinate:source:
 便利建構函式 GMSPanoramaView:會搜尋並顯示 coordinate 附近的 GMSPanorama
(執行個體類型)+ panoramaWithFrame:nearCoordinate:radius:source:
 便利建構函式 GMSPanoramaView:會搜尋並顯示 coordinate 附近的 GMSPanorama

資源

GMSPanorama全景
 要顯示的全景;進行設定,會轉換為新的全景。
IBOutlet id
< GMSPanoramaViewDelegate >
委派
 GMSPanoramaView代表。
BOOLorientationGestures
 控管要啟用或停用方向手勢 (預設)。
BOOLzoomGestures
 控管是否啟用縮放手勢 (預設) 或停用。
BOOLnavigationGestures
 控管要啟用或停用導覽手勢 (預設)。
BOOLnavigationLinksHidden
 控制要隱藏還是顯示可輕觸的導覽連結 (預設)。
BOOLstreetNamesHidden
 控制是否要隱藏或顯示街道名稱疊加層 (預設)。
GMSPanoramaCamera相機
 控制全景相機。
GMSPanoramaLayer圖層
 圖層所用自訂 CALayer 類型的存取子。

成員函式說明文件

- (void) setAllGesturesEnabled: (BOOL)  已啟用

設定是否應啟用所有手勢的偏好設定 (預設) 或停用狀態。

這不會限制全景的相機或控制的移動。

- (void) animateToCamera: (GMSPanoramaCamera *) 相機
AnimationDuration: (NSTimeInterval) duration

建立這個相機的動畫GMSPanoramaViewcamera,超過 duration (指定秒數)。

- (void) updateCamera: (GMSPanoramaCameraUpdate *) cameraUpdate
AnimationDuration: (NSTimeInterval) duration

根據超過 duration (以秒為單位指定時間) 的 cameraUpdate 修改相機。

- (void) moveNearCoordinate: (CLLocationCoordinate2D)  座標

要求在 coordinate 附近拍攝全景。

成功完成 generateView:didMoveToPanorama: 和 PanoramaView:didMoveToPanorama:nearCoordinate: 時,會傳送至 GMSPanoramaViewDelegate

發生錯誤時,PanoramaView:error:onMoveNearCoordinate: 將傳送。

重複呼叫 MoveNearCoordinate:將導致先前的待處理 (未完成) 轉換取消,只會取消最新的 MoveNearCoordinate: 和 MoveToPanoramaId: 第一個工作,並產生事件。

- (void) moveNearCoordinate: (CLLocationCoordinate2D)  座標
半徑: (NSUInteger) 半徑

與 MoveNearCoordinate 類似,但允許指定 coordinate 附近的搜尋半徑 (公尺)。

- (void) moveNearCoordinate: (CLLocationCoordinate2D)  座標
資料來源: (GMSPanoramaSource) 來源

與 MoveNearCoordinate 類似,但允許在 coordinate 附近指定來源。

這個 API 仍在實驗階段,因此不一定能依照來源進行篩選。

- (void) moveNearCoordinate: (CLLocationCoordinate2D)  座標
半徑: (NSUInteger) 半徑
資料來源: (GMSPanoramaSource) 來源

與 MoveNearCoordinate 類似,但允許在 coordinate 和來源周圍指定搜尋半徑 (公尺)。

這個 API 仍在實驗階段,因此不一定能依照來源進行篩選。

- (void) moveToPanoramaID: (NSString *) panoramaID

使用 panoramaID 要求全景。

成功完成 PanoramaView:didMoveToPanorama: 後,會傳送至GMSPanoramaViewDelegate

如果發生錯誤時,系統會傳送 PanoramaView:error:onMoveToPanoramaID:。

重複呼叫 MoveToPanoramaID:會導致先前的待處理 (未完成) 轉換取消,只會取消最新的 MoveNearCoordinate:和 moveToPanoramaId:將繼續進行並產生事件。

僅支援從 Google Maps SDK for iOS 取得的 PanoramaID。

- (CGPoint) pointForOrientation: (GMSOrientation) 方向

針對目前的檢視畫面,傳回 orientation 點穿過的畫面點。

這個值可在檢視畫面外,用於朝向前方,也就是距離很遠的朝向方向。

結果會包含與視角遠離的相機方向 NaN,其中隱含的螢幕方向在方向方向之間會有負的距離。

針對這個檢視畫面,傳回指向該畫面位置的目前相機方向。

在視圖的中心,傳回的GMSOrientation將大約等於目前的GMSPanoramaCamera

+ (instancetype)PanoramaWithFrame: (CGRect) 影格
近距離: (CLLocationCoordinate2D)  Coordinate

便利建構函式 GMSPanoramaView:會搜尋並顯示 coordinate 附近的 GMSPanorama

這個動作會執行類似 MoveNearCoordinate: 的行為,並呼叫相同的委派方法。

+ (instancetype)PanoramaWithFrame: (CGRect) 影格
近距離: (CLLocationCoordinate2D)  座標
半徑: (NSUInteger) 半徑

與 profileWithFrame:nearCoordinate 類似,但允許指定 coordinate 周圍的搜尋半徑 (公尺)。

+ (instancetype)PanoramaWithFrame: (CGRect) 影格
近距離: (CLLocationCoordinate2D)  座標
資料來源: (GMSPanoramaSource) 來源

便利建構函式 GMSPanoramaView:會搜尋並顯示 coordinate 附近的 GMSPanorama

這個動作會執行與 MoveNearCoordinate:source 類似的動作,並呼叫相同的委派方法。

這個 API 仍在實驗階段,因此不一定能依照來源進行篩選。

+ (instancetype)PanoramaWithFrame: (CGRect) 影格
近距離: (CLLocationCoordinate2D)  座標
半徑: (NSUInteger) 半徑
資料來源: (GMSPanoramaSource) 來源

便利建構函式 GMSPanoramaView:會搜尋並顯示 coordinate 附近的 GMSPanorama

這會執行類似於 MoveNearCoordinate:radius:source 的動作,並呼叫相同的委派方法。

這個 API 仍在實驗階段,因此不一定能依照來源進行篩選。


屬性說明文件

- (GMSPanorama*) 全景 [read, write, assign]

要顯示的全景;進行設定,會轉換為新的全景。

這是動畫,除了初始全景外。

可設為 nil 以清除檢視畫面。

- (IBOutlet id<GMSPanoramaViewDelegate>) 委派 [read, write, assign]

GMSPanoramaView代表。

- (BOOL) orientationGestures [read, write, assign]

控管要啟用或停用方向手勢 (預設)。

啟用後,使用者即可使用手勢變更攝影機的方向。

但攝影機的程式輔助移動方式也不會受到限制。

- (BOOL) zoomGestures [read, write, assign]

控管是否啟用縮放手勢 (預設) 或停用。

如果啟用,使用者可用雙指撥動縮放鏡頭。

但攝影機的程式輔助移動方式也不會受到限制。

- (BOOL) navigationGestures [read, write, assign]

控管要啟用或停用導覽手勢 (預設)。

啟用後,使用者只要輕觸一下導覽連結,或輕觸兩下檢視畫面,即可變更全景相片。

這不會限制全景的程式輔助控制項。

- (BOOL) navigationLinksHidden [read, write, assign]

控制要隱藏還是顯示可輕觸的導覽連結 (預設)。

無法輕觸隱藏的導覽連結。

- (BOOL) streetNamesHidden [read, write, assign]

控制是否要隱藏或顯示街道名稱疊加層 (預設)。

- (GMSPanoramaCamera*) 相機 [read, write, assign]

控制全景相機。

在此處設定新攝影機會跳到新的相機值,沒有動畫。

- (GMSPanoramaLayer*) 圖層 [read, retain]

圖層所用自訂 CALayer 類型的存取子。