2012-04-13 11 views
0

私はgdriectionをチェックしますが、色についての何もない、これは私のコード変更色

function direction() 
{ 
    var txtAddress = document.getElementById("<%=txtAddress.ClientID %>"); 

    var address = txtAddress.value; 

    var TextBox1 = document.getElementById("<%=TextBox1.ClientID %>"); 

    var address1 = TextBox1.value; 

    directions = new GDirections(map, directionsPanel); 
    directions.load("from: " + address1 + " to: " + address + ""); 

    // var address =txtAddress.value + " " + TextBox3.value; 

} 

ある

答えて

0

ありがとう地図のGoogleグループでこの同様の答えを参照してください:https://groups.google.com/forum/?fromgroups#!topic/google-maps-api/-1yGOmMwd7I

あなたはGPolyLineをインスタンス化した後に色を変更することはできませんようだが、あなたは2つのGPolyLine Sを構築し、追加/表示するオーバーレイからそれらを削除する必要があります異なる色。任意のより良い知らず

、やっての方法は、それは次のようになります。

  1. GDirectionsコンストラクタGMapを渡さないでください、それはどのGPolyLine sが
  2. の配列を構築 を追加しないように GDirections.getVertex(index)
  3. からGLatLng頂点は 異なる色を使用して独自のGPolyLine Sを構築
  4. オーバーレイ GMap2.addOverlay(GOverlay)
+0

で地図上のGPolyLine私はこのコード 'GEvent.addListener(DIRN、 "負荷"、関数(){ VARポリ= dirn.getPolyline()をしました。 setTimeout( "map.removeOverlay(dirn.getPolyline())"、1); var points = []; for(var i = 0; i user1328645