[fusion-commits] r1460 - trunk/widgets
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Wed Aug 13 13:57:40 EDT 2008
Author: madair
Date: 2008-08-13 13:57:40 -0400 (Wed, 13 Aug 2008)
New Revision: 1460
Modified:
trunk/widgets/Maptip.js
Log:
closes #103: maptip position now depends on which map quadrant the mouse is in
Modified: trunk/widgets/Maptip.js
===================================================================
--- trunk/widgets/Maptip.js 2008-08-13 17:34:30 UTC (rev 1459)
+++ trunk/widgets/Maptip.js 2008-08-13 17:57:40 UTC (rev 1460)
@@ -210,11 +210,20 @@
empty = false;
}
if (!empty) {
+ var mapSize = this.getMap().getSize();
+ var size = Element.getDimensions(this.domObj);
+ if (this.oCurrentPosition.x < mapSize.w/2) {
+ this.domObj.style.left = (this.oMapTipPosition.x) + 'px';
+ } else {
+ this.domObj.style.left = (this.oMapTipPosition.x - size.width) + 'px';
+ }
+ if (this.oCurrentPosition.y < mapSize.h/2) {
+ this.domObj.style.top = (this.oMapTipPosition.y) + 'px';
+ } else {
+ this.domObj.style.top = (this.oMapTipPosition.y - size.height) + 'px';
+ }
this.domObj.style.visibility = 'hidden';
this.domObj.style.display = 'block';
- var size = Element.getDimensions(this.domObj);
- this.domObj.style.top = (this.oMapTipPosition.y - size.height) + 'px';
- this.domObj.style.left = (this.oMapTipPosition.x) + 'px';
if (!window.opera) {
contentDiv.appendChild(this.iframe);
More information about the fusion-commits
mailing list