Ignore:
Timestamp:
2016-11-15T21:46:24+01:00 (7 years ago)
Author:
wiktorn
Message:

Make DefaultLayer a type that can have layerName and tileMatrixSet

As WMTS specification gives possibility to have many tileMatrixSet's for
one layer and projection, default layer must specify both - layerName
and tileMatrixSet.

Accommodate to that fact layer selection dialogs and internal
computations in WMTS TileSource.

Closes: #13975

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r11217 r11257  
    195195    private boolean isEpsg4326To3857Supported;
    196196    /** which layers should be activated by default on layer addition. **/
    197     private Collection<String> defaultLayers = Collections.emptyList();
     197    private Collection<DefaultLayer> defaultLayers = Collections.emptyList();
    198198    // when adding a field, also adapt the ImageryInfo(ImageryInfo)
    199199    // and ImageryInfo(ImageryPreferenceEntry) constructor, equals method, and ImageryPreferenceEntry
     
    11561156     * @return Collection of the layer names
    11571157     */
    1158     public Collection<String> getDefaultLayers() {
     1158    public Collection<DefaultLayer> getDefaultLayers() {
    11591159        return defaultLayers;
    11601160    }
     
    11641164     * @param layers set the list of default layers
    11651165     */
    1166     public void setDefaultLayers(Collection<String> layers) {
     1166    public void setDefaultLayers(Collection<DefaultLayer> layers) {
     1167        if (ImageryType.WMTS.equals(this.imageryType)) {
     1168            CheckParameterUtil.ensureThat(layers == null ||
     1169                    layers.isEmpty() ||
     1170                    layers.iterator().next() instanceof WMTSDefaultLayer, "Incorrect default layer");
     1171        }
    11671172        this.defaultLayers = layers;
    11681173    }
Note: See TracChangeset for help on using the changeset viewer.