1
私はC#アプリケーションを作っています。私はGoogleマップを使用して、私は異なる色の2つのルートを描きたい。例:最初のものは赤、2番目の緑は緑ですが、どちらも緑です。 最初の色になるように第2色を変更したいstay the same
です。C#を使用してGoogleマップに色分けされたルートを描くにはどうすればよいですか?
これは私のコードです:
PointLatLng start1 = new PointLatLng(42.252938, 42.680411);
PointLatLng end1 = new PointLatLng(42.256321, 42.675658);
GDirections dir1;
var path1 = GMapProviders.GoogleMap.GetDirections(out dir1, start1, end1, false, false, true, true, true);
GMapRoute route1 = new GMapRoute(dir1.Route, "path1");
route1.Stroke.Color = Color.Red;
GMapOverlay lay1 = new GMapOverlay("route1");
lay1.Routes.Add(route1);
map.Overlays.Add(lay1);
PointLatLng start2 = new PointLatLng(42.259188, 42.670733);
PointLatLng end2 = new PointLatLng(42.259617, 42.673362);
GDirections dir2;
var path2 = GMapProviders.GoogleMap.GetDirections(out dir2, start2, end2, false, false, true, true, true);
GMapRoute route2 = new GMapRoute(dir2.Route, "path2");
route2.Stroke.Color = Color.Green;
GMapOverlay lay2 = new GMapOverlay("route2");
lay2.Routes.Add(route2);
map.Overlays.Add(lay2);
ありがとう。できます! –