Googleマップで複数のポリラインを描画してスタイルを設定できますが、各ポリラインを異なる色で色付けしたいと思います。GoogleマップAPIを使用して、異なる色の複数のポリラインを描画するV3 ASP.net
現在、私はこのコードを持っている:
var DrivePath = [
new google.maps.LatLng(37.772323, -122.214897),
new google.maps.LatLng(21.291982, -157.821856),
new google.maps.LatLng(-18.142599, 178.431),
new google.maps.LatLng(-27.46758, 153.027892),
new google.maps.LatLng(12.97918167, 77.6449),
new google.maps.LatLng(12.97918667, 77.64487167),
new google.maps.LatLng(12.979185, 77.64479167),
new google.maps.LatLng(12.97918333, 77.64476)
];
var PathStyle = new google.maps.Polyline({
path: DrivePath,
strokeColor: "#FF0000",
strokeOpacity: 1.0,
strokeWeight: 2
});
PathStyle.setMap(map);
は私が作成していた各ポリラインに別々のスタイルを追加することができます方法はありますか?
を描画するために、あなたは、複数のポリラインを描画するためのコードを共有してくださいでした。私はあなたのコードをテストしましたが、私はマップ内に1行だけを表示することができます – Dibish