【发布时间】:2014-04-16 10:08:06
【问题描述】:
我想将 OpenStreetMap 地图放入我的 Windows Phone 7.5 应用程序中。我想使用来自
的地图控件xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"
我已经创建了自定义TileSource:
public class OSMTileSource : TileSource
{
private const string OSMUriFormat = "http://{0}.tile.openstreetmap.org/{1}/{2}/{3}.png";
public OSMTileSource()
{
this.UriFormat = OSMUriFormat;
}
private readonly static string[] TilePathPrefixes = new[] { "a", "b", "c" };
public override Uri GetUri(int x, int y, int zoomLevel)
{
if (zoomLevel > 0)
{
var url = string.Format(UriFormat, TilePathPrefixes[y % 3], zoomLevel, x, y);
return new Uri(url);
}
return null;
}
}
不幸的是,控制要求我提供 Bing 身份验证密钥(尽管我没有使用 BING 地图!)。我不想创建 Bing 开发者帐户,我不需要,只要我不想使用 Bing 地图。 该控件是否有任何解决方法?或者有没有可以使用 OSM 的替代品?
【问题讨论】:
-
只需创建一个帐户并获取密钥,您为什么不这样做?!使用备用磁贴源的所有其他开发人员都会这样做。
-
是的,但是许可证呢?商业许可(我想在商业应用中使用地图)有一些限制。
-
如果您对许可有疑虑,最好直接联系 Bing。我知道的唯一其他地图控件是ArcGIS Runtime SDK for Windows Phone
标签: c# windows-phone-7 bing-maps