使用GMap.NET将鼠标悬停在标记上时,它不会触发事件:
private void gMapControl1_OnMarkerEnter(GMapMarker item)
{
currentMarker = item;
}
private void gMapControl1_OnMarkerLeave(GMapMarker item)
{
currentMarker = null;
}
以下是创建标记的代码:
// Add marker
currentMarker = new GMarkerGoogle(new PointLatLng(y, x), GMarkerGoogleType.yellow_small);
currentMarker.IsHitTestVisible = false;
currentMarker.Tag = iCurrentPolygon + "." + iCurrentPolygonPointIndex;
top.Markers.Add(currentMarker);
我可以添加标记,但当我将鼠标悬停在它们上面时,它不会执行onMarkEnter / onMarkLeave
答案 0 :(得分:0)
我想您需要将library(data.table)
setDT(df)[, indx := cumsum(status == 1)]
df[, if(any(status == -1)) .SD[2:(which(status == -1) - 1)], by = indx]
# indx time status
# 1: 2 4 0
# 2: 2 5 0
# 3: 2 6 0
# 4: 3 10 0
# 5: 3 11 0
# 6: 3 12 0
设置为IsHitTestVisible
,以便标记接收事件通知。