svn commit: r962 - trunk/mapbender/http/javascripts/mod_setPOI2Scale.php
astrid_emde at osgeo.org
astrid_emde at osgeo.org
Wed Nov 29 08:34:12 EST 2006
Author: astrid_emde
Date: 2006-11-29 13:34:11+0000
New Revision: 962
Added:
trunk/mapbender/http/javascripts/mod_setPOI2Scale.php (contents, props changed)
Log:
new modul to open a gui and zoom to a point in a defined scale
Added: trunk/mapbender/http/javascripts/mod_setPOI2Scale.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/javascripts/mod_setPOI2Scale.php?view=auto&rev=962
==============================================================================
--- (empty file)
+++ trunk/mapbender/http/javascripts/mod_setPOI2Scale.php 2006-11-29 13:34:11+0000
@@ -0,0 +1,64 @@
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/mod_setPOI2Scale.php
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+$gui_id = $_REQUEST["gui_id"];
+include("../../conf/mapbender.conf");
+$con = db_connect($DBSERVER,$OWNER,$PW);
+db_select_db(DB,$con);
+$sql = "SELECT e_target FROM gui_element WHERE e_id = 'setPOI2Scale' AND fkey_gui_id = '".$gui_id."'";
+$res = db_query($sql);
+$cnt = 0;
+
+while($row = db_fetch_array($res)){
+ $e_target = $row["e_target"];
+ $cnt++;
+}
+if($cnt > 1){
+ echo "alert('setPOI2SCale: ID not unique!');";
+}
+echo "var mod_setPOI2Scale_target = '".$e_target."';";
+$e_id_css = 'setPOI2Scale';
+include("../include/dyn_js.php");
+
+?>
+
+try{
+ if (mod_setPOI2Scale_defScale){}
+}
+catch(e){
+ mod_setPOI2Scale_defScale = 5000;
+}
+
+mb_registerInitFunctions("mod_setPOI2Scale()");
+
+function mod_setPOI2Scale(){
+ var my_target = mod_setPOI2Scale_target.split(",");
+ var myPOI = "<?php echo $_SESSION['mb_myPOI2SCALE'] ?>";
+ if(myPOI && myPOI != ""){
+ var coord = myPOI.split(",");
+ if(coord.length == 2){
+ coord[2] = mod_setPOI2Scale_defScale;
+ }
+ for(var i=0; i<my_target.length; i++){
+ if(myPOI != ""){
+ mb_repaintScale(my_target[i], coord[0], coord[1], coord[2]);
+ }
+ }
+ }
+}
More information about the Mapbender_commits
mailing list