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 its southwest and northeast corners, respectively, forming a rectangular area on a map."],["Latitude values for these points must be between -90 and 90 degrees, while longitude values range from -180 to 180 degrees."],["Special cases arise when 'low' and 'high' have certain values, resulting in single points, inverted longitude ranges, or empty areas."],["Both 'low' and 'high' points are required, and they must define a non-empty viewport to avoid errors."]]],["A viewport is defined by two points, `low` and `high`, representing a latitude-longitude region. These points must be populated and form a closed, non-empty area. Latitude ranges from -90 to 90, and longitude from -180 to 180. The longitude range inverts if `low.longitude` exceeds `high.longitude`. Specific conditions define a single point, full longitude inclusion, or empty ranges. `low` and `high` fields are required, represented by latitude and longitude.\n"]]