公用最終類別
LatLngBounds
可擴充物件
導入 Parcelable
導入 Parcelable
不可變類別,代表經緯度對齊的矩形。
巢狀類別摘要
類別 | LatLngBounds.Builder | 此建構工具可以根據一組 LatLng 點建立最小邊界。 |
繼承常數摘要
欄位摘要
公開最終 LatLng | 東北 | 邊界的東北角。 |
公開最終 LatLng | 西南部 | 邊界的西南角。 |
公用建構函式摘要
公用方法摘要
靜態 LatLngBounds.Builder |
builder()
建立新的建構工具。
|
布林值 | |
靜態 LatLngBounds |
createFromAttributes(情境內容、屬性集屬性)
從
AttributeSet 建立 LatLngBounds。 |
布林值 |
equals(物件 o)
|
LatLng |
getCenter()
傳回此 LatLngBounds 的中心。
|
int |
hashCode()
|
LatLngBounds | |
字串 |
toString()
|
繼承方法摘要
欄位
公用建構函式
公共 LatLngBounds (LatLng southwest, LatLng 東北)
根據西南角和東北角建立新的邊界。
從概念上來說,邊界包含所有點:
- 緯度在 [northeast.latitude, southwest.latitude] 範圍中
- 經度的範圍如果 southwest.longitude ≤ northeast.longitude
- 經度則在 [southwest.longitude, 180) 範圍中 [-180, northeast.longitude] 如 southwest.longitude > northeast.longitude。
參數
西南 | 西南角 |
---|---|
東北 | 東北角 |
擲回
IllegalArgumentException | ,如果東北角的緯度低於西南角的緯度。 |
---|
公用方法
公開靜態 LatLngBounds createFromAttributes (情境情境、屬性集 attrs)
從 AttributeSet
建立 LatLngBounds。
參數
context | |
---|---|
attrs |
公開布林值 等於 (物件 o)
參數
o |
---|
public LatLng getCenter ()
傳回此 LatLngBounds 的中心。中心點僅為座標的平均值 (請考量跨越跑者的座標)。這大約是地理位置中心 (如果地球是完美的球體,這可能就是確切的)。但由於麥卡托投影而不一定會在地圖上繪製矩形的中心點。
傳回
- 是 LatLngBounds 中心的
LatLng
。
public int hashCode ()
公開 LatLngBounds 包含 (LatLng Point)
傳回新的 LatLngBounds
,可擴充此 LatLngBounds 以納入指定的 LatLng
。系統會傳回包含此點與額外點的最小 LatLngBounds。
尤其會考慮往東和西邊的方向延伸 (其中一個可能會跨越向子線),並選擇兩者中較小的範圍。假使這兩個路線具有相同大小的 LatLngBounds,此屬性就會朝東方向延伸。
參數
分 | 要加進新邊界的 LatLng |
---|
傳回
- 包含此和額外點的新
LatLngBounds
。