Author:   Wolfgang <[email protected]>
Date:     Wed Mar 20 21:49:41 2013 +0100
Committer:   Wolfgang <[email protected]>
Commit-Date: Wed Mar 20 21:49:41 2013 +0100

change calculation of y coordinate / add comment chars to geomap csv config file

---

 docs/de_DE/geomap.html               |    2 ++
 docs/en_US/geomap.html               |    2 ++
 share/server/core/sources/geomap.php |    5 ++++-
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/docs/de_DE/geomap.html b/docs/de_DE/geomap.html
index 87818cd..3159b0a 100644
--- a/docs/de_DE/geomap.html
+++ b/docs/de_DE/geomap.html
@@ -57,6 +57,8 @@ muc-srv1;Munich Server1;48.1448353;11.5580067</pre>
         <p>Jede Zeile definiert einen Host, der zur Map hinzugef&uuml;gt 
werden soll. Die Spalten werden durch <code>;</code>-Zeichen
         getrennt. Die ersten Spalte enth&auml;lt den Host-Namen, die zweite 
einen optionalen Alias, die dritte die LAT-Koordinate
         (Breitengrad) und die vierte die LONG-Koordinate (L&auml;ngengrad).</p>
+        <p><font color="red">(Ab Git-Version vom 21.03.2013)</font>: Zeilen, 
die mit den &uuml;blichen Kommentarzeichen beginnen
+        (<code>;</code>, <code>#</code> oder <code>//</code>), werden als 
Kommentar behandelt.</p>
 
         <p><font color="#ff0000">Neu in 1.7.4</font>: Es ist auch 
m&ouml;glich, <code>source_type=backend</code>
         zu setzen, um das per <code>backend_id</code> eingestellte Backend 
f&uuml;r die Ermittlung der anzuzeigenden Hosts und ihrer
diff --git a/docs/en_US/geomap.html b/docs/en_US/geomap.html
index 09800c0..0a26538 100644
--- a/docs/en_US/geomap.html
+++ b/docs/en_US/geomap.html
@@ -60,6 +60,8 @@ muc-srv1;Munich Server1;48.1448353;11.5580067</pre>
         <p>Each line defines one host to be added to the map. The columns are 
separated by <code>;</code> signs.
         The first column contains the host-name, the second an optional alias, 
the third the LAT coordinate and
         the fourth the LONG coordinate.</p>
+        <p><font color="red">(starting with git-version as of 
2013-03-21)</font>: Lines starting with the usual comment characters
+        (<code>;</code>, <code>#</code>, or <code>//</code>) are treated as 
comments.</p>
 
         <p><font color="#ff0000">New in 1.7.4</font>: It is also possible to 
set <code>source_type=backend</code>
         to use the backend set via <code>backend_id</code> to gather the list 
of hosts to be shown on the geomap
diff --git a/share/server/core/sources/geomap.php 
b/share/server/core/sources/geomap.php
index aca9bc5..50ec763 100644
--- a/share/server/core/sources/geomap.php
+++ b/share/server/core/sources/geomap.php
@@ -21,6 +21,9 @@ function geomap_read_csv($p) {
         throw new GeomapError(l('Location source file "[F]" does not exist.', 
Array('F' => $f)));
 
     foreach(file($f) AS $line) {
+        // skip lines beginning with any of the usual comment characters
+        if(preg_match('/^[;#\/]',$line))
+            continue;
         $parts = explode(';', $line);
         $locations[] = array(
             'name'  => $parts[0],
@@ -351,7 +354,7 @@ function process_geomap($MAPCFG, $map_name, &$map_config) {
             continue;
 
         // Calculate the lat (y) coords
-        $obj['y'] = round($params['height'] - ($lat_para * ($obj['lat'] - 
$img_down)) - ($icon_h / 2));
+        $obj['y'] = round($lat_para * ($img_top - $obj['lat']) + ($icon_h / 
2));
         if($obj['y'] < 0)
             $obj['y'] = 0;             
         


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to