Ignore:
Timestamp:
2009-07-03T12:33:32+02:00 (15 years ago)
Author:
stoecker
Message:

Large rework in projection handling - now allows only switching and more specific projections
TODO:

  • allow subprojections (i.e. settings for projections)
  • setup preferences for subprojections
  • better support of the new projection depending world bounds (how to handle valid data outside of world)
  • do not allow to zoom out of the world - zoom should stop when whole world is displayed
  • fix Lambert and SwissGrid to handle new OutOfWorld style and subprojections
  • fix new UTM projection
  • handle layers with fixed projection on projection change
  • allow easier projection switching (e.g. in menu)

NOTE:
This checkin very likely will cause problems. Please report or fix them. Older plugins may have trouble. The SVN plugins
have been fixed but may have problems nevertheless. This is a BIG change, but will make JOSMs internal structure much cleaner
and reduce lots of projection related problems.

File:
1 edited

Legend:

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

    r1180 r1722  
    1313
    1414import org.openstreetmap.josm.Main;
     15import org.openstreetmap.josm.data.projection.Mercator;
    1516import org.openstreetmap.josm.data.projection.Projection;
    1617import org.openstreetmap.josm.data.coor.LatLon.CoordinateFormat;
     18import org.openstreetmap.josm.data.osm.Node;
    1719import org.openstreetmap.josm.tools.GBC;
    1820
     
    2830
    2931        for (int i = 0; i < projectionCombo.getItemCount(); ++i) {
    30             if (projectionCombo.getItemAt(i).getClass().getName().equals(Main.pref.get("projection"))) {
     32            if (projectionCombo.getItemAt(i).getClass().getName().equals(Main.pref.get("projection", Mercator.class.getName()))) {
    3133                projectionCombo.setSelectedIndex(i);
    3234                break;
     
    5456
    5557    public boolean ok() {
    56         boolean restart = Main.pref.put("projection",
    57         projectionCombo.getSelectedItem().getClass().getName());
     58        String projname = projectionCombo.getSelectedItem().getClass().getName();
     59        if(Main.pref.put("projection", projname))
     60            Main.setProjection(projname);
    5861        if(Main.pref.put("coordinates",
    5962        ((CoordinateFormat)coordinatesCombo.getSelectedItem()).name()))
    60             restart = true;
    61         return restart;
     63            Node.setCoordinateFormat();
     64        return false;
    6265    }
    6366}
Note: See TracChangeset for help on using the changeset viewer.