Package google.geo.type
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
วิวพอร์ต
วิวพอร์ตละติจูด-ลองจิจูดที่แสดงเป็นจุด low
และ high
2 จุดที่ตรงข้ามกันตามแนวทแยงมุม วิวพอร์ตถือเป็นภูมิภาคแบบปิด กล่าวคือ วิวพอร์ตจะมีขอบเขตของตัวเอง ขอบเขตละติจูดต้องอยู่ในช่วง -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 และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-02-26 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-02-26 UTC"],[[["A Viewport is defined by two points, 'low' and 'high', representing its southwest and northeast corners, respectively, forming a rectangular area on a map."],["Latitude values for these points must be between -90 and 90 degrees, while longitude values range from -180 to 180 degrees."],["Special cases arise when 'low' and 'high' have certain values, resulting in single points, inverted longitude ranges, or empty areas."],["Both 'low' and 'high' points are required, and they must define a non-empty viewport to avoid errors."]]],["A viewport is defined by two points, `low` and `high`, representing a latitude-longitude region. These points must be populated and form a closed, non-empty area. Latitude ranges from -90 to 90, and longitude from -180 to 180. The longitude range inverts if `low.longitude` exceeds `high.longitude`. Specific conditions define a single point, full longitude inclusion, or empty ranges. `low` and `high` fields are required, represented by latitude and longitude.\n"]]