Windows Phone 7使用离线模式的自定义图层进行地图控制 [英] Windows Phone 7 Map Control with custom layer in offline mode

查看:303
本文介绍了Windows Phone 7使用离线模式的自定义图层进行地图控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好WP7手机充满激情的开发者!

Hi WP7 mobile passionate developers!

我正在尝试使用Windows Phone控件提供的默认提供的Bing Map控件。
具体来说,我试图使用自定义TileSource来提供一个定制的平铺图,将其作为文件夹(内容文件)存储在项目中,或者存储在隔离存储中。

I'm trying to use the default provided Bing Map control from Windows Phone controls. Specifically I'm trying to use a custom TileSource to provide a custom made tiled map that will be stored in the project as a folder (Content files) or in isolate storage.

Down我将自定义类与ZXY存储格式map文件夹中存储的地图瓦片/图像一起使用,作为内容文件。

Down I present the custom class I try to use with map tiles/images stored in "map" folder in ZXY storage format as content files.

public class CustomTileSource : Microsoft.Phone.Controls.Maps.TileSource 
{

    private string uriFormat = @"map/{0}/{1}/{2}.png";
    public string UriFormat
    {
        get { return uriFormat; }
        set { uriFormat = value; }
    }

    public override Uri GetUri(int x, int y, int zoomLevel)
    {
        var url = string.Format(UriFormat, zoomLevel, x, y);
        return new Uri(url, UriKind.Relative);
    }
}

尝试使用这是不工作的,自定义的瓷砖是未示出,尽管没有错误被抛出。
有人试图用这种方式使用windows手机地图控件吗?
如果那不是正确的方法?任何解决方法?

Trying to use this is not working and custom tiles are not shown although no error is thrown. Does anyone tried to use windows phone map control this way? If that's not the right approach which one is? Any workaround?

提前谢谢!

Claudiu

推荐答案

您是否尝试使用此问题中所述的应用ID构建绝对文件url? 用于离线观看的地图平铺缓存

Did you try constructing an absolute file url using the app id as described in this question? Map Tile Caching for Offline Viewing

这篇关于Windows Phone 7使用离线模式的自定义图层进行地图控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆