在给定纬度的情况下,我正在尝试使用墨卡托投影来计算地图上的 Y 位置。这是我需要的:
//mapHeight might be 600 (pixels), for example
//latitudeInDegrees ranges from -90 to 90
public double CalculateY(double mapHeight, double latitudeInDegrees)
{
//what on earth do I do here to calculate the Y offset on the map?
return ???;
}
我已经尝试了我在网上找到的各种东西(包括 wikipedia 和 stackoverflow),但没有一个对我有用。我可能在做一些愚蠢的事情,但我不知道是什么。谁能拯救我的理智?