原文:[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为显示鸟瞰图含有街道
}

结果

平面图 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 地形图

?? ? ? ? ??

鸟瞰图 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?鸟瞰图含街道

? ? ? ? ? ?

?

范例下载

map 地图模式.rar

?

相关参考与引用

Map.CartographicMode 属性

?

?

posted on 2013/11/25 17:37 |
阅读数 : 264
|

1 人推荐

我要推荐

|
Add Comment

| 文章分类 [

Windows Phone

]

|
订阅

[Windows Phone] 实作不同的地图显示模式的更多相关文章

  1. Windows 10 新特性 -- Bing Maps 3D地图开发入门(一)

    本文主要内容是讲述如何创建基于 Windows Universal App 的Windows 10 3D地图应用,涉及的Windows 10新特性包括 Bing Maps 控件.Compiled da ...

  2. 如何添加地图控件到Windows Phone 8的页面中

    原文 如何添加地图控件到Windows Phone 8的页面中 本主题介绍了各种方法来添加一个地图控件到Windows Phone 8的项目.该地图控件在Windows Phone的SDK 8.0的库 ...

  3. Silverlight for Windows Phone开发系列课程

    Silverlight for Windows Phone开发系列课程(1):Windows Phone平台概况         课程简介:本节开始介绍系列课程的概况,包括课程内容,先决条件,学习目的 ...

  4. WP8关于对地图开发的改进

    原文:WP8关于对地图开发的改进 微软在2012年6月21日 发布了 Windows Phone 8的更新.带来大量的功能更新和全新的SDK.作为重头戏的部分是引入了 C++ 和 DirectX,支持 ...

  5. Windows中的键盘快捷方式大全

    Windows有很多键盘快捷方式,使用键盘快捷方式能够大大提高使用windows的效率,同时还能提升自己的逼格,背熟几个快捷方式,操作起来行云流水犹如大神一般! 页面较长,请使用目录浏览(点击跳转), ...

  6. Windows中的键盘快捷方式

    Windows 中的键盘快捷方式 适用于: Windows 10Windows 8.1Windows 7 Windows 10 键盘快捷方式就是按键或按键组合,可提供一种替代方式来执行通常使用鼠标执行 ...

  7. Windows快捷键大全

    每天在使用电脑,不会记点快捷键怎行?高效办公从快捷键开始! Windows 10 键盘快捷方式就是按键或按键组合,可提供一种替代方式来执行通常使用鼠标执行的操作. 其他键盘快捷方式 应用中的键盘快捷方 ...

  8. Windows电脑常用快捷键

    Windows 徽标键键盘快捷方式: Windows 徽标键      打开或关闭“开始”屏幕 Windows 徽标键  + A       打开操作中心 Windows 徽标键  + B       ...

  9. 快捷键(一):Win10

    Ctrl + X 剪切选定项 Ctrl + C(或 Ctrl + Insert) 复制选定项 Ctrl + V(或 Shift + Insert) 粘贴选定项 Ctrl + Z 撤消操作 Alt + ...

随机推荐

  1. PropertyPlaceholderConfigurer类的使用注意

    如果你在spring的applicationcontext.xml中需要使用属性配置文件,那PropertyPlaceholderConfigurer这个类就是必须的. <bean class= ...

  2. android端向服务器提交请求的几种方式

    1.GET方式 其实GET方式说白了,就是拼接字符串..最后拼成的字符串的格式是: path ?  username= ....& password= ...... public boolea ...

  3. JavaFX2: 鼠标拖动选择和Ctrl+Shift连续区间选择的ListView

    JavaFX2的ListView中的多选没有提供鼠标拖动选择的功能,同时按下Ctrl和Shift后连续的区间选中也不支持,以下代码用于处理这两个问题,细节见代码注释: import com.sun.j ...

  4. LCA 最近公共祖先 tarjan离线 总结 结合3个例题

    在网上找了一些对tarjan算法解释较好的文章 并加入了自己的理解 LCA(Least Common Ancestor),顾名思义,是指在一棵树中,距离两个点最近的两者的公共节点.也就是说,在两个点通 ...

  5. hdu 3221 Brute-force Algorithm(高速幂取模,矩阵高速幂求fib)

    http://acm.hdu.edu.cn/showproblem.php?pid=3221 一晚上搞出来这么一道题..Mark. 给出这么一个程序.问funny函数调用了多少次. 我们定义数组为所求 ...

  6. 《Android系统开发》笔记

    <Android系统开发>笔记1:Android系统概述 Android四层架构: 1. Linux Kernel&driver层 a.依赖于Linux 2.6内核,包含安全性.内 ...

  7. MTK Android Driver:GPIO

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2JrODYxMTEw/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA ...

  8. 每日算法之三十八:Anagrams

    Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be ...

  9. Xenu-web开发死链接检測工具应用

    Xenu 是一款深受业界好评,并被广泛使用的死链接检測工具. 时常检測站点并排除死链接,对站点的SEO 很重要,由于大量死链接存在会减少用户和搜索引擎对站点的信任,web程序开发者还可通过其找到死链接 ...

  10. 在Sublime Text3中运行PHP代码

    一.前言 最近由于工作需要要与第三方系统对接,另外由于文档中关于其中几个接口就只有很简单的描述,弄了半天都没有弄成功.跟第三方负责的人沟通后还是没有找到具体问题出在哪里,另外因为他们没有开发人员懂.n ...