public GMarkerRect(GMarkerTrack marker) : base(marker.Position) { IsHitTestVisible = true; InnerMarker = marker; Size = new Size(30, 30); Offset = new Point(-Size.Width / 2, -Size.Height / 2); }
private void trackHandler_TrackUpdate(TrackData item) { GMarkerRect rect = trackMarkers[item.Key]; GMarkerTrack marker = rect.InnerMarker as GMarkerTrack; rect.SetPosition(item.Position); marker.Track = item; mainMap.Invalidate(); }
private void trackHandler_TrackCreate(TrackData item) { MessageBox.Show("Track Event Add"); GMarkerTrack marker = new GMarkerTrack(item); GMarkerRect rect = new GMarkerRect(marker); trackOverlay.Markers.Add(marker); trackOverlay.Markers.Add(rect); trackMarkers.Add(item.Key, rect); }
private void trackHandler_TrackRemove(TrackData item) { GMarkerRect rect = trackMarkers[item.Key]; GMarkerTrack marker = rect.InnerMarker as GMarkerTrack; trackOverlay.Markers.Remove(marker); trackOverlay.Markers.Remove(rect); markerOverlay.Markers.Remove(marker); rect.Dispose(); trackMarkers.Remove(item.Key); }
private void trackHandler_TrackClear() { trackHandler.Tracks.ForEach(x => { GMarkerRect rect = trackMarkers[x.Key]; GMarkerTrack marker = rect.InnerMarker as GMarkerTrack; trackOverlay.Markers.Remove(marker); trackOverlay.Markers.Remove(rect); rect.Dispose(); }); trackMarkers.Clear(); }