首页 文章

非Bing Map 的 Map 控件

提问于
浏览
0

我想将OpenStreetMap Map 放入我的Windows Phone 7.5应用程序中 . 我想使用Map控件

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身份验证密钥( despite I'm not using BING maps! ) . 我不需要't want to create Bing Developer Account, I don' t,因为我不想使用Bing Map . 是否有任何解决方案?或者是否有任何允许使用OSM的替代品?

1 回答

  • 0

    验证用于使用 Map 控件和 Map 数据 . 使用Open Street Maps替换Bing Maps数据违反了使用条款 . 看看这里的点3.2p:http://www.microsoft.com/maps/product/terms.html这就是为什么你不能在没有身份验证的情况下使用 Map 控件 .

    至于商业许可 . 如果这是面向公众的应用程序,Bing Maps为Windows Phone应用程序提供了非常慷慨的免费使用条款,允许您在24小时内生成50,000笔交易 . 这比大多数应用程序需要的更多 . 如果这是一个内部业务应用程序,那么您可以免费使用每年125,000笔交易 . 如果您的应用超出了免费使用条款的限制,那么您需要支付Bing Maps许可 .

相关问题