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 } }
שדות |
low |
LatLng
חובה. הנקודה הנמוכה ביותר באזור התצוגה.
|
high |
LatLng
חובה. הנקודה הגבוהה ביותר באזור התצוגה.
|
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-03-20 (שעון UTC).
[null,null,["עדכון אחרון: 2025-03-20 (שעון 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"]]