2
我有一組編碼多段線,從方向服務的結果中檢索,我已經將它們存儲在一個php數組中。使用API v3繪製多個編碼多段線
通過下面的代碼,我可以添加一條折線。如何修改它以同時添加多條多段線?
var code = '_mjsB{qp{[email protected]@[email protected]@[email protected]@[email protected]@VW^[email protected]`B{@[email protected]`@KvEyB`[email protected]';
var paths = google.maps.geometry.encoding.decodePath(code);
var flightPath = new google.maps.Polyline({
path:pathss,
strokeColor: "#0000FF",
strokeOpacity: 1.0,
strokeWeight: 2
}); flightPath.setMap(map);
此[POST](http://stackoverflow.com/questions/14379586/drawing-multiple- polyline-with-different-color-using-google-map-api-v3-asp-net)可能會幫助您 – 2013-03-24 17:31:50