[英]changing color of google map api v2
我如何在檢查了gdriection的Google Map API中更改方向線的顏色,但是沒有任何關於顏色的內容,這是我的代碼
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;
}
謝謝
在Google Maps網上論壇中看到以下類似答案: https : //groups.google.com/forum/?fromgroups#!topic/ google-maps-api/ -1yGOmMwd7I
實例化GPolyLine
,您似乎無法更改顏色,因此您需要構建兩個GPolyLine
並從疊加中添加/刪除它們以顯示不同的顏色。
不知道有什么更好的辦法,那就是:
GDirections
構造函數GMap
,因此它不會添加任何GPolyLine
。 GDirections.getVertex(index)
構建一個GLatLng
頂點數組 GPolyLine
GMap2.addOverlay(GOverlay)
在地圖上覆蓋GPolyLine
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.