3
似乎標題不言自明,但要詳細說明,這裏是我遇到的問題,我有一個折線陣列,我在地圖上顯示,現在我是什麼目標是當我將鼠標懸停在列表中的某條多段線上時,只有該多段線突出顯示(或更改顏色)。我現在所擁有的是這樣的(這個代碼是一個循環,去年底填充polyLineArray個別折線數據中,leafletjs:在鼠標懸停上突出顯示折線
var pointList = [];
// pointList is an array and lat/lngs
var polyLineProperties = {
color: 'red',
opacity: 1,
weight: 5,
clickable: true
}
var polyLine = new L.polyline(pointList, polyLineProperties);
polyLine.on('mouseover', function() {
// WHAT TO DO HERE to HIGHLIGHT that specific polyline.
});
polyLineArray.push(polyLine);
希望有人能夠幫助我,這將是不錯 ,如果有人甚至諮詢如何改變折線的任何屬性,而不僅僅是顏色。
謝謝你,等待你的答覆:)