0

Google マップを初めて使用します。マップの 2 番目のポリラインの色を変更しようとしています。

これが私がこれまでに持っているものです〜

var direction = new GDirections(); 

direction.load("from: Oregon 99, near, Halsey, Oregon to: Oregon 34, near, Tangent, Oregon to: Interstate 5, near, Tigard, Oregon to: Oregon 217, near, Cedar Hills, Oregon to: U.S. 26, near, North Plains, Oregon to: U.S. 26, near, Tigard, Oregon to: Interstate 405, near, Portland, Oregon to: Interstate 5, near, Vancouver, Wa to: Interstate 5, near, Carrolls, Wa to: Washington 432,  near, Longview, Wa to: Washington 433, near, Rainier, Oregon to: U.S. 30, Wauna, Oregon", {getPolyline:true});

GEvent.addListener(direction, 
                   "load", 
                   function(){ map.addOverlay(direction.getPolyline()); }
);

誰かがこのポリラインを他の色に変更するのを手伝ってくれませんか?

4

1 に答える 1

0

direction.getPolyline()変数をオーバーレイとして追加する前に変数に入れてから、追加後に変数を呼び出すGPolyline.setStrokeStyle(GPolyStyleOptions)ことができます。GPolyline.setStrokeStyle()およびGPolyStyleOptionsのリファレンスを次に示します。

于 2012-10-03T08:39:04.300 に答える