Viewport
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Un viewport de latitud-longitud, representado como dos puntos low
y high
diagonalmente opuestos. Un viewport se considera una región cerrada, es decir, incluye su límite. Los límites de latitud deben estar entre -90 y 90 grados inclusive, y los límites de longitud deben estar entre -180 y 180 grados inclusive. Entre los diversos casos, se incluyen los siguientes:
Si low
= high
, el viewport consta de ese único punto.
Si low.longitude
> high.longitude
, el rango de longitud se invierte (el viewport cruza la línea de longitud de 180 grados).
Si low.longitude
= -180 grados y high.longitude
= 180 grados, el viewport incluye todas las longitudes.
Si low.longitude
= 180 grados y high.longitude
= -180 grados, el rango de longitud está vacío.
Si low.latitude
> high.latitude
, el rango de latitud está vacío.
Se deben propagar low
y high
, y el cuadro representado no puede estar vacío (como se especifica en las definiciones anteriores). Si el viewport está vacío, se generará un error.
Por ejemplo, este viewport encierra por completo la ciudad de Nueva York:
{ "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } }
Representación JSON |
{
"low": {
object (LatLng )
},
"high": {
object (LatLng )
}
} |
Campos |
low |
object (LatLng )
Obligatorio. Es el punto inferior de la viewport.
|
high |
object (LatLng )
Obligatorio. El punto alto de la ventana de visualización.
|
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-08-31 (UTC)
[null,null,["Última actualización: 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. |"]]