<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
I'm trying to convert a geopoint into an image coordinate so I can place images on a floating div over a map.<br><br>I know how to go from image points to geo points and figured that just reversing the process was the way to go back. Apparently it is not.<br><br>Here is what I was trying:<br><br><?php<br>$minx_geo = 2422041.973271;<br>$miny_geo = 654245.367973;<br>$maxx_geo = 2565405;<br>$maxy_geo = 781169.610946;<br><br>$minx_img = 0;<br>$miny_img = 0;<br>$maxy_img = 200;<br>$maxx_img = 300;<br><br>$mapwidth = 300;<br>$mapheight = 200;<br><br>$xdelta_geo = $maxx_geo - $minx_geo;<br>$ydelta_geo = $maxy_geo - $miny_geo;<br><br>$xdelta_img = $maxx_img - $minx_img;<br>$ydelta_img = $maxy_img - $miny_img;<br><br>$x_pix = 150;<br>$y_pix = 100;<br><br>// Calculate the image coords to map extents<br>$x_geo = $minx_geo + (($x_pix/$mapwidth) * $xdelta_geo);<br>$y_geo = $maxy_geo - (($y_pix/$mapheight) * $ydelta_geo);<br><br>// Calculate map points to image coords<br>$x_img = $minx_img + (($x_geo/$mapwidth) * $xdelta_img);<br>$y_img = $maxy_img - (($y_geo/$mapheight) * $ydelta_img);<br><br>print "$x_geo $y_geo\n";<br>print "$x_img $y_img\n";<br><br>I'm math challenged so this probably is easier than it seems but I'm not groking it. <br><br>Thanks very much for any assistance.<br><br>Gail<br>?><br><br>--<br>Things are only difficult while you don't understand them.<br /><hr />Use video conversation to talk face-to-face with Windows Live Messenger. <a href='http://www.windowslive.com/messenger/connect_your_way.html?ocid=TXT_TAGLM_WL_Refresh_messenger_video_072008' target='_new'>Get started.</a></body>
</html>