[Mapbender-commits] r3909 - branches/2.6/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Apr 28 04:18:03 EDT 2009


Author: astrid_emde
Date: 2009-04-28 04:18:02 -0400 (Tue, 28 Apr 2009)
New Revision: 3909

Modified:
   branches/2.6/lib/basic.js
Log:
showHighlight hideHighlight - map div

Modified: branches/2.6/lib/basic.js
===================================================================
--- branches/2.6/lib/basic.js	2009-04-28 07:45:23 UTC (rev 3908)
+++ branches/2.6/lib/basic.js	2009-04-28 08:18:02 UTC (rev 3909)
@@ -36,15 +36,29 @@
 }
 
 function mb_showHighlight(frameName,x,y){
-   var pos = makeRealWorld2mapPos(frameName,x, y);
-//TODO frame des Mapobjekts frameName nehmen
-   mb_arrangeElement(frameName,"highlight",pos[0]-7, pos[1]-7);
-   window.frames[frameName].document.getElementById("highlight").style.visibility = 'visible';
+	var map = getMapObjByName(frameName);
+	if (map !== null) {
+		var p = map.convertRealToPixel(new Point(x, y));
+		
+		var map_el = map.getDomElement();
+		var $highlight = $("#" + map.elementName + "_highlight");
+		if($highlight.size() === 0) {
+			//create Box Elements
+			$highlight = $("<div id='" + map.elementName+ "_highlight' style='position:absolute;top:-10px;left:-10px;width:14px;height:14px;z-index:3;visibility:visible'><img src='../img/redball.gif'/></div>");
+			$(map_el).append($highlight);
+		}
+		$highlight.css("visibility", "visible");
+	}
+	mb_arrangeElement(map.frameName, map.elementName+ "_highlight" ,p.x-7, p.y-7);
 }
+
 function mb_hideHighlight(frameName){
-   mb_arrangeElement(frameName,"highlight",-20, -20);
-   mb_arrangeElement(frameName,"highlight",-20, -20);
-   window.frames[frameName].document.getElementById("highlight").style.visibility = 'hidden';
+	var map = getMapObjByName(frameName);
+	if (map !== null) {
+		var map_el = map.getDomElement();
+		mb_arrangeElement(map.frameName, map.elementName + "_highlight", -20, -20);
+		$(map.elementName + "_highlight").css("visibility", "hidden");
+	}
 }
 
 function cloneObject (p, c) {



More information about the Mapbender_commits mailing list