Location: PHPKode > projects > jjfmapper > jjfmapper/examples/hyperlinked_dots/index.php
<?php
        $topoffset=100;
        $leftoffset=100;
//      $dotfile='bluedot.png';
//      $d=imagecreatefrompng($dotfile);
//      $dotwidth=imagesx($d);
//      $dotheight=imagesy($d);
//      imagedestroy($d);
        include ('config.php');
?>
<html>
<head>
        <title>Map with linked dots</title>
<style>
body {
}
img#map {
        position: absolute;
        top: <?php echo($topoffset); ?>px;
        left: <?php echo($leftoffset); ?>px;
        z-index: 1;
        border: solid 1px black;
}
img.dot {
        z-index: 2;
        position: absolute;
        border: 0;
}
</style>
</head>
<body>


<img id="map" src="map.php">


<?php
        include('../../jjfmapper-web.php');
        $map=new jjfMapper($mapconfigstring);
        
        $mydots = array(0 => array(42.99453,-85.58347),
                                        1 => array(42.99453,-85.58347),
                                        2 => array(42.91085,-85.37963),
                                        3 => array(42.98233,-85.32945),
                                        4 => array(42.43043,-83.52175),
                                        5 => array(42.479916,-83.47125));
        foreach ($mydots as $num => $coords) {
                list($x,$y) = $map->projection->TranslateXY($coords[1],$coords[0]);
                placedot($num,$x,$y);
        }
        
        function placedot($num,$x,$y) {
                global $topoffset;
                global $leftoffset;
                global $dotwidth;
                global $dotheight;
                echo("<a href=\"\"><img class=\"dot\" alt=\"Dot #$num\" src=\"../../lib/built_in_icons.php?make=dot:00f\" ".
                        "style='top: ". ($y+$topoffset-floor($dotheight/2)) ."px; left: ". ($x+$leftoffset-floor($dotwidth/2)) ."px;'/></a>\n");
        }
        
?>


</body>
</html>


Return current item: jjfmapper