Package org.openstreetmap.josm.data
Class ViewportData
- java.lang.Object
-
- org.openstreetmap.josm.data.ViewportData
-
public class ViewportData extends java.lang.Object
Data class to keep viewport information. This can be either a combination of map center and map scale or a rectangle in east-north coordinate space. Either of those will be null, so the consumer of the ViewportData object has to check, which one is set.- Since:
- 5670 (creation), 6992 (extraction in this package)
-
-
Field Summary
Fields Modifier and Type Field Description private ProjectionBounds
bounds
private EastNorth
center
private java.lang.Double
scale
-
Constructor Summary
Constructors Constructor Description ViewportData(EastNorth center, java.lang.Double scale)
Constructs a newViewportData
.ViewportData(ProjectionBounds bounds)
Create a newViewportData
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProjectionBounds
getBounds()
Return the bounds in east-north coordinate space.EastNorth
getCenter()
Return the projected coordinates of the map centerjava.lang.Double
getScale()
Return the scale factor in east-/north-units per pixel.
-
-
-
Field Detail
-
scale
private final java.lang.Double scale
-
bounds
private final ProjectionBounds bounds
-
-
Constructor Detail
-
ViewportData
public ViewportData(EastNorth center, java.lang.Double scale)
Constructs a newViewportData
.- Parameters:
center
- Projected coordinates of the map centerscale
- Scale factor in east-/north-units per pixel
-
ViewportData
public ViewportData(ProjectionBounds bounds)
Create a newViewportData
- Parameters:
bounds
- The bounds to zoom to
-
-
Method Detail
-
getCenter
public EastNorth getCenter()
Return the projected coordinates of the map center- Returns:
- the center
-
getScale
public java.lang.Double getScale()
Return the scale factor in east-/north-units per pixel.- Returns:
- the scale
-
getBounds
public ProjectionBounds getBounds()
Return the bounds in east-north coordinate space.- Returns:
- the bounds
-
-