summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/deprecated/Popup/AnchoredBubble.html
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2014-08-12 21:56:44 +0200
committerChris Schlaeger <chris@linux.com>2014-08-12 21:56:44 +0200
commitea346a785dc1b3f7c156f6fc33da634e1f1a627b (patch)
treeaf67530553d20b6e82ad60fd79593e9c4abf5565 /misc/openlayers/tests/deprecated/Popup/AnchoredBubble.html
parent59741cd535c47f25971bf8c32b25da25ceadc6d5 (diff)
downloadpostrunner-ea346a785dc1b3f7c156f6fc33da634e1f1a627b.zip
Adding jquery, flot and openlayers to be included with the GEM.v0.0.4
Diffstat (limited to 'misc/openlayers/tests/deprecated/Popup/AnchoredBubble.html')
-rw-r--r--misc/openlayers/tests/deprecated/Popup/AnchoredBubble.html61
1 files changed, 61 insertions, 0 deletions
diff --git a/misc/openlayers/tests/deprecated/Popup/AnchoredBubble.html b/misc/openlayers/tests/deprecated/Popup/AnchoredBubble.html
new file mode 100644
index 0000000..ffad069
--- /dev/null
+++ b/misc/openlayers/tests/deprecated/Popup/AnchoredBubble.html
@@ -0,0 +1,61 @@
+<html>
+<head>
+ <script src="../../OLLoader.js"></script>
+ <script src="../../../lib/Rico/Corner.js"></script>
+ <script src="../../../lib/deprecated.js"></script>
+ <script type="text/javascript">
+
+ function test_Popup_Anchored_setOpacity(t) {
+ t.plan(5);
+ var opacity = 0.5;
+ var id = "chicken";
+ var w = 500;
+ var h = 400;
+ var sz = new OpenLayers.Size(w,h);
+ var lon = 5;
+ var lat = 40;
+ var ll = new OpenLayers.LonLat(lon, lat);
+ var content = "foo";
+ var x = 50;
+ var y = 100;
+
+ var map = new OpenLayers.Map('map');
+ map.addLayer(new OpenLayers.Layer('name', {'isBaseLayer':true}));
+ map.zoomToMaxExtent();
+
+ var popup = new OpenLayers.Popup.AnchoredBubble(id,
+ ll,
+ sz,
+ content,
+ null,
+ false);
+ map.addPopup(popup);
+
+ popup.setOpacity(opacity);
+ popup.draw(new OpenLayers.Pixel(x, y));
+
+ if (navigator.appName.indexOf("Microsoft") == -1 || new RegExp(/msie 10/).test(navigator.userAgent.toLowerCase())) {
+ t.eq(parseFloat(popup.div.style.opacity), opacity, "good default popup.opacity");
+ } else {
+ t.eq(popup.div.style.filter, "alpha(opacity=" + opacity*100 + ")", "good default popup.opacity");
+ }
+
+ t.ok(popup.groupDiv!=null, "popup.groupDiv exists");
+ t.ok(popup.groupDiv.parentNode!=null, "popup.groupDiv.parentNode exists");
+ t.ok(popup.groupDiv.parentNode.getElementsByTagName("span").length > 0, "popup.groupDiv.parentNode has SPAN children");
+
+ var ricoCornerDiv = popup.groupDiv.parentNode.getElementsByTagName("span")[0];
+ if (navigator.appName.indexOf("Microsoft") == -1 || new RegExp(/msie 10/).test(navigator.userAgent.toLowerCase())) {
+ t.eq(parseFloat(ricoCornerDiv.style.opacity), opacity, "good default ricoCornerDiv.opacity");
+ } else {
+ t.eq(ricoCornerDiv.style.filter, "alpha(opacity=" + opacity*100 + ")", "good default ricoCornerDiv.opacity");
+ }
+
+ }
+
+ </script>
+</head>
+<body>
+<div id="map" style="width:512px; height:256px"> </div>
+</body>
+</html>