Hello,
i need help to remove polylines on my map
i made a sqlite database with coordonates, i get this by this function:
function viewtracing()
{
db.transaction(function (tx) {
tx.executeSql('SELECT * FROM tracker', [], function (tx, results) {
var len = results.rows.length, i;
var str=""
var point;
var flightPlanCoordinates=new Array();
var map = $('[id$=map1]').gmap();
for (i = 0; i < len; i++){
//str += results.rows.item(i).latitude + ","+results.rows.item(i).longitude+"/";
point = new google.maps.LatLng(
parseFloat(results.rows.item(i).latitude),
parseFloat(results.rows.item(i).longitude));
flightPlanCoordinates[i]=point;
}
var flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
strokeColor: "#FF0000",
strokeOpacity: 1.0,
strokeWeight: 2
});
flightPath.setMap(map);
}, null);
});
}
i have also a button “Remove” who’s calling clear function
I tried this and many other things without success
function clearroute() {
var map = $('[id$=map1]').gmap();
var flightPath = new google.maps.Polyline({
path: []
});
flightPath.setMap(null);
}
i’m not familiar with google map v3 api 🙁
if anyone can help me
thanks
Yann