Changeset 3620 in osm


Ignore:
Timestamp:
2007-07-19T02:05:17+02:00 (18 years ago)
Author:
ulf
Message:

slightly improve the map scale calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java

    r3601 r3620  
    3737                        return true;
    3838                }
    39                        
     39                                       
    4040                if(e == null) {
    4141                        /* the default for things that don't have a rule (show, if scale is smaller than 1500m) */
     
    4747                }
    4848               
    49                 if(circum>=e.getMaxScale() / 70 || circum<e.getMinScale() / 70) {
     49                // formular to calculate a map scale: natural size / map size = scale
     50                // example: 876000mm (876m as displayed) / 22mm (roughly estimated screen size of legend bar) = 39818
     51                //
     52                // so the exact "correcting value" below depends only on the screen size and resolution
     53                // XXX - do we need a Preference setting for this (if things vary widely)?
     54                System.out.println("Circum: " + circum + " max: " + e.getMaxScale() + " min:" + e.getMinScale());
     55                if(circum>=e.getMaxScale() / 22 || circum<e.getMinScale() / 22) {
    5056                        return false;
    5157                } else {
Note: See TracChangeset for help on using the changeset viewer.