trackPath.setMapth(null);
マップ上のポリライン オーバーレイをクリアする を設定しています。ここで追加した関数の最後で実行されます。ここでは cosole.log (関数を参照) が最初に出力され、次に trackPath.setMap(null) がクリアされます。
function play(id, value) {
clearTimeout(timerForTrack);
trackPath.setMap(null);
trackPath = null; // removing this line too makes the same thing
console.log("this is coming first than clearing the track");
// some commented code
}
私はこの仕事に4時間取り組んでいます。問題は、それをクリアした後に新しいポリラインを追加する必要があることです。私が間違っているアイデアはありません。