C# 如何在我的 Compact Framework 应用程序中使用 OpenStreetMap?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/922333/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I use OpenStreetMap in my Compact Framework App?
提问by
Does anyone know, how I can use OpenStreetMap inside my Compact Framework application? Is there a Framework or something like that? All I can find in their wiki is how to contribute to their project and to user their software to map data. But I want to use their maps to show the users location inside my own app. I could not find anything about using their web service or whatever I have to use to show their maps inside my application.
有谁知道,如何在我的 Compact Framework 应用程序中使用 OpenStreetMap?有没有框架或类似的东西?我在他们的 wiki 中所能找到的只是如何为他们的项目做出贡献以及如何使用他们的软件来映射数据。但我想使用他们的地图来显示我自己的应用程序中的用户位置。我找不到任何关于使用他们的网络服务的信息,或者我必须使用的任何东西来在我的应用程序中显示他们的地图。
回答by ctacke
They don't appear to have any CF libraries, but the API specification is well documented, so there's no reason you couldn't integrate with it.
它们似乎没有任何 CF 库,但API 规范有据可查,因此您没有理由不能与它集成。
回答by ctacke
There is a project on Google Code that wants to create a .NET library for the OpenStreetMap API. The website states that there currently is an alpha release, so it might be worth checking that out: code.google.com/p/openstreetmapnet
Google Code 上有一个项目想要为 OpenStreetMap API 创建一个 .NET 库。该网站指出目前有一个 alpha 版本,因此可能值得一试:code.google.com/p/openstreetmapnet
And there are two similar projects on CodePlex as well: osmscout.codeplex.comgmap4dotnet.codeplex.com
CodePlex 上也有两个类似的项目: osmscout.codeplex.com gmap4dotnet.codeplex.com
Maybe those can be used in the Compact Framework as well, or you could ask the project teams to add that feature (or get involved yourself, it is opensource after all).
也许这些也可以在 Compact Framework 中使用,或者您可以要求项目团队添加该功能(或者自己参与,毕竟它是开源的)。
回答by gravitystorm
CloudMade provides APIs for embedding OpenStreetMap maps in many languages - but not .NET as of the time of writing. There are plain HTTP APIs for map tiles available that you could call from .NET programs, but this is of course fairly low-level.
CloudMade 提供了用于以多种语言嵌入 OpenStreetMap 地图的 API,但截至撰写本文时,还不是 .NET。您可以从 .NET 程序中调用用于地图图块的普通 HTTP API,但这当然是相当低级的。
The CloudMade APIs are designed for developers who want to embed OSM output in their projects, rather than the OSM API which is geared towards map creation, so I think you might be interested in the CloudMade stuff.
CloudMade API 是为希望将 OSM 输出嵌入到他们的项目中的开发人员设计的,而不是面向地图创建的 OSM API,所以我认为您可能对 CloudMade 的东西感兴趣。
See http://developers.cloudmade.com/projectsfor more.
有关更多信息,请参阅http://developers.cloudmade.com/projects。
回答by Rowland Shaw
I've developed a CF component that can download OpenStreetMap tiles, and also plot points of interest and basic routes. Depending on your requirements, and any restrictions on licences that you're permitted to use, then it may be of use to you?
我开发了一个 CF 组件,可以下载 OpenStreetMap 图块,还可以绘制兴趣点和基本路线。根据您的要求以及对您被允许使用的许可证的任何限制,它可能对您有用吗?
回答by ford
Brutilelooks quite promising. It is a library designed for C# to connect to OpenStreetMap sources. (Silverlight demo available Here.
Brutile看起来很有希望。它是一个专为 C# 连接到 OpenStreetMap 源而设计的库。(此处提供 Silverlight 演示。
The wiki also has a listing of all .NET related pages. Of the documented projects, OpenStreetMapViewerlooks like it fits your needs the best. It's designed to display a portion of OpenStreetMap within a .NET app. I'm sure at least one of these will work for windows mobile.
wiki 还列出了所有与 .NET 相关的页面。在记录的项目中,OpenStreetMapViewer看起来最适合您的需求。它旨在在 .NET 应用程序中显示 OpenStreetMap 的一部分。我确信其中至少一个适用于 windows mobile。