function JB_echo_map_pin_position_js($pin_x, $pin_y) { $pin_z = $pin_x + $pin_y; if (!$pin_z) { return; } $map_size = getimagesize(jb_get_map_img_path()); $pin_size = getimagesize(jb_get_pin_img_path()); $right = $map_size[0] - $pin_size[0] - $pin_x; // map_x - pin_x $bottom = $map_size[1] - $pin_y; if ($pin_y == '') { $pin_y = 0; } if ($pin_x == '') { $pin_x = 0; } ?> <img border="1" name="pin" alt="pin" src="<?php echo jb_get_pin_img_url(); ?> " <?php $size = getimagesize(jb_get_pin_img_path()); ?> width="<?php echo $size[0]; ?> " height="<?php echo $size[1]; ?> "> <script type="text/javascript"> SET_DHTML("pin"+MAXOFFLEFT+<?php echo $pin_x + $pin_size[0]; ?> +MAXOFFRIGHT+<?php echo $right; ?> +MAXOFFBOTTOM+<?php echo $bottom; ?> +MAXOFFTOP+<?php echo $pin_y; ?> +CURSOR_HAND+NO_DRAG,"map"+NO_DRAG); <?php if ($pin_x != '') { echo "dd.elements.pin.moveTo(dd.elements.map.x+{$pin_x}, dd.elements.map.y+{$pin_y}); "; } else { ?> dd.elements.pin.moveTo(dd.elements.map.x, dd.elements.map.y); <?php } ?> dd.elements.pin.setZ(dd.elements.pin.z+1); dd.elements.map.addChild("pin"); </script> <?php }
?> </td></tr></table> <?php } ################################################################ $map_size = getimagesize(jb_get_map_img_path()); $pin_size = getimagesize(jb_get_pin_img_path()); if (JB_MAP_DISABLED == "NO" && $show_map) { ?> <img border="1" name="pin" alt="pin" src="<?php echo jb_get_pin_img_url(); ?> " <?php $size = getimagesize(jb_get_pin_img_path()); ?> width="<?php echo $size[0]; ?> " height="<?php echo $size[1]; ?> "> <?php // old map system used pin_x and pin_y to save the pixel position on the map. $pin_y = $data['pin_y']; $pin_x = $data['pin_x']; $right = $map_size[0] - $pin_size[0] - $pin_x; // map_x - pin_x