我在我的项目中加入了Google Maps V2,我正试图在两个位置之间找到行车方向:
List<Position> RouteCoordinates = new List<Position>();
RouteCoordinates.Add(new Position(37.7850268, -122.4005109));
RouteCoordinates.Add(new Position(37.780624, -122.390541));
var polylineOptions = new PolylineOptions();
polylineOptions.InvokeColor(0x66FF0000);
foreach (var position in RouteCoordinates)
{
polylineOptions.Add(new LatLng(position.Latitude, position.Longitude));
MarkerOptions marker = new MarkerOptions();
marker.SetPosition(new LatLng(position.Latitude, position.Longitude));
gmap.AddMarker(marker);
}
gmap.AddPolyline(polylineOptions);
但这在两点之间画了一条直线......有没有办法让这两点之间有行车路线?