function drawLine()
{
var mapPoints =[ new GPoint(137.95349836349487, 36.11501414709515), // 塩尻市役所
new GPoint(137.9720163345337, 36.237999619827065), // 松本市役所
new GPoint(137.96929121017456, 36.23846690961747) // 松本城
];
poly = new GPolyline(mapPoints, "#ff0000",10,0.5);
map.addOverlay(poly);
}
function removeLine()
{
map.removeOverlay(poly);
}
//]]>
</script>
<form>
<input type="button" value="線を描画" onClick="drawLine()" />
<input type="button" value="線を消去" onClick="removeLine()" />
</form>
</body>
</html>