我是一名学生,实际上我正在研究如何将 Osmsharp 库与 Monodevelop 一起使用。
我使用以下代码进行测试:protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle);
// Set our view from the "main" layout resource
SetContentView (Resource.Layout.Main);
// create a router from an osm file.
Router router = Router.CreateFrom(new FileInfo("demo.osm"));
// instantiate route end coordinates.
GeoCoordinate location_from = new GeoCoordinate(51.26565,4.7777);
GeoCoordinate location_to = new GeoCoordinate(51.2741,4.79795);
// resolve the end points and link them to the road network.
ResolvedPoint from = router.Resolve(location_from);
ResolvedPoint to = router.Resolve(location_to);
// calculate the route.
OsmSharpRoute route = router.Calculate(from, to);
// save the route as a GPX file.
route.SaveAsGpx(new FileInfo("demo.gpx"));
}
(此代码是来自 Osmsharp 库教程的代码)
我的问题是当我构建项目时,我有这个错误:
System.IO.FileNotFoundException:无法加载程序集“System.Drawing,版本=4.0.0.0,>文化=中性,PublicKeyToken=b03f5f7f11d50a3a”。也许它在 Mono for >Android 配置文件中不存在?
文件名:'System.Drawing.dll'
经过一番研究,我添加了对文件“System.Drawing.dll”和“OpenTK.dll”的引用。我还在文件开头添加了“使用”,但我遇到了和以前一样的错误,我不明白为什么。
我想知道是否可以在 Mono for Android 项目中使用 Osmsharp 库?