โดย mindphp » 21/02/2016 9:21 pm
ลบเส้น polyline ออกจาก แผนที่ Google Map กรณีสร้างเส้น google.maps.Polyline
ตัวอย่างการสร้างเส้น
โค้ด: เลือกทั้งหมด
// flightPlanCoordinates = []; // กำหนด พิกัดเป็น array
//เช่น
var flightPlanCoordinates = [
{lat: 13.847, lng: 100.358},
{lat: 13.926, lng: 100.498},
{lat: 13.892, lng: 100.660},
];
flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
geodesic: true,
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 3
});
// ลากเส้น
flightPath.setMap(map);
กำหนดไม่ให้เส้นแสดง กรณีจะลบออกจาก Map
ลบเส้น polyline ออกจาก แผนที่ Google Map กรณีสร้างเส้น google.maps.Polyline
ตัวอย่างการสร้างเส้น
[code]// flightPlanCoordinates = []; // กำหนด พิกัดเป็น array
//เช่น
var flightPlanCoordinates = [
{lat: 13.847, lng: 100.358},
{lat: 13.926, lng: 100.498},
{lat: 13.892, lng: 100.660},
];
flightPath = new google.maps.Polyline({
path: flightPlanCoordinates,
geodesic: true,
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 3
});
// ลากเส้น
flightPath.setMap(map);[/code]
กำหนดไม่ให้เส้นแสดง กรณีจะลบออกจาก Map
[code]flightPath.setVisible(false);[/code]