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):2024-07-02。
[null,null,["最后更新时间 (UTC):2024-07-02。"],[[["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"]]