Changeset 5017 in josm for trunk/src


Ignore:
Timestamp:
2012-02-22T19:17:45+01:00 (13 years ago)
Author:
stoecker
Message:

use EPSG codes instead of instanceof to verify projection (allows to use proj4j projections instead of internally supported projections)

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

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

    r4985 r5017  
    6666import org.openstreetmap.josm.data.preferences.IntegerProperty;
    6767import org.openstreetmap.josm.data.preferences.StringProperty;
    68 import org.openstreetmap.josm.data.projection.Epsg4326;
    69 import org.openstreetmap.josm.data.projection.Mercator;
    7068import org.openstreetmap.josm.data.projection.Projection;
    7169import org.openstreetmap.josm.gui.MapView;
     
    14471445    @Override
    14481446    public boolean isProjectionSupported(Projection proj) {
    1449         return proj instanceof Mercator || proj instanceof Epsg4326;
     1447        return "EPSG:3857".equals(proj.toCode()) || "EPSG:4326".equals(proj.toCode());
    14501448    }
    14511449
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r4745 r5017  
    5757import org.openstreetmap.josm.data.preferences.BooleanProperty;
    5858import org.openstreetmap.josm.data.preferences.IntegerProperty;
    59 import org.openstreetmap.josm.data.projection.Mercator;
    6059import org.openstreetmap.josm.data.projection.Projection;
    6160import org.openstreetmap.josm.gui.MapView;
     
    10301029        List<String> serverProjections = info.getServerProjections();
    10311030        return serverProjections.contains(proj.toCode().toUpperCase())
    1032                 || (proj instanceof Mercator && serverProjections.contains("EPSG:4326"));
     1031                || ("EPSG:3857".equals(proj.toCode()) && (serverProjections.contains("EPSG:4326") || serverProjections.contains("CRS:84")))
     1032                || ("EPSG:4326".equals(proj.toCode()) && serverProjections.contains("CRS:84"));
    10331033    }
    10341034
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java

    r4857 r5017  
    3131import org.openstreetmap.josm.data.imagery.GeorefImage.State;
    3232import org.openstreetmap.josm.data.imagery.ImageryInfo;
    33 import org.openstreetmap.josm.data.projection.Mercator;
    3433import org.openstreetmap.josm.gui.MapView;
    3534import org.openstreetmap.josm.gui.layer.WMSLayer;
     
    8685            int wi, int ht) throws MalformedURLException {
    8786        String myProj = Main.getProjection().toCode();
    88         if (!info.getServerProjections().contains(myProj) && (Main.getProjection() instanceof Mercator)) {
     87        if (!info.getServerProjections().contains(myProj) && "EPSG:3857".equals(Main.getProjection().toCode())) {
    8988            LatLon sw = Main.getProjection().eastNorth2latlon(new EastNorth(w, s));
    9089            LatLon ne = Main.getProjection().eastNorth2latlon(new EastNorth(e, n));
     
    9998        }
    10099
    101         // Bounding box coordinats have to be switched for WMS 1.3.0 EPSG:4326.
     100        // Bounding box coordinates have to be switched for WMS 1.3.0 EPSG:4326.
    102101        //
    103102        // Background:
Note: See TracChangeset for help on using the changeset viewer.