[Windwos Phone] 实作地图缩放 MapAnimationKind 属性效果
2014-03-08 21:16
489 查看
原文:[Windwos Phone] 实作地图缩放 MapAnimationKind 属性效果
使用经纬度来定位地图的位置,以及使用 MapAnimationKind 属性来设定地图缩放时的动画。
?
??
??
??
?
Step1. 新增 Windows Phone 应用程式专案。
?
Step2. 指定应用程式使用 ID_CAP_MAP 功能
方案总管 -->Properties 资料夹--> WMAppManifest.xml --> 功能 --> 勾选ID_CAP_MAP。
?
Step3. 加入地图的命名空间。
?
Step4. 画面设计
maps:Map-->Name="map",Heading="0",Center="25.0405,121.5146",ZoomLevel="10",Margin="0,61,0,10"
Button-->Name="btCenter",Content="置中",Margin="0,-11,339,546"
Button-->Name="btAnom",Content="缩放动画",Margin="106,-11,202,546
?
XAML 程式码:
?
Step5. 产生btCenter / btAnom 按钮的 Click 事件。
?
Step6. btCenter / btAnom 的 Click 事件内容。
?
Map.SetView Method (GeoCoordinate, Double, Double, MapAnimationKind)
?
Map 缩放.rar
var now = new Date();var index=now.getTime();document.write('');
posted on 2013/11/24 01:28 |
阅读数 : 965
|
2 人推荐
我要推荐
|
Add Comment
| 文章分类 [
Windows Phone
]
|
订阅
[前言]
使用经纬度来定位地图的位置,以及使用 MapAnimationKind 属性来设定地图缩放时的动画。?
[成品]
??
??
??
?
[范例]
Step1. 新增 Windows Phone 应用程式专案。?
Step2. 指定应用程式使用 ID_CAP_MAP 功能
方案总管 -->Properties 资料夹--> WMAppManifest.xml --> 功能 --> 勾选ID_CAP_MAP。
?
Step3. 加入地图的命名空间。
xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
?
Step4. 画面设计
maps:Map-->Name="map",Heading="0",Center="25.0405,121.5146",ZoomLevel="10",Margin="0,61,0,10"
Button-->Name="btCenter",Content="置中",Margin="0,-11,339,546"
Button-->Name="btAnom",Content="缩放动画",Margin="106,-11,202,546
?
XAML 程式码:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <maps:Map x:Name="map" Heading="0" Center="25.0405,121.5146" ZoomLevel="10" Margin="0,61,0,10"/> <Button Name="btCenter" Content="置中" Margin="0,-11,339,546"/> <Button Name="btAnom" Content="缩放动画" Margin="106,-11,202,546"/> </Grid>
?
Step5. 产生btCenter / btAnom 按钮的 Click 事件。
// 建构函式 public MainPage() { InitializeComponent(); //产生btCenter / btAnom Click事件,+=後按下 Tab 2下产生事件 btCenter.Click += btCenter_Click; btAnom .Click+= btAnom_Click; }
?
Step6. btCenter / btAnom 的 Click 事件内容。
private void btCenter_Click(object sender, RoutedEventArgs e) { //把位置(25.0405, 121.5146)的位置设置在中间 map.Center = new GeoCoordinate(25.0405, 121.5146); //地图的比例为12 map.ZoomLevel = 12; } private void btAnom_Click(object sender, RoutedEventArgs e) { //设置地图在缩放时显示动画的效果 map.SetView(new GeoCoordinate(25.0405, 121.5146), 16, MapAnimationKind.Parabolic); }
?
[相关参考与引用]
Map.SetView Method (GeoCoordinate, Double, Double, MapAnimationKind)?
[范例下载]
Map 缩放.rarvar now = new Date();var index=now.getTime();document.write('');
posted on 2013/11/24 01:28 |
阅读数 : 965
|
2 人推荐
我要推荐
|
Add Comment
| 文章分类 [
Windows Phone
]
|
订阅
相关文章推荐
- Android 利用Mainfest.xml隐藏ActionBar
- java学习总结——第一天
- redirect 与 forward 的区别
- JAVA学习第1篇:J2EE,J2SE,J2ME,JDK,SDK,JRE,JVM区别
- 编程注意事项
- 矩阵模板(尚未完善)
- HDU 1847 Good Luck in CET-4 Everybody!
- B树、B+树、B*树全解
- Android之ContentProvider
- 非递归的二叉树遍历
- 使用jQuery实现图片滑动窗
- python filter
- Prepare for Android
- XMLHttpRequest对象
- 多线程编程示例(基于tcp_socket)
- A20 Gate
- 【iOS】真机测试及布署Code Sign error问题总结
- auto
- java初基1
- 面试题之银行业务调度系统