Ignore:
Timestamp:
2015-06-24T20:57:43+02:00 (9 years ago)
Author:
wiktorn
Message:

Introduce WMS layer based on TMS. (closes: #11255)

HEADS UP: After this patch you need to manually remove JAX-B generated file/class: org/w3/_2001/xmlschema/Adapter1.java to compile the tree again.

  • create AbstractTileSourceLayer based on TMSLayer as a base for TMS, WMS and (future) WMTS layers, (addresses #11459)
  • WMS layer now uses JCS Caching (closes: #7363)
  • introduce new conversion methods in TileSource, that convert both X and Y (lat and lon) in one call. This is necessary for other than PseudoMercator projections
    • introduce TileXY class that represents X and Y indexes of tile in tile matrix/space
    • mark old conversion methods as deprecated
    • refactor JMapViewer and JOSM to new methods
    • change use of Coordinate class to ICoordinate where appropiate
  • extract CachedAttributionBingAerialTileSource to separate file
  • create TemplatedWMSTileSource that provides the WMS Layer with square (according to current projection) tiles (closes: #11572, closes: #7682, addresses: #5454)
  • implemented precaching imagery along GPX track for AbstractTileSourceLayer, so now it work for both - WMS and TMS (closes: #9154)
  • implemented common righ-click menu on map view, as well on layer list (closes #3591)
  • create separate build commands for JMapViewer classes to easily spot, when josm classes are used within JMapViewer
  • remove unnecessary classes of previous WMS implementation - GeorefImage, wms-cache.xsd (and JAXB task from build), WMSCache, WMSRequest, WMSGrabber, HTMLGrabber, WMSException
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java

    r8510 r8526  
    1111import org.openstreetmap.josm.data.imagery.ImageryInfo;
    1212import org.openstreetmap.josm.data.imagery.ImageryInfo.ImageryPreferenceEntry;
     13import org.openstreetmap.josm.gui.layer.AbstractTileSourceLayer;
    1314import org.openstreetmap.josm.gui.layer.ImageryLayer;
    1415import org.openstreetmap.josm.gui.layer.Layer;
    15 import org.openstreetmap.josm.gui.layer.WMSLayer;
    1616import org.openstreetmap.josm.gui.progress.ProgressMonitor;
    1717import org.openstreetmap.josm.io.IllegalDataException;
     
    4646        ImageryInfo i = new ImageryInfo(prefEntry);
    4747        ImageryLayer layer = ImageryLayer.create(i);
    48         if (layer instanceof WMSLayer) {
    49             WMSLayer wms = (WMSLayer) layer;
    50             String autoDownload = attributes.get("automatic-downloading");
    51             if (autoDownload != null) {
    52                 wms.setAutoDownload(Boolean.parseBoolean(autoDownload));
     48        if (layer instanceof AbstractTileSourceLayer) {
     49            AbstractTileSourceLayer tsLayer = (AbstractTileSourceLayer) layer;
     50            if (attributes.containsKey("automatic-downloading")) {
     51                tsLayer.autoLoad = new Boolean(attributes.get("automatic-downloading")).booleanValue();
    5352            }
    54             String autoResolution = attributes.get("automatically-change-resolution");
    55             if (autoResolution != null) {
    56                 wms.setAutoResolution(Boolean.parseBoolean(autoResolution));
     53
     54            if (attributes.containsKey("automatically-change-resolution")) {
     55                tsLayer.autoZoom = new Boolean(attributes.get("automatically-change-resolution")).booleanValue();
     56            }
     57
     58            if (attributes.containsKey("show-errors")) {
     59                tsLayer.showErrors = new Boolean(attributes.get("show-errors")).booleanValue();
    5760            }
    5861        }
Note: See TracChangeset for help on using the changeset viewer.