ボタンクリックで方向を生成しようとしています。ユーザーはポイント a とポイント b の位置を選択し、ボタンを押して、そのポイント a からポイント b への描画方向をコードします。このコードを正常に完了しましたが、地図に描かれた以前の方向を削除できません。画像リンクhttp://i.stack.imgur.com/z1fqo.pngをご覧ください 。最後の方向だったので、マップから a,b 方向を削除したいと思います。
$et_main_map.gmap3({
getroute:{
options:{
origin:org,
destination:dest,
travelMode: google.maps.DirectionsTravelMode.DRIVING
},
callback: function(results){
console.log(results);
if (!results) return;
$(this).gmap3({
directionsrenderer:{
divId:'directionPath',
options:{
directions:results,
suppressMarkers: true
}
}
});
}
}
});
上記のコードは、方向を追加します。以下のコードは、地図上の道順を削除していません。
$et_main_map.gmap3({
clear: {
name:["directionRenderer"]
}
});
以下のリンクをたどるなど、多くのことを試しました。 http://gmap3.net/forum/viewtopic.php?id=341 Gmap3 明確なルート案内
私を助けてください。ありがとう