Closed shreekant123 closed 4 years ago
When you say OK what do you mean. Also what path did you expect to see?
It returns status OK. and I want to show the path between two LatLong
Status OK mean you got the correctly response from the API but you have to check that response have any Latitude/Longitude data to make sure.
@Override
public void onDirectionSuccess(Direction direction) { String status = direction.getStatus(); }
if the value of status is OK means route can be established within the two locations and you are good to go.
use this line of code to get the path
ArrayList<LatLng> directionPositionList = leg.getDirectionPoint(); PolylineOptions polylineOptions = DirectionConverter.createPolyline(this, directionPositionList, 5, Color.RED);
follow this link for more googleMap.addPolyline(polylineOptions);
ArrayList
where i can get "leg"
ArrayList directionPositionList = leg.getDirectionPoint();
where i can get "leg"
Route route = direction.getRouteList().get(0);
Leg leg = route.getLegList().get(0);
that will give you leg
Hi...I am using this. it showing the status OK but not showing a path on map