0

my codes already get the polyine between two points but what I want to be able to display on Google Map is the routing direction similar to polyines from one point say A to another say B. Any ideas on how I can display routing directions. Here is my code in asp.net c# that gets the polyline:

List<LatLng> Coords = new List<LatLng>();
while (reader.Read())
{
    // perhaps even: lat = reader.GetDouble(0);
    lat = Convert.ToDouble(reader[0].ToString());
    log = Convert.ToDouble(reader[1].ToString());

    // add the next point in the polyline
    Coords.Add(new LatLng(lat, log));
}

GMap.Add(new PolyLine(Coords, Color.Red, 100f, 2, new InfoWindow("")));

// Lastly, identify the center of the polyline and add that point:
GMap.Center = Coords[Coords.Count / 2];
GMap.ZoomLevel = 12;
GMap.Add(new ImageMarker(GMap.Center, " ", new InfoWindow(""), "");

Thanks in advance.

4

1 回答 1

0

谷歌有一个你可以使用的路由 API 。

于 2013-07-02T18:51:30.263 回答