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 } }
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-20。
[null,null,["最后更新时间 (UTC):2025-03-20。"],[[["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"]]