可以通过RasterMap的getDirection()方法来查询路径,和查询地址类似,路径查询的结果也是通过回调函数的方式来通知应用程序的,下面的例子返回南京到北京的路径。返回结果存放在MapDirection中,MapDirection包含了路径的详细信息,包括路径的每个步骤,长度,时间,方向等。
在MainFrom上添加一个mnuGetDirection菜单项,并让MainForm实现IRoutingListener接口用于响应路径查询结果
public void Done(string query, MapDirection result)
{
if (result != null)
{
_rasterMap.SetMapDirection(result);
_rasterMap.Resize(result.Bound);
}
}
....
private void mnuGetDirection_Click(object sender, EventArgs e)
{
String name1 = "南京";
String name2 = "北京";
_rasterMap.GetDirections("from: " + name1 + " to: " + name2);
}
地图服务可以选择使用Google 地图服务,CloudMade地图服务,在中国还可能选择MapAbc地图服务,缺省使用Google 地图服务。
getDirections()具有三个重载函数,例子中是采用的文字描述方式。上述示例采用了from: address1 to: address2 的格式, CloudMade地图服务和MapAbc地图服务则必需采用 经度1,纬度1,经度2,纬度2和格式。
为避免混淆,可以使用下述格式。
public void getDirection(GeoLatLng[] waypoints, IRoutingListener listener);
其中 waypoints 为途径点坐标数组经纬值,可以支持多点路径查询。
此外对于MapAbc 地图服务,还可以指定城市编码,如南京编码为25。
public void getDirection(int citycode,String query, IRoutingListener listener);
Windows Mobile引路蜂地图开发包Ver2.1下载
分享到:
相关推荐
引路蜂地图开发包2.0 包含了 开发库 帮助 示例代码 详细请参见 http://blog.csdn.net/guidebee/archive/2010/09/19/5895245.aspx
Windows Mobile开发Windows Mobile开发Windows Mobile开发Windows Mobile开发
Windows Mobile开发实验,wince操作系统定制。
windows mobile 平台应用与开发 示例代码
结合经验和实例软件来介绍Windows Mobile操作系统上的短信开发技术
如何搭建windows mobile应用开发的环境
基于windows mobile/ce的开发示例
WindowsMobile平台应用与开发的配套光盘的镜像
Windows mobile应用开发流程
Windows CE 、Windows Mobile概念介绍,Windows Mobile开发工具简介,Windows Mobile开发环境搭建指南,智能手机Smartphone开发从零起步。
windows mobile驱动开发
从这个帖子转移而来http://topic.csdn.net/u/20070920/17/6801bc06-9e03-407e-ba63-13fc95387379.html
Windows-Mobile平台应用与开发 Windows-Mobile平台应用与开发 Windows-Mobile平台应用与开发
Windows Mobile应用程序开发介绍 .Windows Mobile平台 .Windows Mobile开发环境搭建 .Windows Mobile开发技术和资源 .Demo
介绍WindowsMobile应用程序开发的流程。
有关windows mobile 实例开发的问题,希望对大家有所帮助
pknife出品 有详尽的开发实例 不可多得
mappoint sdk,开发wm map
WinMobile开发示例工程