diff --git a/examples/controls.html b/examples/controls.html index 33169e0fd2..36c88255f3 100644 --- a/examples/controls.html +++ b/examples/controls.html @@ -8,6 +8,16 @@ + + + - - - - -

Popup Mayhem

- -
- popup, popups -
-

- All kinds of ways to create and interact with Popups. -

- -
-

If you open an anchoredbubble and switch to google, it shouldn't crash. If it does, don't release OpenLayers.

-
click to add Popup to map
-
click to add a Marker with an AnchoredBubble popup
-
click to modify popup's attributes
-
click to remove the popup from map
-
click to remove the markers layer
-
marker.onscreen()?
-
click to destroy the popup from map
-
- Detailed description of this example needs to be written. -
- - diff --git a/lib/OpenLayers/Control/LayerSwitcher.js b/lib/OpenLayers/Control/LayerSwitcher.js index 4186445688..8a6d3e324b 100644 --- a/lib/OpenLayers/Control/LayerSwitcher.js +++ b/lib/OpenLayers/Control/LayerSwitcher.js @@ -6,7 +6,7 @@ /** * @requires OpenLayers/Control.js * @requires OpenLayers/Lang.js - * @requires Rico/Corner.js + * @requires OpenLayers/Console.js */ /** @@ -28,9 +28,13 @@ OpenLayers.Control.LayerSwitcher = /** * APIProperty: roundedCorner * {Boolean} If true the Rico library is used for rounding the corners - * of the layer switcher div, defaults to true. + * of the layer switcher div, defaults to false. *Deprecated*. Use + * CSS3's border-radius instead. If this option is set to true the + * Rico/Corner.js script must be loaded in the page, and therefore + * listed in the build profile. + * */ - roundedCorner: true, + roundedCorner: false, /** * APIProperty: roundedCornerColor @@ -115,6 +119,10 @@ OpenLayers.Control.LayerSwitcher = initialize: function(options) { OpenLayers.Control.prototype.initialize.apply(this, arguments); this.layerStates = []; + + if(this.roundedCorner) { + OpenLayers.Console.warn('roundedCorner option is deprecated'); + } }, /** diff --git a/lib/OpenLayers/Feature.js b/lib/OpenLayers/Feature.js index f921bc4325..bd3c50f6f1 100644 --- a/lib/OpenLayers/Feature.js +++ b/lib/OpenLayers/Feature.js @@ -49,7 +49,7 @@ OpenLayers.Feature = OpenLayers.Class({ /** * APIProperty: popupClass * {} The class which will be used to instantiate - * a new Popup. Default is . + * a new Popup. Default is . */ popupClass: null, @@ -188,7 +188,7 @@ OpenLayers.Feature = OpenLayers.Class({ if (!this.popup) { var anchor = (this.marker) ? this.marker.icon : null; var popupClass = this.popupClass ? - this.popupClass : OpenLayers.Popup.AnchoredBubble; + this.popupClass : OpenLayers.Popup.Anchored; this.popup = new popupClass(this.id + "_popup", this.lonlat, this.data.popupSize, diff --git a/lib/OpenLayers/Popup/Anchored.js b/lib/OpenLayers/Popup/Anchored.js index f36c0d7a4a..4779f6b944 100644 --- a/lib/OpenLayers/Popup/Anchored.js +++ b/lib/OpenLayers/Popup/Anchored.js @@ -162,8 +162,8 @@ OpenLayers.Popup.Anchored = * * Note that in the classic Anchored popup, there is nothing to do * here, since the popup looks exactly the same in all four positions. - * Subclasses such as the AnchoredBubble and Framed, however, will - * want to do something special here. + * Subclasses such as Framed, however, will want to do something + * special here. */ updateRelativePosition: function() { //to be overridden by subclasses diff --git a/lib/OpenLayers/Popup/AnchoredBubble.js b/lib/OpenLayers/Popup/AnchoredBubble.js index 76e6dd2e1f..2f236d6947 100644 --- a/lib/OpenLayers/Popup/AnchoredBubble.js +++ b/lib/OpenLayers/Popup/AnchoredBubble.js @@ -6,11 +6,14 @@ /** * @requires OpenLayers/Popup/Anchored.js + * @requires OpenLayers/Console.js * @requires Rico/Corner.js */ /** * Class: OpenLayers.Popup.AnchoredBubble + * This class is *deprecated*. Use {} and + * round corners using CSS3's border-radius property. * * Inherits from: * - @@ -40,6 +43,8 @@ OpenLayers.Popup.AnchoredBubble = */ initialize:function(id, lonlat, contentSize, contentHTML, anchor, closeBox, closeBoxCallback) { + + OpenLayers.Console.warn('AnchoredBubble is deprecated'); this.padding = new OpenLayers.Bounds( 0, OpenLayers.Popup.AnchoredBubble.CORNER_SIZE, diff --git a/lib/Rico/Color.js b/lib/Rico/Color.js index 6741e7c014..12f5284f77 100644 --- a/lib/Rico/Color.js +++ b/lib/Rico/Color.js @@ -1,4 +1,5 @@ /** + * @requires OpenLayers/Console.js * @requires OpenLayers/BaseTypes/Class.js * @requires OpenLayers/BaseTypes/Element.js */ @@ -10,6 +11,9 @@ * * This file is licensed under the Apache License, Version 2.0. */ + +OpenLayers.Console.warn("OpenLayers.Rico is deprecated"); + OpenLayers.Rico = OpenLayers.Rico || {}; OpenLayers.Rico.Color = OpenLayers.Class({ diff --git a/lib/Rico/Corner.js b/lib/Rico/Corner.js index 729017b130..e5479e5b35 100644 --- a/lib/Rico/Corner.js +++ b/lib/Rico/Corner.js @@ -1,4 +1,5 @@ /** + * @requires OpenLayers/Console.js * @requires Rico/Color.js */ @@ -22,6 +23,9 @@ * permissions * and limitations under the License. * */ + +OpenLayers.Console.warn("OpenLayers.Rico is deprecated"); + OpenLayers.Rico = OpenLayers.Rico || {}; OpenLayers.Rico.Corner = { @@ -332,4 +336,4 @@ OpenLayers.Rico.Corner = { _isTopRounded: function() { return this._hasString(this.options.corners, "all", "top", "tl", "tr"); }, _isBottomRounded: function() { return this._hasString(this.options.corners, "all", "bottom", "bl", "br"); }, _hasSingleTextChild: function(el) { return el.childNodes.length == 1 && el.childNodes[0].nodeType == 3; } -}; \ No newline at end of file +}; diff --git a/tests/Control/LayerSwitcher.html b/tests/Control/LayerSwitcher.html index 7b1e56859f..47895857d2 100644 --- a/tests/Control/LayerSwitcher.html +++ b/tests/Control/LayerSwitcher.html @@ -141,7 +141,7 @@ } } - function test_Control_LayerSwitcher_ascendingw (t) { + function test_Control_LayerSwitcher_ascending (t) { t.plan( 4 ); @@ -158,10 +158,10 @@ map.addControl(control); control2 = new OpenLayers.Control.LayerSwitcher({'ascending':false}); map.addControl(control2); - t.ok(control.div.childNodes[1].childNodes[0].innerHTML.match("Base Layer"), "Base Layers first in LayerSwitcher with ascending true"); - t.ok(control.div.childNodes[1].childNodes[2].innerHTML.match("Overlays"), "Overlays in LayerSwitcher with ascending true"); - t.ok(control2.div.childNodes[1].childNodes[2].innerHTML.match("Base Layer"), "Base Layers last in LayerSwitcher with ascending false"); - t.ok(control2.div.childNodes[1].childNodes[0].innerHTML.match("Overlays"), "Base Layers last in LayerSwitcher with ascending false"); + t.ok(control.div.childNodes[0].childNodes[0].innerHTML.match("Base Layer"), "Base Layers first in LayerSwitcher with ascending true"); + t.ok(control.div.childNodes[0].childNodes[2].innerHTML.match("Overlays"), "Overlays in LayerSwitcher with ascending true"); + t.ok(control2.div.childNodes[0].childNodes[2].innerHTML.match("Base Layer"), "Base Layers last in LayerSwitcher with ascending false"); + t.ok(control2.div.childNodes[0].childNodes[0].innerHTML.match("Overlays"), "Base Layers last in LayerSwitcher with ascending false"); } function test_Control_LayerSwitcher_displayInLayerSwitcher (t) { @@ -176,7 +176,7 @@ control = new OpenLayers.Control.LayerSwitcher(); map.addControl(control); - t.eq(control.div.childNodes[1].childNodes[0].style.display, "none" , "Base layer display off when no visble base layer"); + t.eq(control.div.childNodes[0].childNodes[0].style.display, "none" , "Base layer display off when no visble base layer"); map = new OpenLayers.Map('map'); var layer = new OpenLayers.Layer.WMS("WMS", @@ -186,7 +186,7 @@ control = new OpenLayers.Control.LayerSwitcher(); map.addControl(control); - t.eq(control.div.childNodes[1].childNodes[0].style.display, "" , "Base layer display on when visble base layer"); + t.eq(control.div.childNodes[0].childNodes[0].style.display, "" , "Base layer display on when visble base layer"); } diff --git a/tests/Feature.html b/tests/Feature.html index 688642f4f5..4a50d5143a 100644 --- a/tests/Feature.html +++ b/tests/Feature.html @@ -44,7 +44,7 @@ //Safari 3 separates style overflow into overflow-x and overflow-y var prop = (OpenLayers.BROWSER_NAME == 'safari') ? 'overflowX' : 'overflow'; t.eq(popup.contentDiv.style[prop], "auto", 'overflow on popup is correct'); - t.ok( popup instanceof OpenLayers.Popup.AnchoredBubble, "popup is an AnchoredBubble by defaults"); + t.ok( popup instanceof OpenLayers.Popup.Anchored, "popup is a Popup.Anchored by default"); feature.destroyPopup(); feature.popupClass = OpenLayers.Popup.FramedCloud; diff --git a/theme/default/style.css b/theme/default/style.css index b622c766c7..c4a72b706c 100644 --- a/theme/default/style.css +++ b/theme/default/style.css @@ -318,10 +318,8 @@ div.olControlSaveFeaturesItemInactive { padding-top: 5px; padding-left: 10px; padding-bottom: 5px; - padding-right: 75px; + padding-right: 10px; background-color: darkblue; - width: 100%; - height: 100%; } .olControlLayerSwitcher .layersDiv .baseLbl,