public class Viewport
extends java.lang.Object
Public methods are thread safe.
| Modifier and Type | Field and Description |
|---|---|
static float |
MAX_TILT |
static int |
MAX_ZOOM_LEVEL |
protected float |
mHeight
Height and width in pixels
|
static float |
MIN_TILT |
static int |
MIN_ZOOM_LEVEL |
protected float |
mMaxBearing |
protected float |
mMaxRoll |
protected double |
mMaxScale |
protected float |
mMaxTilt |
protected double |
mMaxX |
protected double |
mMaxY |
protected float |
mMinBearing |
protected float |
mMinRoll |
protected double |
mMinScale |
protected float |
mMinTilt |
protected double |
mMinX |
protected double |
mMinY |
protected Point |
mMovePoint |
protected MapPosition |
mPos |
protected GLMatrix |
mProjMatrix |
protected GLMatrix |
mProjMatrixInverse |
protected GLMatrix |
mProjMatrixUnscaled |
protected GLMatrix |
mRotationMatrix |
protected GLMatrix |
mTmpMatrix |
protected float[] |
mu |
protected GLMatrix |
mUnprojMatrix |
protected float[] |
mv |
protected float[] |
mViewCoords |
protected GLMatrix |
mViewMatrix |
protected GLMatrix |
mViewProjMatrix |
protected float |
mWidth
Height and width in pixels
|
static float |
VIEW_DISTANCE |
static float |
VIEW_FAR |
static float |
VIEW_NEAR |
static float |
VIEW_SCALE
scale map plane at VIEW_DISTANCE to near plane
|
| Constructor and Description |
|---|
Viewport() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
copy(Viewport viewport) |
void |
fromScreenPoint(double x,
double y,
Point out)
Get the map position for x,y in screen coordinates.
|
GeoPoint |
fromScreenPoint(float x,
float y)
Get the GeoPoint for x,y in screen coordinates.
|
Box |
getBBox(Box box,
int expand)
Get the minimal axis-aligned BoundingBox that encloses
the visible part of the map.
|
void |
getMapExtents(float[] box,
float add)
Get the inverse projection of the viewport, i.e.
|
BoundingBox |
getMapLimit() |
boolean |
getMapPosition(MapPosition pos)
Get the current MapPosition.
|
float |
getMaxBearing() |
float |
getMaxRoll() |
double |
getMaxScale() |
float |
getMaxTilt() |
double |
getMaxX() |
double |
getMaxY() |
int |
getMaxZoomLevel() |
float |
getMinBearing() |
float |
getMinRoll() |
double |
getMinScale() |
float |
getMinTilt() |
double |
getMinX() |
double |
getMinY() |
int |
getMinZoomLevel() |
boolean |
limitPosition(MapPosition pos) |
double |
limitScale(double scale) |
float |
limitTilt(float tilt) |
void |
setMapLimit(BoundingBox mapLimit) |
void |
setMapLimit(double minX,
double minY,
double maxX,
double maxY) |
void |
setMaxBearing(float maxBearing) |
void |
setMaxRoll(float maxRoll) |
void |
setMaxScale(double maxScale) |
void |
setMaxTilt(float maxTilt) |
void |
setMaxX(double maxX) |
void |
setMaxY(double maxY) |
void |
setMaxZoomLevel(int maxZoomLevel) |
void |
setMinBearing(float minBearing) |
void |
setMinRoll(float minRoll) |
void |
setMinScale(double minScale) |
void |
setMinTilt(float minTilt) |
void |
setMinX(double minX) |
void |
setMinY(double minY) |
void |
setMinZoomLevel(int minZoomLevel) |
void |
toScreenPoint(double x,
double y,
boolean relativeToCenter,
Point out)
Get the screen pixel for map coordinates
|
void |
toScreenPoint(double x,
double y,
Point out)
Get the screen pixel for map coordinates (relative to center)
|
void |
toScreenPoint(GeoPoint geoPoint,
boolean relativeToCenter,
Point out)
Get the screen pixel for a GeoPoint
|
void |
toScreenPoint(GeoPoint geoPoint,
Point out)
Get the screen pixel for a GeoPoint (relative to center)
|
protected void |
unproject(float x,
float y,
float[] coords,
int position) |
protected void |
unprojectScreen(double x,
double y,
float[] out) |
public static final int MAX_ZOOM_LEVEL
public static final int MIN_ZOOM_LEVEL
public static final float MIN_TILT
public static final float MAX_TILT
protected double mMaxScale
protected double mMinScale
protected float mMinTilt
protected float mMaxTilt
protected float mMinBearing
protected float mMaxBearing
protected float mMinRoll
protected float mMaxRoll
protected double mMinX
protected double mMaxX
protected double mMinY
protected double mMaxY
protected final MapPosition mPos
protected final GLMatrix mProjMatrix
protected final GLMatrix mProjMatrixUnscaled
protected final GLMatrix mProjMatrixInverse
protected final GLMatrix mRotationMatrix
protected final GLMatrix mViewMatrix
protected final GLMatrix mViewProjMatrix
protected final GLMatrix mUnprojMatrix
protected final GLMatrix mTmpMatrix
protected final Point mMovePoint
protected final float[] mv
protected final float[] mu
protected final float[] mViewCoords
protected float mHeight
protected float mWidth
public static final float VIEW_DISTANCE
public static final float VIEW_NEAR
public static final float VIEW_FAR
public static final float VIEW_SCALE
public double limitScale(double scale)
public float limitTilt(float tilt)
public boolean limitPosition(MapPosition pos)
public boolean getMapPosition(MapPosition pos)
pos - MapPosition to be updated.public void getMapExtents(float[] box,
float add)
box - float[8] will be set.add - increase extents of boxprotected void unproject(float x,
float y,
float[] coords,
int position)
public Box getBBox(Box box, int expand)
public GeoPoint fromScreenPoint(float x, float y)
x - screen coordinatey - screen coordinateprotected void unprojectScreen(double x,
double y,
float[] out)
public void fromScreenPoint(double x,
double y,
Point out)
x - screen coordinatey - screen coordinatepublic void toScreenPoint(GeoPoint geoPoint, Point out)
geoPoint - the GeoPointout - Point projected to screen pixel relative to centerpublic void toScreenPoint(GeoPoint geoPoint, boolean relativeToCenter, Point out)
geoPoint - the GeoPointout - Point projected to screen pixelpublic void toScreenPoint(double x,
double y,
Point out)
out - Point projected to screen coordinate relative to centerpublic void toScreenPoint(double x,
double y,
boolean relativeToCenter,
Point out)
out - Point projected to screen coordinateprotected boolean copy(Viewport viewport)
public double getMaxScale()
public void setMaxScale(double maxScale)
public double getMinScale()
public void setMinScale(double minScale)
public int getMaxZoomLevel()
public void setMaxZoomLevel(int maxZoomLevel)
public int getMinZoomLevel()
public void setMinZoomLevel(int minZoomLevel)
public float getMaxTilt()
public void setMaxTilt(float maxTilt)
public float getMinTilt()
public void setMinTilt(float minTilt)
public float getMaxBearing()
public void setMaxBearing(float maxBearing)
public float getMinBearing()
public void setMinBearing(float minBearing)
public float getMaxRoll()
public void setMaxRoll(float maxRoll)
public float getMinRoll()
public void setMinRoll(float minRoll)
public double getMaxX()
public void setMaxX(double maxX)
public double getMinX()
public void setMinX(double minX)
public double getMaxY()
public void setMaxY(double maxY)
public double getMinY()
public void setMinY(double minY)
public void setMapLimit(double minX,
double minY,
double maxX,
double maxY)
public BoundingBox getMapLimit()
public void setMapLimit(BoundingBox mapLimit)