SuperMap.WindowsPhone.Mapping.Map.ZoomToResolution C# (CSharp) Method

ZoomToResolution() public method

public ZoomToResolution ( double resolution, Point2D center, bool skipAnimation ) : void
resolution double
center SuperMap.WindowsPhone.Core.Point2D
skipAnimation bool
return void
        public void ZoomToResolution(double resolution, Point2D center, bool skipAnimation)
        {
            resolution = MathUtil.MinMaxCheck(resolution, MinResolution, MaxResolution);

            double ratio = resolution / this.mapResolution;
            if (!DoubleUtil.AreClose(1.0, ratio) && panHelper != null)//如果同一级别,请pan
            {
                panHelper.Stop(true);
                Rectangle2D bounds = ViewBounds;//如果没有初始化好,这个为空,mapResolution也为nan
                if (!Rectangle2D.IsNullOrEmpty(bounds))
                {
                    if (Point2D.IsNullOrEmpty(center))
                    {
                        center = bounds.Center;
                    }//非数字

                    Rectangle2D targetBounds = new Rectangle2D(center.X - (currentSize.Width / 2) * resolution, center.Y - (currentSize.Height / 2) * resolution, center.X + (currentSize.Width / 2) * resolution, center.Y + (currentSize.Height / 2) * resolution);

                    beginZoomToTargetBounds(targetBounds, skipAnimation);
                }
            }
            else
            {
                if (!Point2D.IsNullOrEmpty(center))
                {
                    this.PanTo(center);
                }
            }
        }

Same methods

Map::ZoomToResolution ( double resolution ) : void
Map::ZoomToResolution ( double resolution, Point2D center ) : void