【发布时间】:2012-05-11 15:00:07
【问题描述】:
我是一名学生,我实际上正在研究如何将 Osmsharp 库与 Monodevelop 一起使用。
我使用以下代码进行测试: protected override void OnCreate(捆绑包) { base.OnCreate(捆绑);
// 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,>Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”。也许它在 Mono for >Android 配置文件中不存在?
文件名:'System.Drawing.dll'
经过一番研究,我添加了对文件“System.Drawing.dll”和“OpenTK.dll”的引用。我还在文件开头添加了“使用”,但我遇到了和以前一样的错误,我不明白为什么。
我想知道是否可以在 Mono for Android 项目中使用 Osmsharp 库?
【问题讨论】: