OT for html
Thibault said:
"Dave Patton" a écrit dans le message news:
I really like this project ! It seems really bizarre, but how fun !
Unfortunately, there is no confluence left in my area (centre of France) ....
That's a nice idea. CSSP works in browsers dating back to NS4 and IE3
though.
Yes, but I don't want to use GD. But I have succeed in doing my map with
points and background image and all. Neverthemore, I still have a problem,
and it seems that you could help me when I see what you did on confluence
website. Here it is : I can't find a formula to change longitude and
latitude in pixels number, according to the size of my map. Some points are
in the correct place, but most are not.
Let's just toss aside different mapping systems for the time being. Miles
between differing longitudes are greater at the equator than at the poles. O
miles at poles, 69 miles/degree at equator.
This is perl, php will be similar
sub convertToMiles{
($lat1, $lon1, $lat2, $lon2)=@_;
$dist = acos(sin(deg2rad($lat1)) * sin(deg2rad($lat2)) +
cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($lon1 - $lon2)));
$dist = rad2deg($dist);
return my $miles = $dist * 69;
}
sub deg2rad{
my $deg=shift;
return (2 * $pi *$deg/360);
}
sub rad2deg{
my $rad=shift;
return ($rad * 360/( 2 * $pi));
}
Perhaps you've forgotten to account for that?
Plug in a 1 degree change to find the miles per degree longitude at your
latitude. Then use the map scale factor.
Jeff