[Windows Phone] 实作不同的地图显示模式
原文:[Windows Phone] 实作不同的地图显示模式
前言
本文章主要示范如何让地图有不同的模式产生,例如平面图、地形图、鸟瞰图、鸟瞰图含街道等。
这部分主要是调整 Map.CartographicMode 属性,其中 MapCartographicMode 列举包含:
- Road:Specifies the road mode of the map control.
- Aerial:Specifies the aerial mode of the map control.
- Hybrid:Specifies an aerial mode with overlaid roads and labels.
- Terrain:Specifies the terrain mode of the map control.
?
实作
step1 建立专案。
![]()
?
step2 在 WMAppManifest.xml 的地方用滑鼠点两下进行编辑。
![]()
?
step4 进去 WMAppManifest.xml 後,先点选 [功能],再勾选 [ID_CAP_MAP] 来开启地图功能。
![]()
?
step5 MainPage.xaml 画面设计。

Button1 ---->Name=btn1,Content=平面图
Button2 ---->Name=btn2,Content=地形图
Button3 ---->Name=btn3,Content=鸟瞰图
Button4 ---->Name=btn4,Content=鸟瞰图含街道
map ------>Name=map,Center="24.15,120.43"为台中市经纬度,ZoomLevel="10"为缩放比例
?
产生 xaml 程式码:
xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="10,0,14,0">
<Button x:Name="btn1" Content="平面图" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Click="btn1_Click"/>
<Button x:Name="btn2" Content="地形图" HorizontalAlignment="Left" Margin="150,10,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.051,0.477" Click="btn2_Click"/>
<Button x:Name="btn3" Content="鸟瞰图" HorizontalAlignment="Left" Margin="297,10,0,0" VerticalAlignment="Top" Click="btn3_Click"/>
<Button x:Name="btn4" Content="鸟瞰图含街道" HorizontalAlignment="Left" Margin="86,82,0,0" VerticalAlignment="Top" RenderTransformOrigin="-0.923,0.746" Click="btn4_Click" Width="287"/> <maps:Map x:Name="map" Center=" 24.15,120.43" ZoomLevel=" 10" HorizontalAlignment="Left" Margin="10,172,0,0" VerticalAlignment="Top" Height="423" Width="436"/> </Grid>
?
step5? MainPage.xaml.cs 程式码中的事件处理函式如下:
private void btn1_Click(object sender, RoutedEventArgs e)
{
map.CartographicMode = MapCartographicMode.Road;//Road为显示平面图
} private void btn2_Click(object sender, RoutedEventArgs e)
{
map.CartographicMode = MapCartographicMode.Terrain; //Terrain为显示地形图
} private void btn3_Click(object sender, RoutedEventArgs e)
{
map.CartographicMode = MapCartographicMode.Aerial; //Aerial为显示鸟瞰图
} private void btn4_Click(object sender, RoutedEventArgs e)
{
map.CartographicMode = MapCartographicMode.Hybrid; //Hybrid为显示鸟瞰图含有街道
}
结果
平面图 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 地形图
?? ? ? ? ??
鸟瞰图 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?鸟瞰图含街道
? ? ? ? ? ?
?
范例下载
?
相关参考与引用
?
?
posted on 2013/11/25 17:37 |
阅读数 : 264
|
| 文章分类 [
]
|
订阅
[Windows Phone] 实作不同的地图显示模式的更多相关文章
- Windows 10 新特性 -- Bing Maps 3D地图开发入门(一)
本文主要内容是讲述如何创建基于 Windows Universal App 的Windows 10 3D地图应用,涉及的Windows 10新特性包括 Bing Maps 控件.Compiled da ...
- 如何添加地图控件到Windows Phone 8的页面中
原文 如何添加地图控件到Windows Phone 8的页面中 本主题介绍了各种方法来添加一个地图控件到Windows Phone 8的项目.该地图控件在Windows Phone的SDK 8.0的库 ...
- Silverlight for Windows Phone开发系列课程
Silverlight for Windows Phone开发系列课程(1):Windows Phone平台概况 课程简介:本节开始介绍系列课程的概况,包括课程内容,先决条件,学习目的 ...
- WP8关于对地图开发的改进
原文:WP8关于对地图开发的改进 微软在2012年6月21日 发布了 Windows Phone 8的更新.带来大量的功能更新和全新的SDK.作为重头戏的部分是引入了 C++ 和 DirectX,支持 ...
- Windows中的键盘快捷方式大全
Windows有很多键盘快捷方式,使用键盘快捷方式能够大大提高使用windows的效率,同时还能提升自己的逼格,背熟几个快捷方式,操作起来行云流水犹如大神一般! 页面较长,请使用目录浏览(点击跳转), ...
- Windows中的键盘快捷方式
Windows 中的键盘快捷方式 适用于: Windows 10Windows 8.1Windows 7 Windows 10 键盘快捷方式就是按键或按键组合,可提供一种替代方式来执行通常使用鼠标执行 ...
- Windows快捷键大全
每天在使用电脑,不会记点快捷键怎行?高效办公从快捷键开始! Windows 10 键盘快捷方式就是按键或按键组合,可提供一种替代方式来执行通常使用鼠标执行的操作. 其他键盘快捷方式 应用中的键盘快捷方 ...
- Windows电脑常用快捷键
Windows 徽标键键盘快捷方式: Windows 徽标键 打开或关闭“开始”屏幕 Windows 徽标键 + A 打开操作中心 Windows 徽标键 + B ...
- 快捷键(一):Win10
Ctrl + X 剪切选定项 Ctrl + C(或 Ctrl + Insert) 复制选定项 Ctrl + V(或 Shift + Insert) 粘贴选定项 Ctrl + Z 撤消操作 Alt + ...
随机推荐
- Delphi中获取Unix时间戳及注意事项(c语言中time()是按格林威治时间计算的,比北京时间多了8小时)
uses DateUtils;DateTimeToUnix(Now) 可以转换到unix时间,但是注意的是,它得到的时间比c语言中time()得到的时间大了8*60*60这是因为Now是当前时区的时间 ...
- 14.3.2.2 autocommit, Commit, and Rollback 自动提交 提交和回滚
14.3.2.2 autocommit, Commit, and Rollback 自动提交 提交和回滚 如果自动提交模式被启用,在InnoDB里, 所有的用户活动发生在一个事务里, 每个SQL语句 ...
- heapq
heapq-Guest-ChinaUnix博客 假设你需要维护一个列表,这个列表不断有新的元素加入,你需要在任何时候很方便的得到列表中的最大(小)值,因此要求列表始终处于排序完毕状态,怎么办呢 最简单 ...
- LCS最大公共子序列问题
在生物应用中,经常需要比较两个(或多个)不同生物体的DNA, 例如:某种生物的DNA可能为S1=ACCGGTCGAGTGCGCGGAAGCCGGCCGAA, 另一种生物的DNA可能为S2=GTCGTT ...
- Rudiments 0.42 发布,C++ 常用工具包 - 开源中国社区
Rudiments 0.42 发布,C++ 常用工具包 - 开源中国社区 Rudiments 0.42 发布,C++ 常用工具包
- 手机定位原理 - GPS/GLONASS/北斗 + WIFI + 基站(转)
卫星定位系统 - GPS/GLONASS/北斗: 关于GPS.GLONASS.北斗.伽利略系统的科普请自行谷歌. GPS是使用最广泛的全球定位网络,几乎是所有智能手机的标配.进几年,俄罗斯的GLONA ...
- selenium让人摸不着头脑的问题
selenium让人摸不着头脑的问题 问题一 使用webdriver驱动firefox浏览器时如果不设置参数,默认使用的Firefox的profile和平时打开浏览器使用的firefox不一样,如果要 ...
- xcode6 iOS sdk8.1隐藏系统状态栏
在代码项目(uzplayer)从iOS6升级到iOS8之后,头发如今视频播放器有.系统状态栏后面的背景: 这样就会导致有的时候按下Donebutton,或者拖滑块没有效果 所以,我们须要想个办法.把这 ...
- hdu4389(数位dp)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4389 题意:f(x)表示x各位的数字和. 给定1<=L<=R<=10^9, 求[L, ...
- hdu2062(递推)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2062 详细分析:http://mamicode.com/info-detail-95273.html ...