Beispiel #1
0
        void SetViewOnCenter()
        {
            if (!double.IsNaN(ViewLatitude) && !double.IsNaN(ViewLongitude))
            {
                WorldCoordinate lookAt = new WorldCoordinate() { Latitude = ViewLatitude, Longitude = ViewLongitude };
                lookAt.Clamp();

                Point absoluteLoc = Translator.CoordinateToPixels(lookAt);
                Point newCorner = new Point(absoluteLoc.X - ActualWidth / 2, absoluteLoc.Y - ActualHeight / 2);

                WorldCoordinate desiredUpperLeft = Translator.PixelsToCoordinates(newCorner);

                CornerLatitude = desiredUpperLeft.Latitude;
                CornerLongitude = desiredUpperLeft.Longitude;
            }
        }