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-02-26。
[null,null,["最后更新时间 (UTC):2025-02-26。"],[[["A Viewport is defined by two points, `low` and `high`, representing the southwest and northeast corners of a rectangular area on a map."],["The latitude and longitude values of these points determine the boundaries of the viewport, allowing for a specific region to be displayed."],["Certain conditions like inverted longitude ranges or empty latitude/longitude ranges are handled specifically within the viewport definition."],["Both `low` and `high` points are mandatory for a valid viewport, and an empty or incorrectly defined viewport will result in an error."]]],["A viewport is defined by two diagonal points, `low` and `high`, representing a latitude-longitude area. Both points are required and must define a non-empty region. Latitude ranges from -90 to 90 degrees, and longitude from -180 to 180 degrees. Inverted longitude ranges cross the 180-degree line. Specific longitude values can indicate all longitudes or an empty range. Inverted latitude order or an undefined `low` or `high` result in an error.\n"]]