[Mapbender-commits] r6651 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jul 29 09:12:06 EDT 2010


Author: christoph
Date: 2010-07-29 13:12:06 +0000 (Thu, 29 Jul 2010)
New Revision: 6651

Modified:
   trunk/mapbender/http/javascripts/mod_featureInfo.php
Log:
Use jQuery mouse events

Modified: trunk/mapbender/http/javascripts/mod_featureInfo.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_featureInfo.php	2010-07-29 07:30:16 UTC (rev 6650)
+++ trunk/mapbender/http/javascripts/mod_featureInfo.php	2010-07-29 13:12:06 UTC (rev 6651)
@@ -61,15 +61,23 @@
 	});
 });
 function mod_featureInfo_click(){   
-	mod_featureInfo_mapObj.getDomElement().onclick = mod_featureInfo_event;
-	mod_featureInfo_mapObj.getDomElement().style.cursor = "help";
+	var el = mod_featureInfo_mapObj.getDomElement();
+	
+	if (el) {
+		$(el).bind("click", mod_featureInfo_event)
+			.css("cursor", "help");
+	}
 }
 function mod_featureInfo_disable(){
-	mod_featureInfo_mapObj.getDomElement().onclick = null;
-	mod_featureInfo_mapObj.getDomElement().style.cursor = "default";
+	var el = mod_featureInfo_mapObj.getDomElement();
+
+	if (el) {
+		$(el).unbind("click", mod_featureInfo_event)
+			.css("cursor", "default");
+	}
 }
 function mod_featureInfo_event(e){
-	var point = mod_featureInfo_mapObj.getMousePos(e);
+	var point = mod_featureInfo_mapObj.getMousePosition(e);
 	
 	eventBeforeFeatureInfo.trigger({"fName":mod_featureInfo_target});
 	
@@ -87,7 +95,7 @@
 		if(urls){
 			for(var i=0;i<urls.length;i++){
 				if(featureInfoLayerPopup == 'true'){
-					$("<iframe id='featureInfo_"+ i + "' title='<?php echo _mb("Information");?>' src='" + urls[i] + "'></iframe>").dialog({
+					$("<div><iframe frameborder='0' height='100%' width='100%' id='featureInfo_"+ i + "' title='<?php echo _mb("Information");?>' src='" + urls[i] + "'></iframe></div>").dialog({
 						bgiframe: true,
 						autoOpen: true,
 						modal: false,
@@ -108,5 +116,5 @@
 		else
 			alert(unescape("Please select a layer! \n Bitte waehlen Sie eine Ebene zur Abfrage aus!"));
 	}
-	setFeatureInfoRequest(mod_featureInfo_target,clickX,clickY);
+	setFeatureInfoRequest(mod_featureInfo_target,point.x,point.y);
 }



More information about the Mapbender_commits mailing list