开发者

Android, draw route on google map

开发者 https://www.devze.com 2023-02-03 11:34 出处:网络
In my android project I want to draw route on Google maps. I have coordinates of start and开发者_开发百科 end points. On this points I get km-filefrom Google web service with points witch across route

In my android project I want to draw route on Google maps. I have coordinates of start and开发者_开发百科 end points. On this points I get km-file from Google web service with points witch across route. For drawing parts of route I use instances of Overlay class. And this solution works, but very slowly. Are there another methods to do that? May be exists ability use built-in Google maps application or any another way?


Right, you can use the built-in google maps application via an intent like this:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);

see this question for more details


there's a tutorial for using KML here: http://csie-tw.blogspot.com/2009/06/android-driving-direction-route-path.html

and some sample code here: How to draw a path on a map using kml file?

it all looks like a lot of overly-complicated hard work - Google should provide API's for this instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消