window phone7中使用bing中文地图和Google地图

之前在windows phone中使用map控件时,一直加载出来的是英文的bing map,一直以为要等ms提供汉化的map;而同时google和baidu等未发现对应的map sdk或api,那个苦恼啊,使用英文bing map那个痛苦啊;期间看到一些使用加载titlesource 加载google地图或者bing map中文地图的方法;但是这些方法都是非正式处理方法,担心应用发布后会遇到问题;后来从nokia那得到消息,nokia会出正式的windows phone地图,但是需要走商业合同... ...,我只整理了下如何加载中文bingmap和google map的方法;源码

实现的大致思路都是重写titlesource,在bingmap control中添加一个层,将对应titlesource加载到这个层上显示;

方法是定义两个类继承自Microsoft.Phone.Controls.Maps.TileSource,然后重写geturl方法;

代码如下:

View Code
    public class GoogleTitleSource : TileSource    {        public GoogleTitleSource()            : base("http://khm{0}.google.com/kh/v=47&x={1}&y={2}&z={3")        {        }        public override Uri GetUri(int x, int y, int zoomLevel)        {            return new Uri(string.Format(this.UriFormat, x % 4, x, y, zoomLevel));        }    }    public class BingChinaTitleSource : TileSource    {        public BingChinaTitleSource()            : base("http://r2.tiles.ditu.live.com/tiles/r{quadkey}.png?g=4")        {        }    }

再在page loaded事件中添加对应map的层和源

View Code
  private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)        {            //bing            MapTileLayer bingtileLayer = new MapTileLayer();            bingtileLayer.Width = 431;            bingtileLayer.Height = 540;            GeoCoordinate center = new GeoCoordinate(36,104);            TileSource tileSource = new BingChinaTitleSource();            bingtileLayer.TileSources.Add(tileSource);            bingtileLayer.Opacity = 0.9;            bingMap.Children.Add(bingtileLayer);            bingMap.Mode = new MercatorMode();            bingMap.Center = center;            //google            MapTileLayer googletileLayer = new MapTileLayer();            googletileLayer.Width = 431;            googletileLayer.Height = 540;                   TileSource googletileSource = new GoogleTitleSource();            googletileLayer.TileSources.Add(tileSource);            googletileLayer.Opacity = 0.9;            google.Children.Add(googletileLayer);            google.Mode = new MercatorMode();            google.Center = center;            bingEng.Center = center;        }

ui中使用全景视图,分别添加两个Map控件

View Code
 <controls:Panorama Grid.Row="1" Height="722" HorizontalAlignment="Left" Margin="0,0,0,0" Title="maps" VerticalAlignment="Top" Width="479" FontSize="26.667" Style="{StaticResource PanoramaStyle1}">        <controls:PanoramaItem Header="Bing Map Chinese" Style="{StaticResource PanoramaItemStyle1}">            <Grid Height="579" Width="434">                <my:Map x:Name="bingMap" Height="578" LogoVisibility="Collapsed" CopyrightVisibility="Collapsed" HorizontalAlignment="Left" Margin="3,1,0,0"                         VerticalAlignment="Top" Width="431" ZoomLevel="3" />            </Grid>        </controls:PanoramaItem>        <controls:PanoramaItem Header="Google Map" Style="{StaticResource PanoramaItemStyle1}">            <Grid Height="578" Width="426">                <my:Map x:Name="google" Height="578" LogoVisibility="Collapsed" CopyrightVisibility="Collapsed" HorizontalAlignment="Left" Margin="3,1,0,0"                    VerticalAlignment="Top" Width="431" ZoomLevel="3" />            </Grid>        </controls:PanoramaItem>        <controls:PanoramaItem Header="bing Map englsh" Style="{StaticResource PanoramaItemStyle1}">            <Grid Height="557" Width="426">                <my:Map x:Name="bingEng" Height="549" ZoomLevel="3" LogoVisibility="Collapsed" CopyrightVisibility="Collapsed" HorizontalAlignment="Left" Margin="3,1,0,0" VerticalAlignment="Top" Width="416" />            </Grid>        </controls:PanoramaItem>    </controls:Panorama>

运行效果

bingchgma<a href=http://www.th7.cn/pm/Photoshop/ target=_blank class=infotextkey>ps</a>bing eng

从体验来说bing中文和google似乎差别不大,但是bing英文 ui显示元素太少;

来源:http://www.th7.cn/Program/wp7/2012/04/12/69509.shtml

内容概要:本文详细介绍了文生视频大模型及AI人应用方案的设计与实现。文章首先阐述了文生视频大模型的技术基础,包括深度生成模型、自然语言处理(NLP)计算机视觉(CV)的深度融合,以及相关技术的发展趋势。接着,文章深入分析了需求,包括用户需求、市场现状技术需求,明确了高效性、个性化成本控制等关键点。系统架构设计部分涵盖了数据层、模型层、服务层应用层的分层架构,确保系统的可扩展性高效性。在关键技术实现方面,文章详细描述了文本解析与理解、视频生成技术、AI人交互技术实时处理与反馈机制。此外,还探讨了数据管理与安全、系统测试与验证、部署与维护等重要环节。最后,文章展示了文生视频大模型在教育、娱乐商业领域的应用场景,并对其未来的技术改进方向市场前景进行了展望。 适用人群:具备一定技术背景的研发人员、产品经理、数据科学家以及对AI视频生成技术感兴趣的从业者。 使用场景及目标:①帮助研发人员理解文生视频大模型的技术实现应用场景;②指导产品经理在实际项目中应用文生视频大模型;③为数据科学家提供技术优化模型改进的思路;④让从业者了解AI视频生成技术的市场潜力发展趋势。 阅读建议:本文内容详尽,涉及多个技术细节应用场景,建议读者结合自身的专业背景技术需求,重点阅读与自己工作相关的章节,并结合实际项目进行实践验证。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值