svn commit: r808 - trunk/mapbender/http/php/mod_meetingPoint.php

astrid_emde at osgeo.org astrid_emde at osgeo.org
Fri Oct 27 09:02:50 EDT 2006


Author: astrid_emde
Date: 2006-10-27 13:02:50+0000
New Revision: 808

Modified:
   trunk/mapbender/http/php/mod_meetingPoint.php

Log:
when a meetingPoint is set, the clickpos and text are displayed in the style which is defined in the gui

Modified: trunk/mapbender/http/php/mod_meetingPoint.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/mod_meetingPoint.php?view=diff&rev=808&p1=trunk/mapbender/http/php/mod_meetingPoint.php&p2=trunk/mapbender/http/php/mod_meetingPoint.php&r1=807&r2=808
==============================================================================
--- trunk/mapbender/http/php/mod_meetingPoint.php	(original)
+++ trunk/mapbender/http/php/mod_meetingPoint.php	2006-10-27 13:02:50+0000
@@ -93,6 +93,36 @@
 	meetingPoint_image = "../img/button_digitize/point_off.png";
 }
 
+try{
+	if (meetingPoint_icon){}
+}
+catch(e){
+	meetingPoint_icon = '../img/redball.gif';
+}
+
+try{
+	if (meetingPoint_width){}
+}
+catch(e){
+	meetingPoint_width = 20;
+}
+
+try{
+	if (meetingPoint_height){}
+}
+catch(e){
+	meetingPoint_height = 20;
+}
+
+try{
+	if (meetingPoint_style){}
+}
+catch(e){
+	meetingPoint_style = 'background-color:white;font-weight: bold;color:black;font-family:Arial;';
+}
+
+parent.mb_registerSubFunctions("window.frames['meetingPoint'].mod_meetingPoint_draw()");
+
 var ie = document.all?1:0;
 var mod_meetingPoint_win = null;
 var mod_meetingPoint_elName = "meetingPoint";
@@ -118,9 +148,7 @@
 function mod_meetingPoint_run(){   
 	parent.frames[mod_meetingPoint_target].document.onclick = mod_meetingPoint_click;
 }
-function mod_meetingPoint_disable(){
-	parent.frames[mod_meetingPoint_target].document.onclick = null;
-}
+
 function mod_meetingPoint_click(e){
 	if(ie){
 		clickX = parent.frames[mod_meetingPoint_target].event.clientX;
@@ -134,26 +162,35 @@
 	var pos = parent.makeClickPos2RealWorldPos(mod_meetingPoint_target, clickX, clickY);
     
 	mod_meetingPoint_write(pos[0],pos[1]);
-	mod_meetingPoint_disable();
-	
-}
-function mod_meetingPoint_display(e){
-	if(ie){
-		clickX = parent.frames[mod_meetingPoint_target].event.clientX;
-		clickY = parent.frames[mod_meetingPoint_target].event.clientY;
-
-	}
-	else{
-		clickX = e.pageX;
-		clickY = e.pageY;
-	}
-	var pos = makeClickPos2RealWorldPos(mod_meetingPoint_target, clickX, clickY);
+	mod_meetingPoint_draw();	
 }
 
 function mod_meetingPoint_write(x,y){	
    document.forms[0].x.value =x;
    document.forms[0].y.value =y;	   
 }
+
+function mod_meetingPoint_hide(){
+	var ind = parent.getMapObjIndexByName(mod_meetingPoint_target);
+	parent.frames[mod_meetingPoint_target].document.getElementById('permanent').style.visibility = 'hidden';
+}
+
+function mod_meetingPoint_draw(){
+	var ind = parent.getMapObjIndexByName(mod_meetingPoint_target);
+	//alert(document.forms[0].x.value +" -- "+ document.forms[0].y.value + " - " + parent.mb_mapObj[ind].width +" iii: "+ ind);
+	parent.frames[mod_meetingPoint_target].document.getElementById('permanent').style.width = parent.mb_mapObj[ind].width;
+	parent.frames[mod_meetingPoint_target].document.getElementById('permanent').style.height = parent.mb_mapObj[ind].height;
+	parent.frames[mod_meetingPoint_target].document.getElementById('permanent').style.top = 0;
+	parent.frames[mod_meetingPoint_target].document.getElementById('permanent').style.left = 0;
+	parent.frames[mod_meetingPoint_target].document.getElementById('permanent').style.visibility = 'visible';
+	var tagSource = "";
+	var pos = parent.makeRealWorld2mapPos(mod_meetingPoint_target,document.forms[0].x.value, document.forms[0].y.value);
+	tagSource += "<div style='position:absolute;left:"+(pos[0]- meetingPoint_width)+"px;top:"+(pos[1]-meetingPoint_height)+"px'>";
+	tagSource += "<img src='"+meetingPoint_icon+"'>";
+	tagSource += "<span style='"+meetingPoint_style+"'>"+document.forms[0].mytext.value+"<span>";
+	tagSource += "</div>";
+    parent.writeTag(mod_meetingPoint_target, "permanent", tagSource);
+}
 -->
 </script>
 
@@ -216,6 +253,7 @@
 	document.forms[0].mytext.value ='';
 	document.forms[0].x.value ='';
 	document.forms[0].y.value =  '';
+	 mod_meetingPoint_hide();
 }
 
 function createEmail (url,subject) {
@@ -254,15 +292,15 @@
 <input class='strinput' type="hidden" name='myuser' value='<?php  echo $_SESSION["mb_user_name"];  ?>'>
 
 <input class='strinput' type="hidden" name='mypw' value='<?php  echo $_SESSION["mb_user_password"];  ?>'>
-Text :<br>
+<br>
 <!--<input class='strinput' type="textarea" size=2 name='mytext' value='' "maxlength=70" title="max. 70 Zeichen">-->
-<textarea rows="3" name='mytext' value='huhu' title="max. 70 Zeichen"></textarea>
+<textarea rows="3" name='mytext' title="max. 70 Zeichen"></textarea>
 <br>
 <input class="okbutton" name="Send"   type="button" value="ok" onclick="validate();">
 <input class="ibutton" type="button" value="cancel" onClick="emptyfields();">
 <br>
-<input class="coord" type="hidden" name='x' value='' readonly>
-<input class="coord" type="hidden" name='y' value='' readonly>
+<input class="coord" type="text" name='x' value='' readonly>
+<input class="coord" type="text" name='y' value='' readonly>
 <br>
 </form>
 </body>




More information about the Mapbender_commits mailing list