Map 在flash中将地图纬度和经度转换为X和Y坐标

Map 在flash中将地图纬度和经度转换为X和Y坐标,map,flash-cs4,Map,Flash Cs4,我想在flash中将纬度/经度转换成X,Y坐标,所以我通过谷歌搜索尝试了这些方法 有人能告诉我其他的计算方法吗。因为它没有显示预期的位置 public function getPoint(lat, lon) { // First method /*stationX = (180+lon) * (mapwidth / 360); stationY = (90-lat) * (mapheight / 180);*/ // Sec

我想在flash中将纬度/经度转换成X,Y坐标,所以我通过谷歌搜索尝试了这些方法

有人能告诉我其他的计算方法吗。因为它没有显示预期的位置

    public function getPoint(lat, lon) {
// First method
                /*stationX = (180+lon) * (mapwidth / 360);
                stationY = (90-lat) * (mapheight / 180);*/
// Second method
                lat = (lat * -1) + 90;
                lon+=180;
                stationX = p.TnMap.x+Math.round(lon * (mapwidth / 360))+ 50;
                stationY = p.TnMap.y+Math.round(lat * (mapheight / 180));
// Thirdmethod
                /*stationX = radius_of_world * Math.cos(lon) * Math.cos(lat);
                stationY = radius_of_world * Math.sin(lon) * Math.cos(lat);
                stationZ = radius_of_world * Math.sin(lat);
                stationX = stationX * 150 / (150 + stationZ);
                stationY = stationY * 150 / (150 + stationZ);*/
            }