Author:   Lars Michelsen <[email protected]>
Date:     Wed Jun 27 14:14:04 2012 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Wed Jun 27 14:14:04 2012 +0200

Bugfix: Geomap allows placing only one host on the geomap now (Added 
geomap_border option)

---

 ChangeLog                            |    1 +
 docs/en_US/geomap.html               |    6 ++++++
 share/server/core/sources/geomap.php |   12 ++++++++++++
 3 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e12f411..f0de31b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@ Core
   * Bugfix: Map configs can be edited using the GUI even in case of source 
errors
   * Bugfix: Fixed re-rendering of geomaps after map source changes
   * Bugfix: Fixed re-fetching of background image after changed geomap source 
file
+  * Bugfix: Geomap allows placing only one host on the geomap now (Added 
geomap_border option)
 
 Frontend
   * Added new map config option (global section) event_on_load to raise 
frontend events
diff --git a/docs/en_US/geomap.html b/docs/en_US/geomap.html
index 0fa535f..f625f65 100644
--- a/docs/en_US/geomap.html
+++ b/docs/en_US/geomap.html
@@ -75,6 +75,12 @@ muc-srv1;Munich Server1;48.1448353;11.5580067</pre>
                 Take a look at the <a href="">OSM zoom documentation</a> for 
further details.</td>
         </tr>
         <tr>
+            <td>geomap_border</td>
+            <td>0.25</td>
+            <td>The border to add on each side of the geomap. This value is 
simply added to the
+                calculated min/max geo coordinates.</td>
+        </tr>
+        <tr>
             <td>source_file</td>
             <td></td>
             <td>The name of the file CSV file to use as source for rendering 
the geomap.</td>
diff --git a/share/server/core/sources/geomap.php 
b/share/server/core/sources/geomap.php
index d060f28..fd6e472 100644
--- a/share/server/core/sources/geomap.php
+++ b/share/server/core/sources/geomap.php
@@ -73,6 +73,7 @@ $viewParams = array(
     'geomap' => array(
         'geomap_type',
         'geomap_zoom',
+        'geomap_border',
         'source_file',
     )
 );
@@ -99,6 +100,11 @@ $configVars = array(
         'field_type' => 'dropdown',
         'list'       => 'list_geomap_source_files',
     ),
+    'geomap_border' => Array(
+        'must'       => false,
+        'default'    => 0.25,
+        'match'      => MATCH_FLOAT,
+    ),
 );
 
 function geomap_files($params) {
@@ -179,6 +185,12 @@ function process_geomap($MAPCFG, $map_name, &$map_config) {
             $max_long = $obj['long'];
     }
 
+    // Fix equal coordinates (Simply add some space on all sides)
+    $min_lat  -= $params['geomap_border'];
+    $max_lat  += $params['geomap_border'];
+    $min_long -= $params['geomap_border'];
+    $max_long += $params['geomap_border'];
+
     // FIXME: Too small min/max? What is the minimum bbox size?
 
     $mid_lat  = $min_lat  + ($max_lat - $min_lat) / 2;


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to