Ignore:
Timestamp:
2011-06-29T10:06:35+02:00 (13 years ago)
Author:
stoecker
Message:

fix #6432 - projection handling for TMS and WMS

File:
1 edited

Legend:

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

    r4080 r4183  
    3838import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    3939import org.openstreetmap.josm.data.ProjectionBounds;
     40import org.openstreetmap.josm.data.projection.Projection;
    4041import org.openstreetmap.josm.data.coor.EastNorth;
    4142import org.openstreetmap.josm.data.imagery.GeorefImage;
     
    107108    private int workingThreadCount;
    108109    private boolean canceled;
    109 
     110    private ArrayList<String> serverProjections = null;
    110111
    111112    /** set to true if this layer uses an invalid base url */
     
    142143
    143144        if(info.getUrl() != null) {
    144             WMSGrabber.getProjection(info.getUrl(), true);
     145            serverProjections = WMSGrabber.getServerProjections(info.getUrl(), true);
    145146            startGrabberThreads();
    146147            if(info.getImageryType() == ImageryType.WMS && !ImageryInfo.isUrlWithPatterns(info.getUrl())) {
     
    913914    }
    914915
     916    @Override
     917    public boolean isProjectionSupported(Projection proj) {
     918        return serverProjections == null || serverProjections.contains(proj.toCode().toUpperCase());
     919    }
     920
     921    @Override
     922    public String nameSupportedProjections() {
     923        String res = "";
     924        for(String p : serverProjections) {
     925            if(!res.isEmpty())
     926                res += ", ";
     927            res += p;
     928        }
     929        return tr("Supported projections are: {1}", res);
     930    }
    915931}
Note: See TracChangeset for help on using the changeset viewer.