public class LatLngBoundsZoom
extends java.lang.Object
implements android.os.Parcelable
This class does not wrap values to the world bounds.
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<LatLngBoundsZoom> |
CREATOR
Inner class responsible for recreating Parcels into objects.
|
Modifier and Type | Method and Description |
---|---|
int |
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
|
boolean |
equals(java.lang.Object o)
Determines whether this LatLngBounds matches another one via LatLng.
|
static LatLngBoundsZoom |
from(double latNorth,
double lonEast,
double latSouth,
double lonWest,
double zoom)
Constructs a LatLngBoundsZoom from doubles representing a LatLng pair and zoom level.
|
static LatLngBoundsZoom |
from(int z,
int x,
int y)
Constructs a LatLngBounds from a Tile identifier.
|
static LatLngBoundsZoom |
from(LatLngBounds bounds,
double zoom)
Construct a new LatLngBoundsZoom based on its corners, given in NESW
order and the zoom level.
|
LatLngBounds |
getLatLngBounds()
Get the LatLngBounds of the LatLngBoundsZoom.
|
double |
getZoom()
Get the zoom level of the LatLngBoundsZoom.
|
int |
hashCode()
Returns a hash code value for the object.
|
java.lang.String |
toString()
Returns a string representation of the object.
|
void |
writeToParcel(android.os.Parcel out,
int flags)
Flatten this object in to a Parcel.
|
public static final android.os.Parcelable.Creator<LatLngBoundsZoom> CREATOR
public LatLngBounds getLatLngBounds()
public double getZoom()
@NonNull public java.lang.String toString()
toString
in class java.lang.Object
public static LatLngBoundsZoom from(double latNorth, double lonEast, double latSouth, double lonWest, double zoom)
This values of latNorth and latSouth should be in the range of [-90, 90],
see GeometryConstants.MIN_LATITUDE
and GeometryConstants.MAX_LATITUDE
,
otherwise IllegalArgumentException will be thrown.
latNorth should be greater or equal latSouth, otherwise IllegalArgumentException will be thrown.
This method doesn't recalculate most east or most west boundaries.
Note @since 7.0.0 lonEast and lonWest will NOT be wrapped to be in the range of [-180, 180],
see GeometryConstants.MIN_LONGITUDE
and GeometryConstants.MAX_LONGITUDE
lonEast should be greater or equal lonWest, otherwise IllegalArgumentException will be thrown.
public static LatLngBoundsZoom from(int z, int x, int y)
Returned bounds will have latitude in the range of Mercator projection.
z
- Tile zoom level.x
- Tile X coordinate.y
- Tile Y coordinate.GeometryConstants.MIN_MERCATOR_LATITUDE
,
GeometryConstants.MAX_MERCATOR_LATITUDE
public static LatLngBoundsZoom from(LatLngBounds bounds, double zoom)
bounds
- the LatLngBoundszoom
- the zoom levelFor example, to represent bounds spanning 20 degrees crossing antimeridian with the NE point as (10, -170) and the SW point as (-10, 170), use (10, -190) and (-10, -170), or (10, -170) and (-10, -150).
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- another objectpublic int hashCode()
hashCode
in class java.lang.Object
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(@NonNull android.os.Parcel out, int flags)
writeToParcel
in interface android.os.Parcelable
out
- The Parcel in which the object should be written.flags
- Additional flags about how the object should be written