Пример #1
0
        static void ZoomCore(DevExpress.XtraMap.Services.IZoomToRegionService zoomService, GeoPoint ptA, GeoPoint ptB, double margin)
        {
            if (ptA == null || ptB == null || zoomService == null)
            {
                return;
            }
            double latPadding  = CalculatePadding(ptB.Latitude - ptA.Latitude, margin);
            double longPadding = CalculatePadding(ptB.Longitude - ptA.Longitude, margin);

            zoomService.ZoomToRegion(
                new GeoPoint(ptA.Latitude - latPadding, ptA.Longitude - longPadding),
                new GeoPoint(ptB.Latitude + latPadding, ptB.Longitude + longPadding),
                new GeoPoint(0.5 * (ptA.Latitude + ptB.Latitude), 0.5 * (ptA.Longitude + ptB.Longitude)));
        }