LatLngBounds

公開最終類別 LatLngBounds 擴充物件
實作 Parcelable

代表緯度/經度對齊矩形的不可變類別。

巢狀類別摘要

類別 LatLngBounds.Builder 這個建構工具可根據一組經緯度座標建立最小值。

繼承常數摘要

欄位摘要

公開最終 LatLng 東北部 邊界的東北角。
公開最終 LatLng 西南部 邊界的西南角。

公用建構函式摘要

LatLngBounds (西北邊、LatLng 東北)
根據西南角和東北角建立新的邊界。
LatLngBounds(LatLngBounds 範圍)
複製建構函式。

公用方法摘要

靜態 LatLngBounds.Builder
builder()
建立新的建構工具。
布林
contains(LatLng Point)
傳回這是否包含指定的 LatLng
靜態 LatLngBounds
createFromAttributes(情境、AttributeSet Attrs)
AttributeSet 建立 LatLngBounds。
布林
等於 (物件 o)
LatLng
getCenter()
傳回此 LatLngBounds 的中心。
整數
LatLngBounds
包括 (LatLng 點)
傳回新的 LatLngBounds,可擴充這個 LatLngBounds 以納入指定的 LatLng
字串

繼承方法摘要

欄位

最終最終 LatLng 東北部

邊界的東北角。

最終 LatLng 西南

邊界的西南角。

公用建構函式

公開 LatLngBounds (LatLng 西南部、LatLng 東北部)

根據西南角和東北角建立新的邊界。

範圍的概念包括:

  • 緯度位於 [northeast.緯度, southwest.緯度] 範圍內;
  • 經度在 [southwest.經度, northeast.northeast] 的範圍內,如果 southwest.northeast ≤ northeast.northeast 和
  • 經度位於 [southwest.northeast, 180) ∪ [-180, northeast.northeast]。

參數
西南 西南角
東北 東北角
擲回
IllegalArgumentException 東北角的緯度低於西南角的緯度。

公開 LatLngBounds (LatLngBounds 範圍)

複製建構函式。

參數
邊界 要複製的物件。

公用方法

公開靜態 LatLngBounds.Builder 建構工具 ()

建立新的建構工具。

公開布林值 包含 (LatLng 點)

傳回這是否包含指定的 LatLng

參數
要測試的 LatLng
傳回
  • true (如果包含指定點);true;如果不是,則為 false

公開靜態 LatLngBoundscreateFromAttributes(結構定義、屬性集屬性)

AttributeSet 建立 LatLngBounds。

參數
context
attrs

公開布林值 等於 (物件 o)

參數
o

公開 LatLng getCenter ()

傳回此 LatLngBounds 的中心。中心只代表座標的平均值 (如果超過跨越路線,請納入考量)。地理區域大約是地理中心 (如果地球是完美的球體,則十分精確)。由於麥卡托投影,地圖不一定能在地圖上繪製矩形。

傳回
  • 是 LatLngBounds 中心的 LatLng

public int hashCode ()

公開 LatLngBounds 包含(LatLng 點)

傳回新的 LatLngBounds,可擴充這個 LatLngBounds 以納入指定的 LatLng。這會傳回包含此點和額外點的最小 LatLngBounds。

請特別注意,請考慮將東向和西向向的邊界延伸 (其中一個方向可能會跨越黃體針),選擇兩者中較小者。如果這兩個方向都會產生相同大小的 LatLngBounds,就會往東方向延伸。

參數
要納入新邊界的 LatLng
傳回

public String toString ()