Viewport
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אזור תצוגה לפי קו הרוחב ואורך הגלובוס, שמיוצג בשתי נקודות 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 } }
ייצוג ב-JSON |
{
"low": {
object (LatLng )
},
"high": {
object (LatLng )
}
} |
שדות |
low |
object (LatLng )
חובה. הנקודה הנמוכה ביותר באזור התצוגה.
|
high |
object (LatLng )
חובה. הנקודה הגבוהה ביותר באזור התצוגה.
|
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-31 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-31 (שעון UTC)."],[],[],null,["# Viewport\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\nA latitude-longitude viewport, represented as two diagonally opposite `low` and `high` points. A viewport is considered a closed region, i.e. it includes its boundary. The latitude bounds must range between -90 to 90 degrees inclusive, and the longitude bounds must range between -180 to 180 degrees inclusive. Various cases include:\n\n- If `low` = `high`, the viewport consists of that single point.\n\n- If `low.longitude` \\\u003e `high.longitude`, the longitude range is inverted (the viewport crosses the 180 degree longitude line).\n\n- If `low.longitude` = -180 degrees and `high.longitude` = 180 degrees, the viewport includes all longitudes.\n\n- If `low.longitude` = 180 degrees and `high.longitude` = -180 degrees, the longitude range is empty.\n\n- If `low.latitude` \\\u003e `high.latitude`, the latitude range is empty.\n\nBoth `low` and `high` must be populated, and the represented box cannot be empty (as specified by the definitions above). An empty viewport will result in an error.\n\nFor example, this viewport fully encloses New York City:\n\n{ \"low\": { \"latitude\": 40.477398, \"longitude\": -74.259087 }, \"high\": { \"latitude\": 40.91618, \"longitude\": -73.70018 } }\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"low\": { object (/maps/documentation/geocoding/reference/rest/Shared.Types/LatLng) }, \"high\": { object (/maps/documentation/geocoding/reference/rest/Shared.Types/LatLng) } } ``` |\n\n| Fields ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------------|\n| `low` | `object (`[LatLng](/maps/documentation/geocoding/reference/rest/Shared.Types/LatLng)`)` Required. The low point of the viewport. |\n| `high` | `object (`[LatLng](/maps/documentation/geocoding/reference/rest/Shared.Types/LatLng)`)` Required. The high point of the viewport. |"]]