Package google.geo.type
วิวพอร์ต
วิวพอร์ตละติจูด-ลองจิจูด ซึ่งแสดงในแนวทแยงมุม 2 จุดตรงข้ามกับจุด 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 } }
ช่อง |
low |
LatLng
ต้องระบุ จุดต่ำของวิวพอร์ต
|
high |
LatLng
ต้องระบุ จุดสูงของวิวพอร์ต
|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-07-02 UTC
[null,null,["อัปเดตล่าสุด 2024-07-02 UTC"],[[["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"]]