moved oppositeQuadrant() function from Anchored.js to Util.js, where it is now a static function on the OpenLayers.Bounds class. Updated usage in code accordingly. Added test.

git-svn-id: http://svn.openlayers.org/trunk/openlayers@343 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-05-25 00:54:45 +00:00
parent cfe9479a89
commit 022ffde95e
3 changed files with 27 additions and 21 deletions

View File

@@ -61,7 +61,7 @@ OpenLayers.Popup.Anchored.prototype =
var extent = this.map.getExtent();
var quadrant = extent.determineQuadrant(lonlat);
return this.oppositeQuadrant(quadrant);
return OpenLayers.Bounds.oppositeQuadrant(quadrant);
},
/**
@@ -97,24 +97,5 @@ OpenLayers.Popup.Anchored.prototype =
return newPx;
},
/**
* @private
*
* @param {String} quadrant
*
* @returns The opposing quadrant ("br" "tr" "tl" "bl"). For Example, if
* you pass in "bl" it returns "tr", if you pass in "br" it
* returns "tl", etc.
* @type String
*/
oppositeQuadrant: function(quadrant) {
var opp = "";
opp += (quadrant.charAt(0) == 't') ? 'b' : 't';
opp += (quadrant.charAt(1) == 'l') ? 'r' : 'l';
return opp;
},
CLASS_NAME: "OpenLayers.Popup.Anchored"
});