Package google.geo.type
可視區域
經緯度可視區域,以兩個對角相反的 low
和 high
點表示。可視區域視為封閉區域,也就是包含邊界。緯度範圍必須介於 -90 到 90 度之間 (含首尾),經度範圍則需介於 -180 到 180 度之間 (含首尾)。各種情況包括:
如果 low
= high
,可視區域就會包含該單一點。
如果 low.longitude
> high.longitude
,經度範圍會反轉 (可視區域會跨越 180 度經線)。
如果 low.longitude
= -180 度,且 high.longitude
= 180 度,則可視區域會包含所有經度。
如果 low.longitude
= 180 度且 high.longitude
= -180 度,則經度範圍為空白。
如果 low.latitude
> high.latitude
,則緯度範圍為空白。
low
和 high
都必須填入資料,且代表的方塊不得為空白 (如上述定義所述)。空白的檢視區會導致錯誤。
舉例來說,這個視區會完全包含紐約市:
{ "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } }
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-03-20 (世界標準時間)。
[null,null,["上次更新時間:2025-03-20 (世界標準時間)。"],[[["A Viewport is defined by two points, `low` and `high`, representing the southwest and northeast corners of a rectangular area on a map."],["It's crucial that `low` latitude is less than `high` latitude and, generally, `low` longitude is less than `high` longitude for the viewport to be valid."],["The viewport encompasses all points within its boundaries, including the boundary lines themselves."],["Special cases exist where longitude ranges can be inverted or represent the entire globe, but latitude ranges must be logically ordered."],["Both `low` and `high` points are mandatory, and the resulting viewport cannot be empty, otherwise, an error will occur."]]],["A Viewport, defined by `low` and `high` latitude-longitude points, represents a closed region. Both `low` and `high` points are mandatory. Longitude ranges can be inverted, crossing the 180-degree line, or encompass all longitudes. Latitude ranges, if `low` is greater than `high` are empty. A viewport can be a single point when `low` equals `high`. An empty viewport, when both are equal, results in an error.\n"]]