1.WorldWind资源下载
http://worldwindcentral.com/wiki/NASA_World_Wind_Download
2.WorldWind源码编译
Worldwind最新的源代码(2007年)为c#版本,使用Visual Studio打开,默认解决方案的文件为VS8(即VS 2005)的版本,使用高版本打开时直接转换版本即可。编译时PluginSDK项目下会爆“字符文本中的字符太多”等错误,这些错误还是比较好解决的。
出错位置主要在PluginSDK项目下的Angle.cs和ConfigurationLoader.cs两个文件下:
Angle.cs
1 /// <summary> 2 /// Converts degrees to degrees/minutes/seconds 3 /// </summary> 4 /// <returns>String on format dd癿m'ss.sss"</returns> 5 public string ToStringDms() 6 { 7 double decimalDegrees = this.Degrees; 8 double d = Math.Abs(decimalDegrees); 9 double m = (60*(d-Math.Floor(d))); 10 double s = (60*(m-Math.Floor(m))); 11 12 return String.Format("{0}皗1}'{2:f3}\"", 13 (int)d*Math.Sign(decimalDegrees), 14 (int)m, 15 s); 16 } 17 18 public override string ToString() 19 { 20 return Degrees.ToString(CultureInfo.InvariantCulture)+"?; 21 }
修改为:
1 /// <summary> 2 /// Converts degrees to degrees/minutes/seconds 3 /// </summary> 4 /// <returns>String on format dd°m'ss.sss"</returns> 5 public string ToStringDms() 6 { 7 double decimalDegrees = this.Degrees; 8 double d = Math.Abs(decimalDegrees); 9 double m = (60*(d-Math.Floor(d))); 10 double s = (60*(m-Math.Floor(m))); 11 12 return String.Format("\"{0}°{1}'{2:f3}\"", 13 (int)d*Math.Sign(decimalDegrees), 14 (int)m, 15 s); 16 } 17 18 public override string ToString() 19 { 20 return Degrees.ToString(CultureInfo.InvariantCulture)+"?"; 21 }
ConfigurationLoader.cs
1 string viewBBox = string.Format(CultureInfo.InvariantCulture, 2 "{0},{1},{2},{3}", 3 bbox[0].ToString().TrimEnd('?), bbox[1].ToString().TrimEnd('?), bbox[2].ToString().TrimEnd('?), bbox[3].ToString().TrimEnd('?));
修改为:
1 string viewBBox = string.Format(CultureInfo.InvariantCulture, 2 "{0},{1},{2},{3}", 3 bbox[0].ToString().TrimEnd('?'),bbox[1].ToString().TrimEnd('?'), bbox[2].ToString().TrimEnd('?'),bbox[3].ToString().TrimEnd('?'));
再编译时即可通过。