001// License: GPL. For details, see LICENSE file. 002package org.openstreetmap.josm.data; 003 004import org.openstreetmap.josm.data.coor.EastNorth; 005 006/** 007 * Simple data class that keeps map center and scale in one object. 008 * @since 5670 (creation) 009 * @since 6992 (extraction in this package) 010 */ 011public class ViewportData { 012 private EastNorth center; 013 private Double scale; 014 015 /** 016 * Constructs a new {@code ViewportData}. 017 * @param center Projected coordinates of the map center 018 * @param scale Scale factor in east-/north-units per pixel 019 */ 020 public ViewportData(EastNorth center, Double scale) { 021 this.center = center; 022 this.scale = scale; 023 } 024 025 /** 026 * Return the projected coordinates of the map center 027 * @return the center 028 */ 029 public EastNorth getCenter() { 030 return center; 031 } 032 033 /** 034 * Return the scale factor in east-/north-units per pixel. 035 * @return the scale 036 */ 037 public Double getScale() { 038 return scale; 039 } 040}