Package google.geo.type
Viewport
Un viewport de latitud y longitud, representado por dos puntos low
y high
opuestos en diagonal. Una viewport se considera una región cerrada, es decir, incluye su límite. Los límites de latitud deben variar entre -90 y 90 grados inclusive, y los límites de longitud deben estar entre -180 y 180 grados inclusive. Se incluyen varios casos:
Si low
= high
, el viewport consta de ese único punto.
Si low.longitude
> high.longitude
, el intervalo 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.
Tanto low
como high
deben completarse, y el cuadro representado no puede estar vacío (como se especifica en las definiciones anteriores). Un viewport vacío generará un error.
Por ejemplo, este viewport abarca por completo la ciudad de Nueva York:
{ "low": { "latitude": 40.477398, "longitude": -74.259087 }, "high": { "latitude": 40.91618, "longitude": -73.70018 } }
Campos |
low |
LatLng
Obligatorio. Es el punto inferior del viewport.
|
high |
LatLng
Obligatorio. Es el punto más alto del viewport.
|
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: 2024-07-02 (UTC)
[null,null,["Última actualización: 2024-07-02 (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"]]