关于导航的使用(感恩我的领导阿密,没有收版权费)
来源:互联网 发布:seo 教程 编辑:程序博客网 时间:2024/05/17 08:30
if (AppUtils.checkPackage(getApplicationContext(),
"com.autonavi.minimap")) {
// 移动APP调起Android高德地图方式
Intent intent = new Intent(
"android.intent.action.VIEW",
android.net.Uri
.parse("androidamap://navi?sourceApplication=appname&poiname="
+ toLatLng.getLanName()
+ "&lat="
+ toLatLng.getLatitude()
+ "&lon="
+ toLatLng.getLongitude()
+ "&dev=0&style=2"));
intent.setPackage("com.autonavi.minimap");
context.startActivity(intent);
} else if (AppUtils.checkPackage(getApplicationContext(),
"com.baidu.BaiduMap")) {
// 移动APP调起Android百度地图方式
Intent intent = null;
try {
intent = Intent
.getIntent("intent://map/direction?origin=latlng:"
+ fromLatLng.getLatitude()
+ ","
+ fromLatLng.getLongitude()
+ "|name:"
+ fromLatLng.getLanName()
+ "&destination=latlng:"
+ toLatLng.getLatitude()
+ ","
+ toLatLng.getLongitude()
+ "|name:"
+ toLatLng.getLanName()
+ "&mode=driving&coord_type=gcj02&src=依威能源|E充站#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end");
context.startActivity(intent); // 启动调用
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} else {
// 移动APP调起高德网页地图方式
String urlStr = "http://m.amap.com/?from="
+ fromLatLng.getLatitude() + ","
+ fromLatLng.getLongitude() + "(from)&to="
+ toLatLng.getLatitude() + "," + toLatLng.getLongitude()
+ "(to)&type=0&opt=0&dev=0";
Uri uri = Uri.parse(urlStr);
Intent it = new Intent(Intent.ACTION_VIEW, uri);
context.startActivity(it);
// T.showLong(getActivity(), "检测到你还没有安装地图");
}
0 0
- 关于导航的使用(感恩我的领导阿密,没有收版权费)
- 我的群友写的失恋诗——不要和我要版权费呦
- 教会我感恩的人
- 关于领导的思考
- 我和领导的对比
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于版权声明的写法
- 关于GPL版权的思考
- 201,.plist文件 与 .pch文件的了解
- JDK1.7 Paths,Files类实现文件夹的复制与删除
- Web Developer 成长路线图
- ko 中if 和visible 的区别
- angularjs开发时-----------谨严
- 关于导航的使用(感恩我的领导阿密,没有收版权费)
- 商标查询api 模糊查询商标列表
- jquery验证(产品三期-院历增加)
- 飞思卡尔单片机RAM与flash相关问题
- 较大数据文件的读取优化过程
- Android--MVP模式--简介
- 解决WINDOWS 7开机卡在"正在启动WINDOWS"的问题
- 【Bash百宝箱】Android编译系统(Makefile)
- Redis学习记录之命令Set(十二)