public class MapModel3D
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAP_WIDTH_LONGITUDE |
Constructor and Description |
---|
MapModel3D(int worldWidth)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
calculateMinutesPerWorldUnit(double mapWidthInLongitude)
Calculates the number of minutes per pixels using a given
map width in longitude.
|
Position |
getCentre()
Returns the
Position centre of the map. |
Vector3f |
getCentreWu()
Returns the WU (x,y,z) centre of the map.
|
double |
getMetersPerWu()
Returns the meters per WU.
|
double |
getMinutesPerWu()
Returns the number of minutes there are per WU.
|
int |
getWorldHeight()
Returns the height of the viewport in pixels.
|
int |
getWorldWidth()
Returns the width of the viewport in pixels.
|
void |
setCentre(Position centre)
Sets the map's centre.
|
void |
setCentre(Vector3f posVec)
Defines the centre of the map in pixels.
|
void |
setWorldHeight(int viewportHeight)
Sets the world's desired height.
|
void |
setWorldWidth(int viewportWidth)
Sets the world's desired width.
|
Position |
toPosition(Vector3f posVec)
Converts a world position into a Mercator position.
|
Vector3f |
toWorldUnit(Position position)
Converts a latitude/longitude position into a WU coordinate.
|
public static final int DEFAULT_MAP_WIDTH_LONGITUDE
public MapModel3D(int worldWidth)
worldWidth
- The world unit width the map's areapublic int getWorldHeight()
public void calculateMinutesPerWorldUnit(double mapWidthInLongitude)
mapWidthInLongitude
- The map's with in degrees of longitude.public int getWorldWidth()
public void setWorldWidth(int viewportWidth)
viewportWidth
- The world's desired width in WU.public void setWorldHeight(int viewportHeight)
viewportHeight
- The world's desired height in WU.public void setCentre(Position centre)
centre
- The Position
denoting the map's
desired centre.public double getMinutesPerWu()
public double getMetersPerWu()
public Vector3f toWorldUnit(Position position)
position
- The Position
to convert.Point
a pixel coordinate.public Position toPosition(Vector3f posVec)
posVec
- Vector
containing the world unit
coordinates that are to be converted into
longitude / latitude coordinates.Position
in degrees of
latitude and longitude.public void setCentre(Vector3f posVec)
posVec
- Vector3f
object denoting the map's new centre.public Vector3f getCentreWu()
Vector3f
object marking the map's (x,y) centre.public Position getCentre()
Position
centre of the map.Position
object marking the map's (lat, long)
centre.