GMap.Net开发之自定义Marker使用方法(5)

void blinkTimer_Tick(object sender, EventArgs e)
        {
            foreach (GMapMarker m in objects.Markers)
            {
                if (m is GMapMarkerImage)
                {
                    GMapMarkerImage marker = m as GMapMarkerImage;
                    if (marker.OutPen == null)
                        marker.OutPen = new Pen(Brushes.Red, 2);
                    else
                    {
                        marker.OutPen.Dispose();
                        marker.OutPen = null;
                    }
                }
            }
            mapControl.Refresh();
        }

private void buttonStopBlink_Click(object sender, EventArgs e)
        {
            blinkTimer.Stop();
            foreach (GMapMarker m in objects.Markers)
            {
                if (m is GMapMarkerImage)
                {
                    GMapMarkerImage marker = m as GMapMarkerImage;
                    marker.OutPen.Dispose();
                    marker.OutPen = null;
                }
            }
            mapControl.Refresh();
        }
    }
}

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjgyxd.html