Android的 - 要画两个地理点之间的路线 [英] Android - To draw a route between two geo points

查看:82
本文介绍了Android的 - 要画两个地理点之间的路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的方向班,我有两个地缘points.One对应于当前位置和其他是一个固定的地理point.Current地位将不断changing.I需要绘制路线在这两点之间,需要改变这一行换一换在距离5亿。

In my direction class I have two geo points.One corresponds to current position and other is a fixed geo point.Current position will keeps changing.I need to draw route between these two points and need to change this line for a change in distance of 500m.

推荐答案

我认为最好的解决方案被称为Android的内部地图,活动,显示两个地理点之间的路线。请参考下code。

I think best solution is called android internal map activity to show route between two geo points . Please refer below code.

String uri = "http://maps.google.com/maps?saddr=" + currentLatitude+","+currentLongitude+"&daddr="+fixedLatitude+","+fixedLongitude;
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
startActivity(intent);

呼吁建于地图的活动,借鉴当前和固定的经度和纬度之间的路由路径。

It called built in map activity and draw a route path between current and fixed latitude and longitude.

这篇关于Android的 - 要画两个地理点之间的路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆