public class LatLngBounds
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
LatLngBounds.Builder
地理区域构造器
|
Modifier and Type | Field and Description |
---|---|
static <any> |
CREATOR |
LatLng |
northeast |
LatLng |
southwest |
Constructor and Description |
---|
LatLngBounds(LatLng northeast,
LatLng southwest) |
Modifier and Type | Method and Description |
---|---|
static LatLngBounds.Builder |
builder()
创建一个构造器
|
boolean |
contains(LatLng latLng)
判断是否包括指定地理坐标点
|
boolean |
contains(LatLngBounds other)
判断是否包括指定地理区域
|
int |
describeContents() |
boolean |
equals(java.lang.Object o) |
static LatLngBounds |
from(double latNorth,
double lonEast,
double latSouth,
double lonWest)
构造一个坐标边界
|
static LatLngBounds |
from(int z,
int x,
int y)
创建一个来自瓦片数据的地理边界
|
LatLng |
getCenter()
计算中心点
|
double |
getLatitudeSpan()
获取纬度跨度
|
double |
getLatNorth()
获取北纬值
|
double |
getLatSouth()
获取南纬值
|
double |
getLonEast()
获取东经值
|
double |
getLongitudeSpan()
获取经度跨度
|
double |
getLonWest()
获取西经值
|
LatLng |
getNorthEast()
获取东北坐标点
|
LatLng |
getNorthWest()
获取西北坐标点
|
LatLng |
getSouthEast()
获取东南坐标点
|
LatLng |
getSouthWest()
获取西南坐标点
|
LatLngSpan |
getSpan()
获取区域跨度
|
int |
hashCode() |
LatLngBounds |
include(LatLng latLng)
创建一个包含指定地理坐标点的地理边界
|
LatLngBounds |
including(LatLng latlng)
让该地理范围包含一个地理位置坐标
|
LatLngBounds |
intersect(double northLat,
double eastLon,
double southLat,
double westLon)
返回指定地理区域与自身的交集
|
LatLngBounds |
intersect(LatLngBounds box)
返回指定地理区域与自身的交集
|
boolean |
isEmptySpan()
判断是否为空的原点
|
protected static LatLngBounds |
readFromParcel(Parcel in) |
LatLng[] |
toLatLngs()
返回边界坐标数组
|
java.lang.String |
toString() |
LatLngBounds |
union(double northLat,
double eastLon,
double southLat,
double westLon)
合并一个新的地理区域
|
LatLngBounds |
union(LatLngBounds bounds)
合并一个新的地理区域
|
static LatLngBounds |
world()
返回世界边界
|
void |
writeToParcel(Parcel out,
int flags) |
public final LatLng northeast
public final LatLng southwest
public static final <any> CREATOR
public static LatLngBounds world()
public static LatLngBounds.Builder builder()
public LatLngBounds including(LatLng latlng)
latlng
- 目标经纬度坐标public LatLng getCenter()
public double getLatNorth()
public double getLatSouth()
public double getLonEast()
public double getLonWest()
public LatLng getSouthWest()
public LatLng getNorthEast()
public LatLng getSouthEast()
public LatLng getNorthWest()
public LatLngSpan getSpan()
public double getLatitudeSpan()
public double getLongitudeSpan()
public boolean isEmptySpan()
public java.lang.String toString()
toString
in class java.lang.Object
public LatLng[] toLatLngs()
public static LatLngBounds from(double latNorth, double lonEast, double latSouth, double lonWest)
latNorth 和 latSouth 的值应该在[-90, 90]范围内
参考 GeometryConstants.MIN_LATITUDE
和 GeometryConstants.MAX_LATITUDE
,
否则将抛出IllegalArgumentException异常
latNorth 应该大于或等于 latSouth, 否则抛出IllegalArgumentException异常
public static LatLngBounds from(int z, int x, int y)
返回的边界将对应在墨卡托坐标系上
z
- 瓦片放大级别x
- 瓦片X坐标y
- 瓦片Y坐标GeometryConstants.MIN_MERCATOR_LATITUDE
,
GeometryConstants.MAX_MERCATOR_LATITUDE
public LatLngBounds include(LatLng latLng)
latLng
- 地理坐标点public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean contains(LatLng latLng)
latLng
- 地理坐标点public boolean contains(LatLngBounds other)
other
- 地理区域public LatLngBounds union(LatLngBounds bounds)
bounds
- 地理区域public LatLngBounds union(double northLat, double eastLon, double southLat, double westLon)
northLat
- Northern Latitude corner pointeastLon
- Eastern Longitude corner pointsouthLat
- Southern Latitude corner pointwestLon
- Western Longitude corner pointpublic LatLngBounds intersect(LatLngBounds box)
box
- LatLngBounds to intersect withpublic LatLngBounds intersect(double northLat, double eastLon, double southLat, double westLon)
northLat
- Northern Latitude corner pointeastLon
- Eastern Longitude corner pointsouthLat
- Southern Latitude corner pointwestLon
- Western Longitude corner pointpublic int hashCode()
hashCode
in class java.lang.Object
public int describeContents()
public void writeToParcel(Parcel out, int flags)
protected static LatLngBounds readFromParcel(Parcel in)