Ejemplo n.º 1
0
        public void NavigateTo(GeolocationPlace place)
        {
            if (place != null && !this.CurrentLocation.Equals(place.Location))
            {
                _gmapControl.SuspendLayout();
                var fakeRoute = _gmapControl.Overlays
                                .SelectMany(x => x.Routes)
                                .Where(x => x.Tag is Place)
                                .FirstOrDefault(x => ((Place)x.Tag).PlaceName.Equals(place.Name));
                if (fakeRoute != null)
                {
                    var rectToZoom = _gmapControl.GetRectOfRoute(fakeRoute);
                    if (rectToZoom != null)
                    {
                        _gmapControl.SetZoomToFitRect(rectToZoom.Value);
                    }
                }
                _gmapControl.Zoom -= 2;
                _gmapControl.ResumeLayout();

                UpdateCurrentCoords();
            }
        }