Changeset 343
- Timestamp:
- 05/24/06 20:54:45 (3 years ago)
- Files:
-
- trunk/openlayers/lib/OpenLayers/Popup/Anchored.js (modified) (2 diffs)
- trunk/openlayers/lib/OpenLayers/Util.js (modified) (1 diff)
- trunk/openlayers/tests/test_Bounds.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/openlayers/lib/OpenLayers/Popup/Anchored.js
r342 r343 62 62 var quadrant = extent.determineQuadrant(lonlat); 63 63 64 return this.oppositeQuadrant(quadrant);64 return OpenLayers.Bounds.oppositeQuadrant(quadrant); 65 65 }, 66 66 … … 98 98 }, 99 99 100 /**101 * @private102 *103 * @param {String} quadrant104 *105 * @returns The opposing quadrant ("br" "tr" "tl" "bl"). For Example, if106 * you pass in "bl" it returns "tr", if you pass in "br" it107 * returns "tl", etc.108 * @type String109 */110 oppositeQuadrant: function(quadrant) {111 var opp = "";112 113 opp += (quadrant.charAt(0) == 't') ? 'b' : 't';114 opp += (quadrant.charAt(1) == 'l') ? 'r' : 'l';115 116 return opp;117 },118 119 100 CLASS_NAME: "OpenLayers.Popup.Anchored" 120 101 }); trunk/openlayers/lib/OpenLayers/Util.js
r334 r343 455 455 456 456 457 /** 458 * @param {String} quadrant 459 * 460 * @returns The opposing quadrant ("br" "tr" "tl" "bl"). For Example, if 461 * you pass in "bl" it returns "tr", if you pass in "br" it 462 * returns "tl", etc. 463 * @type String 464 */ 465 OpenLayers.Bounds.oppositeQuadrant = function(quadrant) { 466 var opp = ""; 467 468 opp += (quadrant.charAt(0) == 't') ? 'b' : 't'; 469 opp += (quadrant.charAt(1) == 'l') ? 'r' : 'l'; 470 471 return opp; 472 }; 457 473 458 474 // Some other helpful things trunk/openlayers/tests/test_Bounds.html
r334 r343 155 155 t.eq( bounds.determineQuadrant(br), "br", "bounds.determineQuadrant correctly identifies a coordinate in the bottom right quadrant"); 156 156 } 157 157 158 function test_10_Bounds_oppositeQuadrant(t) { 159 160 t.plan( 4 ); 161 162 t.eq( OpenLayers.Bounds.oppositeQuadrant("tl"), "br", "OpenLayers.Bounds.oppositeQuadrant returns 'br' for 'tl'"); 163 t.eq( OpenLayers.Bounds.oppositeQuadrant("tr"), "bl", "OpenLayers.Bounds.oppositeQuadrant returns 'bl' for 'tr'"); 164 t.eq( OpenLayers.Bounds.oppositeQuadrant("bl"), "tr", "OpenLayers.Bounds.oppositeQuadrant returns 'tr' for 'bl'"); 165 t.eq( OpenLayers.Bounds.oppositeQuadrant("br"), "tl", "OpenLayers.Bounds.oppositeQuadrant returns 'tl' for 'br'"); 166 } 158 167 // --> 159 168 </script>
