Ignore:
Timestamp:
2013-01-25T22:34:19+01:00 (11 years ago)
Author:
bastiK
Message:

session: save & restore map position and scale (see #4029)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r5565 r5670  
    6565    }
    6666
     67    /**
     68     * Simple data class that keeps map center and scale in one object.
     69     */
     70    public static class ViewportData {
     71        private EastNorth center;
     72        private Double scale;
     73
     74        public ViewportData(EastNorth center, Double scale) {
     75            this.center = center;
     76            this.scale = scale;
     77        }
     78
     79        /**
     80         * Return the projected coordinates of the map center
     81         * @return the center
     82         */
     83        public EastNorth getCenter() {
     84            return center;
     85        }
     86
     87        /**
     88         * Return the scale factor in east-/north-units per pixel.
     89         * @return the scale
     90         */
     91        public Double getScale() {
     92            return scale;
     93        }
     94    }
     95
    6796    public static final IntegerProperty PROP_SNAP_DISTANCE = new IntegerProperty("mappaint.node.snap-distance", 10);
    6897
     
    172201    public EastNorth getCenter() {
    173202        return center;
     203    }
     204
     205    public double getScale() {
     206        return scale;
    174207    }
    175208
Note: See TracChangeset for help on using the changeset viewer.