【问题标题】:Osmsharp and Mono for Android适用于 Android 的 Osmsharp 和 Mono
【发布时间】: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 库?

【问题讨论】:

    标签: android xamarin.android


    【解决方案1】:

    我猜 OsmSharp 需要 System.Drawing.dll,这在 Mono for Android 中不可用。

    【讨论】:

    • 谢谢你的回答,我换个方式搜索
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 2013-09-13
    • 1970-01-01
    • 2012-02-10
    相关资源
    最近更新 更多