bring back changes from r6718 that i accidentally blew away
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6725 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+2
-10
@@ -92,7 +92,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function test_Layer_GeoRSS_popups (t) {
|
function test_Layer_GeoRSS_popups (t) {
|
||||||
t.plan( 8 );
|
t.plan( 4 );
|
||||||
layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt);
|
layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt);
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
||||||
@@ -107,18 +107,14 @@
|
|||||||
t.eq(layer.markers[0].events.listeners['click'].length, 1, "Marker events has one object");
|
t.eq(layer.markers[0].events.listeners['click'].length, 1, "Marker events has one object");
|
||||||
layer.markers[0].events.triggerEvent('click', event);
|
layer.markers[0].events.triggerEvent('click', event);
|
||||||
t.eq(map.popups.length, 1, "Popup opened correctly");
|
t.eq(map.popups.length, 1, "Popup opened correctly");
|
||||||
t.eq(map.popups[0].size.w, 250, "Popup sized correctly x");
|
|
||||||
t.eq(map.popups[0].size.h, 120, "Popup sized correctly y");
|
|
||||||
layer.markers[1].events.triggerEvent('click', event);
|
layer.markers[1].events.triggerEvent('click', event);
|
||||||
t.eq(map.popups.length, 1, "1st popup gone, 2nd Popup opened correctly");
|
t.eq(map.popups.length, 1, "1st popup gone, 2nd Popup opened correctly");
|
||||||
t.eq(map.popups[0].size.w, 250, "Popup sized correctly x");
|
|
||||||
t.eq(map.popups[0].size.h, 120, "Popup sized correctly y");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
function test_Layer_GeoRSS_resizedPopups(t) {
|
function test_Layer_GeoRSS_resizedPopups(t) {
|
||||||
layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt, {'popupSize': new OpenLayers.Size(200,100)});
|
layer = new OpenLayers.Layer.GeoRSS('Test Layer', georss_txt, {'popupSize': new OpenLayers.Size(200,100)});
|
||||||
t.plan( 8 );
|
t.plan( 4 );
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
var baseLayer = new OpenLayers.Layer.WMS("Test Layer",
|
||||||
"http://octo.metacarta.com/cgi-bin/mapserv?",
|
"http://octo.metacarta.com/cgi-bin/mapserv?",
|
||||||
@@ -132,13 +128,9 @@
|
|||||||
t.eq(layer.markers[0].events.listeners['click'].length, 1, "Marker events has one object");
|
t.eq(layer.markers[0].events.listeners['click'].length, 1, "Marker events has one object");
|
||||||
layer.markers[0].events.triggerEvent('click', event);
|
layer.markers[0].events.triggerEvent('click', event);
|
||||||
t.eq(map.popups.length, 1, "Popup opened correctly");
|
t.eq(map.popups.length, 1, "Popup opened correctly");
|
||||||
t.eq(map.popups[0].size.w, 200, "Popup sized correctly x");
|
|
||||||
t.eq(map.popups[0].size.h, 100, "Popup sized correctly y");
|
|
||||||
map.popups[0].size.w=300;
|
map.popups[0].size.w=300;
|
||||||
layer.markers[1].events.triggerEvent('click', event);
|
layer.markers[1].events.triggerEvent('click', event);
|
||||||
t.eq(map.popups.length, 1, "1st popup gone, 2nd Popup opened correctly");
|
t.eq(map.popups.length, 1, "1st popup gone, 2nd Popup opened correctly");
|
||||||
t.eq(map.popups[0].size.w, 200, "Popup sized correctly x");
|
|
||||||
t.eq(map.popups[0].size.h, 100, "Popup sized correctly y");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-8
@@ -84,9 +84,10 @@
|
|||||||
popup.lonlat = true;
|
popup.lonlat = true;
|
||||||
popup.updatePosition();
|
popup.updatePosition();
|
||||||
t.ok(true, "update position doesn't fail when getLayerPxFromLonLat fails.");
|
t.ok(true, "update position doesn't fail when getLayerPxFromLonLat fails.");
|
||||||
|
map.destroy();
|
||||||
}
|
}
|
||||||
function test_Popup_draw(t) {
|
function test_Popup_draw(t) {
|
||||||
t.plan( 17 );
|
t.plan( 13 );
|
||||||
|
|
||||||
var id = "chicken";
|
var id = "chicken";
|
||||||
var x = 50;
|
var x = 50;
|
||||||
@@ -98,31 +99,28 @@
|
|||||||
var hexColor = "#ff0000";
|
var hexColor = "#ff0000";
|
||||||
var opacity = 0.5;
|
var opacity = 0.5;
|
||||||
var border = "1px solid";
|
var border = "1px solid";
|
||||||
|
map1 = new OpenLayers.Map("map");
|
||||||
popup = new OpenLayers.Popup(id);
|
popup = new OpenLayers.Popup(id);
|
||||||
popup.setSize(new OpenLayers.Size(w, h));
|
popup.setSize(new OpenLayers.Size(w, h));
|
||||||
popup.setContentHTML(content);
|
popup.setContentHTML(content);
|
||||||
popup.setBackgroundColor(color);
|
popup.setBackgroundColor(color);
|
||||||
popup.setOpacity(opacity);
|
popup.setOpacity(opacity);
|
||||||
popup.setBorder(border);
|
popup.setBorder(border);
|
||||||
popup.draw(new OpenLayers.Pixel(x, y));
|
map1.addPopup(popup);
|
||||||
|
popup.moveTo(new OpenLayers.Pixel(x, y));
|
||||||
|
|
||||||
t.eq(popup.div.id, id, "popup.div.id set correctly");
|
t.eq(popup.div.id, id, "popup.div.id set correctly");
|
||||||
t.eq(popup.div.style.left, x + "px", "left position of popup.div set correctly");
|
t.eq(popup.div.style.left, x + "px", "left position of popup.div set correctly");
|
||||||
t.eq(popup.div.style.top, y + "px", "top position of popup.div set correctly");
|
t.eq(popup.div.style.top, y + "px", "top position of popup.div set correctly");
|
||||||
t.eq(popup.div.style.width, w + "px", "width position of popup.div set correctly");
|
|
||||||
t.eq(popup.div.style.height, h + "px", "heightposition of popup.div set correctly");
|
|
||||||
|
|
||||||
var contentDiv = popup.div.childNodes[0].childNodes[0];
|
var contentDiv = popup.div.childNodes[0].childNodes[0];
|
||||||
|
|
||||||
t.eq(contentDiv.className, "olPopupContent", "correct content div className");
|
t.eq(contentDiv.className, "olPopupContent", "correct content div className");
|
||||||
t.eq(contentDiv.id, "chicken_contentDiv", "correct content div id");
|
t.eq(contentDiv.id, "chicken_contentDiv", "correct content div id");
|
||||||
t.eq(contentDiv.style.width, "500px", "correct content div width");
|
|
||||||
t.eq(contentDiv.style.height, "400px", "correct content div height");
|
|
||||||
t.eq(contentDiv.style.position, "relative", "correct content div position");
|
t.eq(contentDiv.style.position, "relative", "correct content div position");
|
||||||
//Safari 3 separates style overflow into overflow-x and overflow-y
|
//Safari 3 separates style overflow into overflow-x and overflow-y
|
||||||
var prop = (OpenLayers.Util.getBrowserName() == 'safari') ? 'overflowX' : 'overflow';
|
var prop = (OpenLayers.Util.getBrowserName() == 'safari') ? 'overflowX' : 'overflow';
|
||||||
t.eq(contentDiv.style[prop], "hidden", "correct content div overflow");
|
t.eq(contentDiv.style[prop], "", "correct content div overflow");
|
||||||
t.eq(contentDiv.innerHTML, content, "correct content div content");
|
t.eq(contentDiv.innerHTML, content, "correct content div content");
|
||||||
|
|
||||||
var bColor = popup.div.style.backgroundColor;
|
var bColor = popup.div.style.backgroundColor;
|
||||||
|
|||||||
Reference in New Issue
Block a user