Changeset 14523 in josm for trunk


Ignore:
Timestamp:
2018-12-08T21:22:54+01:00 (6 years ago)
Author:
Don-vip
Message:

see #16073 - make sure correct projection is used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java

    r14522 r14523  
    3434import org.openstreetmap.josm.data.imagery.WMTSTileSource;
    3535import org.openstreetmap.josm.data.imagery.WMTSTileSource.WMTSGetCapabilitiesException;
     36import org.openstreetmap.josm.data.projection.Projection;
    3637import org.openstreetmap.josm.data.projection.ProjectionRegistry;
     38import org.openstreetmap.josm.data.projection.Projections;
    3739import org.openstreetmap.josm.testutils.JOSMTestRules;
    3840import org.openstreetmap.josm.tools.HttpClient;
     
    190192    }
    191193
     194    private static Projection getProjection(ImageryInfo info) {
     195        return info.getServerProjections().isEmpty() ? ProjectionRegistry.getProjection() :
     196            Projections.getProjectionByCode(info.getServerProjections().get(0));
     197    }
     198
    192199    private static AbstractTileSource getTileSource(ImageryInfo info) throws IOException, WMTSGetCapabilitiesException {
    193200        switch (info.getImageryType()) {
     
    199206                return new TemplatedTMSTileSource(info);
    200207            case WMS:
    201                 return new TemplatedWMSTileSource(info, ProjectionRegistry.getProjection());
     208                return new TemplatedWMSTileSource(info, getProjection(info));
    202209            case WMS_ENDPOINT:
    203                 return new WMSEndpointTileSource(info, ProjectionRegistry.getProjection());
     210                return new WMSEndpointTileSource(info, getProjection(info));
    204211            case WMTS:
    205                 return new WMTSTileSource(info, ProjectionRegistry.getProjection());
     212                return new WMTSTileSource(info, getProjection(info));
    206213            default:
    207214                throw new UnsupportedOperationException(info.toString());
Note: See TracChangeset for help on using the changeset viewer.