[Mapbender-commits] r4089 - in trunk/mapbender: core http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jun 23 11:37:08 EDT 2009


Author: verenadiewald
Date: 2009-06-23 11:37:08 -0400 (Tue, 23 Jun 2009)
New Revision: 4089

Modified:
   trunk/mapbender/core/system.php
   trunk/mapbender/http/javascripts/mod_zoomCoords.php
Log:
Mapbender API

Modified: trunk/mapbender/core/system.php
===================================================================
--- trunk/mapbender/core/system.php	2009-06-23 10:57:59 UTC (rev 4088)
+++ trunk/mapbender/core/system.php	2009-06-23 15:37:08 UTC (rev 4089)
@@ -36,9 +36,9 @@
 
 define("ZOOM_MOUSEWHEEL", "1.1");
 
-define("MODULES_NOT_RELYING_ON_GLOBALS", 
-	"mapframe1,featureInfo1,gazetteerWFS,back,forward,zoomFull,zoomIn1," . 
-	"zoomOut1,selArea1,pan1,copyright,dependentDiv,dragMapSize," . 
-	"dynamicOverview,FeatureInfoRedirect,highlightPOI,navFrame,sandclock," . 
+define("MODULES_NOT_RELYING_ON_GLOBALS",
+	"mapframe1,featureInfo1,gazetteerWFS,back,forward,zoomCoords,zoomFull,zoomIn1," .
+	"zoomOut1,selArea1,pan1,copyright,dependentDiv,dragMapSize," .
+	"dynamicOverview,FeatureInfoRedirect,highlightPOI,navFrame,sandclock," .
 	"scaleBar,scaleSelect,setBBOX,setPOI2Scale,reload,overview"
 );

Modified: trunk/mapbender/http/javascripts/mod_zoomCoords.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_zoomCoords.php	2009-06-23 10:57:59 UTC (rev 4088)
+++ trunk/mapbender/http/javascripts/mod_zoomCoords.php	2009-06-23 15:37:08 UTC (rev 4089)
@@ -1,7 +1,7 @@
 <?php
 #$Id$
 # http://www.mapbender.org/Mapbender_without_iframes
-# Copyright (C) 2002 CCGIS 
+# Copyright (C) 2002 CCGIS
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,50 +18,46 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
-include(dirname(__FILE__)."/../include/dyn_js.php");
 ?>
+var mod_zoomCoords_target = options.target;
 try{
-	if (zoomCoords_permanentHighlight){}
+	if (options.zoomCoords_permanentHighlight){}
 }
 catch(e){
-	zoomCoords_permanentHighlight = 'false';
+	options.zoomCoords_permanentHighlight = 'false';
 }
 
-var mod_zoomCoords_target = '<?php echo $e_target[0];?>';
-mod_zoomCoords_target = mod_zoomCoords_target.split(',');
-
-function zoomCoordinate(x,y){
+function zoomCoordinate (x,y) {
    x=x.replace(",",".");
    y=y.replace(",",".");
-   
+
    document.zoomCoordsForm.X.value=x;
    document.zoomCoordsForm.Y.value=y;
-	  
-   if (isNaN(x)==true || isNaN(y)==true){
+
+   if (isNaN(x)==true || isNaN(y)==true) {
        alert ("<?php echo _mb("Please type a number.");?>");
-   }else{
-   
-	   if(zoomCoords_permanentHighlight =='true'){
+   }
+   else {
+	   if(options.zoomCoords_permanentHighlight =='true'){
 		   setPermanentMarker(x,y);
 	   }
-  		hideHighlight()
-      	zoom(mod_zoomCoords_target[0],true, 1.0,x,y);
+  		hideHighlight();
+      	Mapbender.Modules[mod_zoomCoords_target[0]].zoom(true, 1.0, x, y);
    }
 }
 
 function highlight(x, y){
-	if(x!='' && y!=''){   
+	if (x!='' && y!='') {
 	   x=x.replace(",",".");
 	   y=y.replace(",",".");
-	   
+
 	   document.zoomCoordsForm.X.value=x;
 	   document.zoomCoordsForm.Y.value=y;
-	  
-	   
-	   if (isNaN(x)==true || isNaN(y)==true){
-	     
+
+	   if (isNaN(x)==true || isNaN(y)==true) {
+
 	   }
-	   else{
+	   else {
 			for(var i=0;i<mod_zoomCoords_target.length;i++){
 				mb_showHighlight(mod_zoomCoords_target[i],x,y);
 			}
@@ -80,28 +76,34 @@
  	mod_permanentHighlight_x = parseFloat(x);
    	mod_permanentHighlight_y = parseFloat(y);
    	mod_permanentHighlight_text = x + ' / '+ y;
-  
+
    	mod_permanentHighlight_init();
 }
 
-parent.eventInitMap.register(function zoomCoorsInit(){
-	var el = document.getElementById("zoomCoords");
-	if(el){
-		el.innerHTML="<?php
-echo "<form style='font-family : Arial, Helvetica, sans-serif;font-size: 11px;' name='zoomCoordsForm' action='" . $PHP_SELF . "?".SID."' method='post'>";
-#coordinates
-   
-   # Deutsche Version
+parent.eventInitMap.register(function zoomCoordsInit(){
+	if($(this)){
+		$("<form />").attr({"id":"zoomCoordsForm","name":"zoomCoordsForm","method":"post"}).appendTo($("#zoomCoords"));
+		$("<span />").attr({"id":"spanLon","name":"spanLon"}).appendTo($("#zoomCoordsForm"));
+		$("<span />").attr({"id":"spanLat","name":"spanLat"}).appendTo($("#zoomCoordsForm"));
+		$("<input type='text'/>").attr({"id":"fieldX","name":"X"}).appendTo($("#zoomCoordsForm"));
+		$("<input type='text'/>").attr({"id":"fieldY","name":"Y"}).appendTo($("#zoomCoordsForm"));
+		$("<input type='button'/>").attr({"id":"buttonZoomCoord","name":"buttonZoomCoord","value":"<?php echo _mb("ok"); ?>"}).appendTo($("#zoomCoordsForm"));
 
-   # English Version
-      echo "<span style='position: absolute;left: 5px;top:5px;color: Gray;'>"._mb("Longitude").":</span>";
-      echo "<span style='position: absolute;left: 80px;top:5px;color: Gray;'>"._mb("Latitude").":</span>";
-      echo "<input style='position: absolute;left:5px;top:20px;color: Gray;width:65px;border: solid thin;height:20px;' type='text' name='X'>";
-      echo "<input style='position: absolute;left:80px;top:20px;color: Gray;width:65px;border: solid thin;height:20px;'class='texty' type='text' name='Y'>";
-      echo "<input style='position: absolute;left:150px;top:20px;color: Gray;border: solid thin;height:20px;' type='button' value='"._mb("ok")."' onclick='zoomCoordinate(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value); highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseover='highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' onmouseout='hideHighlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value)' >";
+		$("#zoomCoordsForm").css({"font-family":"Arial, Helvetica, sans-serif","font-size":"11px"});
+		$("#spanLon").css({"position":"absolute","left":"5px","top":"5px","color":"Gray"}).text("<?php echo _mb("Longitude");?>");
+		$("#spanLat").css({"position":"absolute","left":"80px","top":"5px","color":"Gray"}).text("<?php echo _mb("Latitude");?>");
+		$("#fieldX").css({"position":"absolute","left":"5px","top":"20px","color":"Gray","width":"65px","border":"solid thin","height":"20px"});
+		$("#fieldY").css({"position":"absolute","left":"80px","top":"20px","color":"Gray","width":"65px","border":"solid thin","height":"20px"});
+		$("#buttonZoomCoord").css({"position":"absolute","left":"150px","top":"20px","color":"Gray","border":"solid thin","height":"20px"});
 
-echo "</form>";
-?>";
+		$("#buttonZoomCoord").click(function () {
+			zoomCoordinate(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value);
+			highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value);
+		}).mouseover(function () {
+			highlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value);
+		}).mouseout(function () {
+			hideHighlight(document.zoomCoordsForm.X.value, document.zoomCoordsForm.Y.value);
+		});
+
 	}
-});
-
+});
\ No newline at end of file



More information about the Mapbender_commits mailing list