Ad Widget

Collapse

PATCH: [1.1.6] Map Icon's Coordinates are clickable on map image and centered

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dan.searle
    Junior Member
    • Mar 2007
    • 13

    #1

    PATCH: [1.1.6] Map Icon's Coordinates are clickable on map image and centered

    I've hacked at my Zabbix 1.1.6 to allow you to click on the map image when adding or updating elements. This makes adding or updating the positions of elements much much quicker and easier. I've tested the javascript in Firefox 2 and IE6 both seem to work well. One other tweek which helps I think is that I've made the elements icons render so that the coordinate corresponds to the center of the icon, rather than the top left of the icon.

    So, you probably don't want to apply this patch to an existing zabbix database, or all you map ellements will be shifted slightly off their current positions.

    I hope this helps someone else, Dan...
    Attached Files
  • inko_nick
    Junior Member
    • Mar 2007
    • 12

    #2
    ThankU

    Thanx! Good Work

    Comment

    • Vince2
      Member
      • Oct 2006
      • 40

      #3
      Originally posted by dan.searle
      I've hacked at my Zabbix 1.1.6 to allow you to click on the map image when adding or updating elements. This makes adding or updating the positions of elements much much quicker and easier. I've tested the javascript in Firefox 2 and IE6 both seem to work well. One other tweek which helps I think is that I've made the elements icons render so that the coordinate corresponds to the center of the icon, rather than the top left of the icon.

      So, you probably don't want to apply this patch to an existing zabbix database, or all you map ellements will be shifted slightly off their current positions.

      I hope this helps someone else, Dan...
      Great patch ! Thanks !

      Comment

      • pesadilla
        Member
        • Nov 2006
        • 69

        #4
        excelent, maps would be more easy

        Comment

        • Vince2
          Member
          • Oct 2006
          • 40

          #5
          You forgot to center clickable zones. Here is a patch for that.

          Code:
          Index: frontends/php/include/maps.inc.php
          ===================================================================
          --- frontends/php/include/maps.inc.php	(révision 41)
          +++ frontends/php/include/maps.inc.php	(copie de travail)
          @@ -397,10 +392,10 @@
           			$back = get_png_by_selementid($db_element["selementid"]);
           			if(!$back)	continue;
           
          -			$x1_		= $db_element["x"];
          -			$y1_		= $db_element["y"];
          -			$x2_		= $db_element["x"] + imagesx($back);
          -			$y2_		= $db_element["y"] + imagesy($back);
          +			$x1_		= $db_element["x"] - imagesx($back)/2;
          +			$y1_		= $db_element["y"] - imagesy($back)/2;
          +			$x2_		= $db_element["x"] + imagesx($back)/2;
          +			$y2_		= $db_element["y"] + imagesy($back)/2;
           
           			$action_map->AddRectArea($x1_,$y1_,$x2_,$y2_, $url, $alt);
           		}

          Comment

          • masterblue
            Junior Member
            • May 2007
            • 1

            #6
            A little error

            I installed your patch and detected a small error: when I added one connection between two components, these connetion appeared outside of the place.

            To fix this bug I created this patch
            Attached Files

            Comment

            Working...