Package org.openstreetmap.josm.data
Class ViewportData
- java.lang.Object
-
- org.openstreetmap.josm.data.ViewportData
-
public class ViewportData extends 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)
-
-
Constructor Summary
Constructors Constructor Description ViewportData(EastNorth center, 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 centerDouble
getScale()
Return the scale factor in east-/north-units per pixel.
-
-
-
Constructor Detail
-
ViewportData
public ViewportData(EastNorth center, 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 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
-
-