//-------------------------------------------------------------------------
        // Centres the map on the given point and sets the view width and height
        public void ChangeView(double centreLatDeg, double centreLonDeg, double widthDeg, double heightDeg)
        {
            Point a = new Point(centreLonDeg - widthDeg / 2, centreLatDeg - heightDeg / 2);
            Point b = new Point(centreLonDeg + widthDeg / 2, centreLatDeg + heightDeg / 2);

            if (DataTransform != null)
            {
                a = DataTransform.DataToViewport(a);
                b = DataTransform.DataToViewport(b);
            }

            Dispatcher.Invoke(() =>
            {
                Visible = new DataRect(a, b);
            });
        }
        //-------------------------------------------------------------------------
        // Centres the map on the given point without changing the zoom level/width/height
        public void CentreOn(double latDeg, double lonDeg)
        {
            if (latDeg.IsNaN() || lonDeg.IsNaN())
            {
                return;
            }

            var centre = new Point(lonDeg, latDeg);

            if (DataTransform != null)
            {
                centre = DataTransform.DataToViewport(centre);
            }

            centre.X -= (Visible.Size.Width / 2);
            centre.Y -= (Visible.Size.Height / 2);

            Visible = new DataRect(centre, Visible.Size);
        }