Android GoogleMap draw line through a known way - android

I am using Google Map Api V2 and I can marker or draw a line between two points.But I try to draw a line through the route of a bus.So Route,Ways,Stopping places...etc of the bus are already known.First of all, I tried to find all LatLong values of the route and I draw it as polylines but I guess it is wasting time.So I want to draw line without find out all LatLong points of route of the bus.Is there any way ?
Thanks for the help..

You can use the Directions API to get the directions between two points, but this probably wont match your bus routes.

Related

Android Studio - V2 Maps - check if polyline intersects other polyline

i am getting a fully loaded map in my android app, and i am getting some directions waypoint using the directions API. What i would like to accomplish now is check if the desired route form A to B intersects with another polyline.
Can someone shed some light into this?
Thank you very much, cheers!
Loop for each straight line in first polyline
Loop for each straight line in second polyline
Test if both straight lines intersect. They both intersects if there exists one point that both line share.
Line equation if endpoints are known:

Why polygon line shows far from road in google maps in android?

I draw a polygon between two latitude and longitude but polygon line shows far from road.
Like the picture above, blue polygon line shows far from road. Where polygon line is draw there is no road. Anyone can help me to draw right polygon between two latitude and longitude.
Thank you!
If you want draw a route between two address, you should use Directions API.
or relative to this post google-maps-api-v3-how-show-the-direction-from-a-point-a-to-point-b-blue-line

is it possible to draw on road based on a location near it

I am currently developing an application that tracks your path, so it always draws on the map. I want to know if it is possible to draw on the road, since my application gets my location and its not precise, its always near(about 30 m radius) me. I want it not to add it where it is, but on the nearest road
You can draw the path on the map using the Ployline class of Google Map as below:
Polyline line=myMap.addPolyline(new PolylineOptions().add(new LatLng(location.getLatitude(),location.getLongitude())).color(Color.RED));
For more details about it please refer here

How to Draw line between two points in google map in android?

Merged with Draw line between two points in google map in android [duplicate].
I am new in android.I want to draw a distance line between to points in Google map.I can't do this. Please help me in solve my problem

Google Maps - MapView - draw a nice flight route between 2 points

I wonder,
how can I draw a nice flight route between 2 points on a google map's
MapView?
look at this:
http://maps.forum.nu/gm_flight_path.html
this is exactly what I need.
thanks!
Look at my reply to question
How to draw a path on a map using kml file?
and there especially into the RouteOverlay class / draw method.
Since you only want to draw a simple straight line, you probably won't need the rest of the complexity there.

Categories

Resources