Ignore:
Timestamp:
2011-07-14T12:48:27+02:00 (13 years ago)
Author:
bastiK
Message:

see #6532 - add support for xml imagery source format

(todo: the specified server projections aren't used properly in WMSGrabber)

File:
1 edited

Legend:

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

    r4184 r4240  
    108108    private int workingThreadCount;
    109109    private boolean canceled;
    110     private ArrayList<String> serverProjections = null;
     110    private List<String> serverProjections = null;
    111111
    112112    /** set to true if this layer uses an invalid base url */
     
    121121    public WMSLayer(ImageryInfo info) {
    122122        super(info);
     123        serverProjections = info.getServerProjections();
    123124        mv = Main.map.mapView;
    124125        setBackgroundLayer(true); /* set global background variable */
     
    143144
    144145        if(info.getUrl() != null) {
    145             serverProjections = WMSGrabber.getServerProjections(info.getUrl(), true);
     146            if (serverProjections == null) {
     147                serverProjections = WMSGrabber.getServerProjections(info.getUrl(), true);
     148            }
    146149            startGrabberThreads();
    147150            if(info.getImageryType() == ImageryType.WMS && !ImageryInfo.isUrlWithPatterns(info.getUrl())) {
     
    310313     */
    311314    public int getBaseImageWidth() {
    312         int overlap = (PROP_OVERLAP.get()?PROP_OVERLAP_EAST.get() * imageSize / 100:0);
     315        int overlap = PROP_OVERLAP.get() ? (PROP_OVERLAP_EAST.get() * imageSize / 100) : 0;
    313316        return imageSize + overlap;
    314317    }
     
    319322     */
    320323    public int getBaseImageHeight() {
    321         int overlap = (PROP_OVERLAP.get()?PROP_OVERLAP_NORTH.get() * imageSize / 100:0);
     324        int overlap = PROP_OVERLAP.get() ? (PROP_OVERLAP_NORTH.get() * imageSize / 100) : 0;
    322325        return imageSize + overlap;
    323326    }
     
    696699                    oos.writeDouble(info.getPixelPerDegree());
    697700                    oos.writeObject(info.getName());
    698                     oos.writeObject(info.getFullUrl());
     701                    oos.writeObject(info.getExtendedUrl());
    699702                    oos.writeObject(images);
    700703                    oos.close();
     
    735738                info.setPixelPerDegree(ois.readDouble());
    736739                doSetName((String)ois.readObject());
    737                 info.setUrl((String) ois.readObject());
     740                info.setExtendedUrl((String) ois.readObject());
    738741                images = (GeorefImage[][])ois.readObject();
    739742                ois.close();
     
    914917    }
    915918
     919    /**
     920     * Get the list of projections supported by the WMS server corresponding to this layer.
     921     * @return The list of projections, if known. An empty list otherwise.
     922     */
     923    public List<String> getServerProjections() {
     924        if (serverProjections == null)
     925            return Collections.emptyList();
     926        else
     927            return Collections.unmodifiableList(serverProjections);
     928    }
     929   
    916930    @Override
    917931    public boolean isProjectionSupported(Projection proj) {
Note: See TracChangeset for help on using the changeset viewer.