OpenLayers OpenLayers

Changeset 4521

Show
Ignore:
Timestamp:
09/28/07 14:13:55 (1 year ago)
Author:
sderle
Message:

Add serviceVersion property to Layer.TMS. (see #1023)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Layer/TMS.js

    r4223 r4521  
    1313 */ 
    1414OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, { 
     15 
     16    /** 
     17     * APIProperty: serviceVersion 
     18     * {String} 
     19     */ 
     20    serviceVersion: "1.0.0", 
    1521 
    1622    /** 
     
    9298        var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h)); 
    9399        var z = this.map.getZoom(); 
    94         var path = "1.0.0" + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;  
     100        var path = this.serviceVersion + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;  
    95101        var url = this.url; 
    96102        if (url instanceof Array) { 
  • trunk/openlayers/tests/Layer/test_TMS.html

    r4381 r4521  
    120120    function test_10_Layer_TMS_getURL(t) { 
    121121 
    122         t.plan(2); 
     122        t.plan(3); 
    123123         
    124124        var map = new OpenLayers.Map('map', options); 
     
    129129        var tileurl = layer.getURL(new OpenLayers.Bounds(3.515625,45,4.21875,45.703125)); 
    130130        t.eq(tileurl, "http://labs.metacarta.com/wms-c/Basic.py/1.0.0/basic/9/261/192.png", "Tile URL is correct"); 
     131     
     132        var layer2 = layer.clone(); 
     133        layer2.serviceVersion = "1.2.3"; 
     134        map.addLayer(layer2); 
     135        tileurl = layer2.getURL(new OpenLayers.Bounds(3.515625,45,4.21875,45.703125)); 
     136        t.eq(tileurl, "http://labs.metacarta.com/wms-c/Basic.py/1.2.3/basic/9/261/192.png", "TMS serviceVersion is correct"); 
    131137 
    132138        layer.url = ["http://tilecache1/", "http://tilecache2/", "http://tilecache3/"];