Exemple #1
0
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 
}
}
$DynamicForm->display_form_section($mode, 2, $admin);
?>
</td>
				<?php 
if (JB_MAP_DISABLED == 'GMAP') {
    echo '<td valign="top">';
    $DynamicForm->display_form_section($mode, 4, $admin);
    echo '</td>';
} elseif (JB_MAP_DISABLED != 'YES') {
    ?>
			<td valign="top"><img  border="0" id="map" name="map" alt="map" src="<?php 
    echo jb_get_map_img_url();
    ?>
"  <?php 
    $size = getimagesize(jb_get_map_img_path());
    ?>
 width="<?php 
    echo $size[0];
    ?>
" height="<?php 
    echo $size[1];
    ?>
"></td>
				<?php 
}
?>
		
		</tr>
		<tr>