Merge pull request #82 from fredj/2897
don't create div for image tile when no gutter is used. p=ahocevar,pgiraud,elemoine,fredj
This commit is contained in:
@@ -75,10 +75,10 @@
|
||||
t.eq( tile.url,
|
||||
url + "?" + OpenLayers.Util.getParameterString(tParams),
|
||||
"image src is created correctly via addtile" );
|
||||
t.eq( tile.frame.style.top, "6%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.frame.style.left, "5%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.getTile().style.top, "6%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.getTile().style.left, "5%", "image top is set correctly via addtile" );
|
||||
|
||||
var firstChild = layer.div.firstChild.firstChild;
|
||||
var firstChild = layer.div.firstChild;
|
||||
t.eq( firstChild.nodeName.toLowerCase(), "img", "div first child is an image object" );
|
||||
t.ok( firstChild == img, "div first child is correct image object" );
|
||||
t.eq( tile.position.toString(), "x=5,y=6", "Position of tile is set correctly." );
|
||||
@@ -203,10 +203,10 @@
|
||||
map.addLayer(tLayer);
|
||||
map.zoomToMaxExtent();
|
||||
t.eq(tLayer.opacity, "0.5", "Opacity is set correctly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||
tLayer.setOpacity("0.6");
|
||||
t.eq(tLayer.opacity, "0.6", "setOpacity works properly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||
var pixel = new OpenLayers.Pixel(5,6);
|
||||
var tile = tLayer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
|
||||
tile.draw();
|
||||
|
||||
@@ -56,10 +56,10 @@
|
||||
t.eq( tile.url,
|
||||
url + "?" + OpenLayers.Util.getParameterString(tParams).replace(/,/g, "+"),
|
||||
"image src is created correctly via addtile" );
|
||||
t.eq( tile.frame.style.top, "6%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.frame.style.left, "5%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.getTile().style.top, "6%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.getTile().style.left, "5%", "image top is set correctly via addtile" );
|
||||
|
||||
var firstChild = layer.div.firstChild.firstChild;
|
||||
var firstChild = layer.div.firstChild;
|
||||
t.eq( firstChild.nodeName.toLowerCase(), "img", "div first child is an image object" );
|
||||
t.ok( firstChild == img, "div first child is correct image object" );
|
||||
t.eq( tile.position.toString(), "x=5,y=6", "Position of tile is set correctly." );
|
||||
@@ -204,10 +204,10 @@
|
||||
map.addLayer(tLayer);
|
||||
map.zoomToMaxExtent();
|
||||
t.eq(tLayer.opacity, "0.5", "Opacity is set correctly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||
tLayer.setOpacity("0.6");
|
||||
t.eq(tLayer.opacity, "0.6", "setOpacity works properly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||
var pixel = new OpenLayers.Pixel(5,6);
|
||||
var tile = tLayer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
|
||||
tile.draw();
|
||||
|
||||
@@ -86,10 +86,10 @@
|
||||
t.eq( tile.url,
|
||||
layer.getFullRequestString(tParams),
|
||||
"image src is created correctly via addtile" );
|
||||
t.eq( tile.frame.style.top, "6%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.frame.style.left, "5%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.getTile().style.top, "6%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.getTile().style.left, "5%", "image top is set correctly via addtile" );
|
||||
|
||||
var firstChild = layer.div.firstChild.firstChild;
|
||||
var firstChild = layer.div.firstChild;
|
||||
t.eq( firstChild.nodeName.toLowerCase(), "img", "div first child is an image object" );
|
||||
t.ok( firstChild == img, "div first child is correct image object" );
|
||||
t.eq( tile.position.toString(), "x=5,y=6", "Position of tile is set correctly." );
|
||||
@@ -117,10 +117,10 @@
|
||||
t.eq( tile.url,
|
||||
layer.getFullRequestString(tParams),
|
||||
"image src is created correctly via addtile" );
|
||||
t.eq( tile.frame.style.top, "6%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.frame.style.left, "5%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.getTile().style.top, "6%", "image top is set correctly via addtile" );
|
||||
t.eq( tile.getTile().style.left, "5%", "image top is set correctly via addtile" );
|
||||
|
||||
var firstChild = layer.div.firstChild.firstChild;
|
||||
var firstChild = layer.div.firstChild;
|
||||
t.eq( firstChild.nodeName.toLowerCase(), "img", "div first child is an image object" );
|
||||
t.ok( firstChild, img, "div first child is correct image object" );
|
||||
t.eq( tile.position.toString(), "x=5,y=6", "Position of tile is set correctly." );
|
||||
@@ -284,10 +284,10 @@
|
||||
map.addLayer(tLayer);
|
||||
map.zoomToMaxExtent();
|
||||
t.eq(tLayer.opacity, "0.5", "Opacity is set correctly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||
tLayer.setOpacity("0.6");
|
||||
t.eq(tLayer.opacity, "0.6", "setOpacity works properly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||
var pixel = new OpenLayers.Pixel(5,6);
|
||||
var tile = tLayer.addTile(new OpenLayers.Bounds(1,2,3,4), pixel);
|
||||
tile.draw();
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
}
|
||||
|
||||
function test_Tile_Image_draw (t) {
|
||||
t.plan( 7 );
|
||||
t.plan(8);
|
||||
|
||||
var map = new OpenLayers.Map('map');
|
||||
|
||||
@@ -157,8 +157,9 @@
|
||||
"http://labs.metacarta.com/TESTURL?" + OpenLayers.Util.getParameterString(tParams),
|
||||
"tile.draw creates an image");
|
||||
});
|
||||
t.eq( tile.imgDiv.style.width, "100%", "Image width is correct" );
|
||||
t.eq( tile.imgDiv.style.height, "100%", "Image height is correct" );
|
||||
t.eq( tile.imgDiv.style.width, "5%", "Image width is correct" );
|
||||
t.eq( tile.imgDiv.style.height, "6%", "Image height is correct" );
|
||||
t.ok( tile.imgDiv.parentNode === layer.div, "Image is directly appended to the layer div" );
|
||||
|
||||
// this should trigger a "reload" event (since the image never actually
|
||||
// loads in tests)
|
||||
@@ -334,10 +335,10 @@
|
||||
OpenLayers.Event.stopObservingElement(tile.imgDiv);
|
||||
|
||||
var img = tile.imgDiv;
|
||||
var left = img.style.left;
|
||||
var bb = tile.createBackBuffer();
|
||||
t.eq(bb.style.left, tile.frame.style.left,
|
||||
"backbuffer has same left style as frame");
|
||||
t.ok(bb.firstChild === img, "image appended to bb");
|
||||
t.eq(bb.style.left, left, "backbuffer has same left style as frame");
|
||||
t.ok(bb === img, "image appended to bb");
|
||||
t.ok(tile.imgDiv == null, "image reference removed from tile");
|
||||
map.destroy();
|
||||
}
|
||||
|
||||
@@ -131,10 +131,10 @@
|
||||
map.addLayer(tLayer);
|
||||
map.zoomToMaxExtent();
|
||||
t.eq(tLayer.opacity, "0.5", "Opacity is set correctly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.5, "Opacity on tile is correct");
|
||||
tLayer.setOpacity("0.6");
|
||||
t.eq(tLayer.opacity, "0.6", "setOpacity works properly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||
t.eq(parseFloat(tLayer.div.firstChild.style.opacity), 0.6, "Opacity on tile is changed correctly");
|
||||
map.destroy();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user