简体   繁体   中英

Android and draw routes in Google maps

I have a small problem, I need to develop an application that shows the route of public transport, I found tutorials about route of cars.

I saw this example: http://maps.google.com/maps?f=d&hl=en&saddr=25.04202,121.534761&daddr=25.05202,121.554761&ie=UTF8&0&om=0&output=kml

and tried to add dirflg = & rB the URL to show the public transport but server responded with the empty kml.

Does anyone know how to help me?

assuming that you are asking this for android, you can use the following intent

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);

where saddr and daddr are starting and destination address's location coordinates.

same has been discussed in several threads already

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM