So turns out google found it for me after a while ..
Converted into c# it looks like this
public LatLng displayToCoordinate(Point point, int zoom)
{
// longitude
double longitude = (point.X * (360 / (Math.Pow(2, zoom) *
256))) - 180;
// latitude
double latitude = point.Y * (2 / (Math.Pow(2, zoom) *
256));
latitude = 1 - latitude;
latitude = latitude * Math.PI;
//latitude = rad_deg(Math.Atan(Math.Sinh(latitude)));
latitude = rad_deg(Math.Atan(Math.Sinh(latitude)));
LatLng coord = new LatLng(latitude, longitude);
return coord;
}
private double rad_deg(double p)
{
return p * (180 / Math.PI);
}
Source: http://forum.openstreetmap.org/viewtopic.php?id=244
Cheers
On Feb 12, 12:00 pm, "RodgerWilko!" <[email protected]> wrote:
> Hi,
>
> I am trying to port the GMercatorProjection.fromPixelToLatLng function
> to a .Net C# library.
>
> Google search has failed me on this one and was wondering if anyone
> knows where I can get source code for this function or a similar
> function.
>
> Thanks in advance
> RodgerWilko!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---