function convert_coords($lat, $lon)
{
$width = 1281;
$height = 1529;
$westLong = -75.196438;
$eastLong = -74.674072;
$northLat = 41.377581;
$southLat = 40.909232;
$lat = $lat;
$lon = $lon;
$x = $width * (($westLong-$lon)/($westLong-$eastLong));
$y = ($height * (($northLat-$lat)/($northLat-$southLat)));
echo $x."<br />";
echo $y;
}
This is what I was trying to get started. I think this is a variation of something that I shot here, but it does not give me the results that I need. I really ran into a brick wall with this bad. And there is no way on earth, I'm going to figure out the math here on my own, I tried and this is the way out of my league.
source
share