Viewport
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Strefa widoczna szerokości i długości geograficznej, reprezentowana przez 2 punkty low
i high
, leżące na przekątnej w przeciwnych kierunkach. Widok jest uważany za zamknięty obszar, czyli obejmuje swoją granicę. Granice szerokości geograficznej muszą mieścić się w zakresie od -90 do 90 stopni, a granice długości geograficznej – od -180 do 180 stopni. Przykładowe etui:
Jeśli low
= high
, widoczny obszar składa się z jednego punktu.
Jeśli low.longitude
> high.longitude
, zakres długości geograficznej jest odwrócony (widoczny obszar przecina linię długości geograficznej 180°).
Jeśli low.longitude
= –180 stopni, a high.longitude
= 180 stopni, widoczny obszar obejmuje wszystkie długości geograficzne.
Jeśli low.longitude
= 180 stopni, a high.longitude
= -180 stopni, zakres długości geograficznej jest pusty.
Jeśli low.latitude
> high.latitude
, zakres szerokości geograficznej jest pusty.
Wartości low
i high
muszą być wypełnione, a pole reprezentowane przez te wartości nie może być puste (zgodnie z definicjami podanymi powyżej). Pusty widok spowoduje błąd.
Na przykład ten widok zawiera w pełni Nowy Jork:
{ "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } }
Zapis JSON |
{
"low": {
object (LatLng )
},
"high": {
object (LatLng )
}
} |
Pola |
low |
object (LatLng )
Wymagane. Najniższy punkt widocznego obszaru.
|
high |
object (LatLng )
Wymagane. Najwyższy punkt w obszarze widoku.
|
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-31 UTC.
[null,null,["Ostatnia aktualizacja: 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. |"]]