Changeset 4037
- Timestamp:
- 08/24/07 19:49:06 (1 year ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Layer/TMS.js (modified) (1 diff)
- trunk/openlayers/tests/Layer/test_TMS.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Layer/TMS.js
r3984 r4037 95 95 bounds = this.adjustBounds(bounds); 96 96 var res = this.map.getResolution(); 97 var x = (bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w);98 var y = (bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h);97 var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w)); 98 var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h)); 99 99 var z = this.map.getZoom(); 100 100 var path = "1.0.0" + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type; trunk/openlayers/tests/Layer/test_TMS.html
r3725 r4037 121 121 t.eq(tileurl, "http://tilecache1/1.0.0/basic/9/261/192.png", "Tile URL is deterministic"); 122 122 } 123 function test_Layer_TMS_Rounding(t) { 124 t.plan(1); 125 m = new OpenLayers.Map("map", {'maxExtent':new OpenLayers.Bounds(-122.6579,37.4901,-122.0738,37.8795)}); 126 layer = new OpenLayers.Layer.TMS( "TMS", 127 "http://labs.metacarta.com/wms-c/Basic.py/", {layername: 'basic', type:'png', resolutions:[0.000634956337608418]} ); 128 m.addLayer(layer); 129 m.zoomToMaxExtent() 130 t.eq(layer.getURL(layer.grid[3][3].bounds), "http://labs.metacarta.com/wms-c/Basic.py/1.0.0/basic/0/1/1.png", "TMS tiles around rounded properly."); 131 } 132 123 133 124 134 function test_11_Layer_TMS_setMap(t) {
