private void AddRouteMarkerFromGhostMarker(GhostPoint ghostPoint, GMapRoute route)
        {
            var routeMarker = new RoutePointMarker(ghostPoint.Marker.Position,
                                                   ghostPoint.IndexPoint,
                                                   route);

            //_routeMarkers.Remove(ghostPoint.Marker);
            _routeMarkers.Insert(ghostPoint.IndexPoint, routeMarker);

            _routeOverlay.Markers.Add(routeMarker);

            route.Points.Insert(ghostPoint.IndexPoint, routeMarker.Position);

            //RemoveGhostPointAt(ghostPoint.IndexPoint , route);

            for (int i = ghostPoint.IndexPoint + 1; i < _routeMarkers.Count; i++)
            {
                if (IsGhostPointExistForIndex(_routeMarkers[i].RoutePointIndex, route))
                {
                    GetGhostPointForIndex(_routeMarkers[i].RoutePointIndex, route).SetIndexPoint(i);
                }

                ((RoutePointMarker)_routeMarkers[i]).SetRouteIndex(i);
            }


            //for (int i = ghostPoint.IndexPoint + 1; i < _ghostPointDictionary[route].Count; i++)
            //{
            //    _ghostPointDictionary[route][i].SetIndexPoint(i + 1);
            //}

            _selectedMarker = routeMarker;

            //CreateGhostPoint(ghostPoint.IndexPoint-1, routeMarker.Position, route);
        }
        private void TestRoute()
        {
            Core.FileManager.OpenGPSFilesManager fileManager = new Core.FileManager.OpenGPSFilesManager();
            var file = fileManager.GetFile(@"C:\Users\Public\Documents\GPX\538211.gpx");

            _routeOverlay.IsVisibile = true;
            navigationalMapControl1.Overlays.Add(_routeOverlay);

            if (file.Tracks.Count > 0)
            {
                Core.NavigationElements.Services service = new Core.NavigationElements.Services();
                _tempTrack = service.TrackSimplifier(file.Tracks[0]);

                navigationalMapControl1.DrawTrack(_tempTrack, true);

                List <GMapRoute> routes = navigationalMapControl1.GetRoute(_tempTrack);

                foreach (GMapRoute route in routes)
                {
                    for (int i = 0; i < route.Points.Count; i++)
                    {
                        var marker = new RoutePointMarker(route.Points[i], i, route);
                        marker.IsVisible = true;
                        _routeMarkers.Add(marker);
                        _routeOverlay.Markers.Add(marker);
                    }
                }
            }
        }
        void navigationalMapControl1_MouseMove(object sender, MouseEventArgs e)
        {
            if (_selectedMarker != null)
            {
                _selectedMarker.Position = navigationalMapControl1.FromLocalToLatLng(e.X, e.Y);

                if (_selectedMarker is RoutePointMarker)
                {
                    RoutePointMarker marker = (RoutePointMarker)_selectedMarker;

                    var point = marker.Route.Points[marker.RoutePointIndex];

                    point.Lat = _selectedMarker.Position.Lat;
                    point.Lng = _selectedMarker.Position.Lng;

                    marker.Route.Points[marker.RoutePointIndex] = point;

                    CalculateGhostMarker(marker.Route, marker.RoutePointIndex);

                    marker.Route.Overlay.ForceUpdate();
                }
            }
        }