Permalink
Browse files

FIX: Fixed broken worldmap when using relative objects

  • Loading branch information...
LarsMichelsen committed Jan 7, 2018
1 parent 95d627d commit 6abc2b6f0e71159c1a2f6eed23533ebdbb6a0b78
Showing with 5 additions and 3 deletions.
  1. +1 −0 ChangeLog
  2. +2 −1 share/frontend/nagvis-js/js/nagvis.js
  3. +2 −2 share/server/core/sources/worldmap.php
View
@@ -6,6 +6,7 @@ Frontend:
Worldmap:
* FIX: Fixed errors when saving viewport as new map
* FIX: Fixed rare issue when cloning just added objects
* FIX: Fixed broken worldmap when using relative objects
Installer:
* FIX: Fixed displaying wrong backend option "-b" in summary output
@@ -1151,7 +1151,8 @@ function pxToInt(v) {
// san francisco and zooming to new your will lead to a negative 5 digit
// negative coord).
function isRelativeCoord(v) {
return isset(v) && ((!isInt(v) && !isFloat(v)) || (v.length === 6 && v.charAt(0) != "-"));
return isset(v) && ((!isInt(v) && !isFloat(v))
|| (v.length === 6 && v.charAt(0) != "-" && v.indexOf(".") == -1));
}
// Helper function to determine the number of entries in an object
@@ -184,12 +184,12 @@ function worldmap_get_objects_by_bounds($sw_lng, $sw_lat, $ne_lng, $ne_lat) {
// When an object has relative coordinates also fetch the referenced object
if ($referenced) {
$keys = array_keys($referenced);
$keys = array_unique(array_keys($referenced));
$count = count($keys);
$oids = array();
$filter = array();
for ($i = 1; $i <= $count; $i++) {
$id = "o$i";
$id = ":o$i";
$oids[] = $id;
$filter[$id] = $keys[$i - 1];
}

0 comments on commit 6abc2b6

Please sign in to comment.