我正在尝试在js(rails)中绘制简单的折线,但它没有显示任何内容。
function drawlines()
{
var flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
geodesic: true,
strokeColor: '#ff0000',
strokeOpacity: 1.0,
strokeWeight: 25,
map:map
});
flightPath.setMap(map);
console.log('drawn');
}
答案 0 :(得分:0)
我建议使用此代码。在您的代码中,您不需要使用map:map。
的设置试试此代码
function drawlines(){
var flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
geodesic: true,
strokeColor: '#ff0000',
strokeOpacity: 1.0,
strokeWeight: 25,
});
flightPath.setMap(map);
}