I have set Polyline click listener like this :
map.setOnPolylineClickListener(new GoogleMap.OnPolylineClickListener() {
public void onPolylineClick(Polyline polyline) {
int strokeColor = polyline.getColor() ^ 0x0000CC00;
polyline.setColor(strokeColor);
Log.e("TAG", "Polyline points @ " + polyline.getPoints());
Toast.makeText(Draw_Route.this, "Polyline klick: " + polyline.getPoints(), Toast.LENGTH_LONG).show();
}
});
But i need to get coordinates of that point when user click on polyline, i also used this code to get the codrinates -- >
map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng clickCoords) {
Log.e("TAG", "Found @ " + clickCoords.latitude + " " + clickCoords.longitude);
}
});
But it only works when i click on map, i need to get that point coordinates on click on polyline so please help me, how to get that.