ThinkGeo.com    |     Documentation    |     Premium Support

V10 to V12 .. ZoomOutToOffsetPoint

V10: ExtentHelper.ZoomOutToOffsetPoint(this.WorldExtent, this.Size.Width,
this.Size.Height, new ScreenPointF(aScreenX, aScreenY), 10)

V12? ThinkGeo.Core.MapUtil?

Thanks Ernest,
You can use ThinkGeo.Core.MapUtil.ZoomToScale()

Thanks

Frank

I am using ZoomOutToOffsetPoint with a MouseEvent. So how do you set the scale? See below:

    public bool MouseEvent(Maps.EventOverlay.EventType aType, float aScreenX, float aScreenY, System.Windows.Forms.MouseButtons aButton)
    {
        if (!this.IsVisible) return false;
        PointF ScreenPoint = new PointF(aScreenX, aScreenY);
        if (aType == EventOverlay.EventType.Move) return MouseMove(ScreenPoint, aButton);
        if (aType == EventOverlay.EventType.Up) return MouseUp(ScreenPoint, aButton);
        if (aType == EventOverlay.EventType.WheelMinus)
        {
            if (this.ActionNewExtent != null)
                ActionNewExtent(MapUtil.ZoomOutToOffsetPoint(this.WorldExtent, this.Size.Width, 
                    this.Size.Height, new ScreenPointF(aScreenX, aScreenY), 10));
            return true;
        }
        if (aType == EventOverlay.EventType.WheelPlus)
        {
            if (this.WorldExtent != null && this.ActionNewExtent != null)
            {
                RectangleShape W = ThinkGeo.Core.MapUtil.ZoomIntoOffsetPoint(this.WorldExtent, this.Size.Width,
                    this.Size.Height, new ScreenPointF(aScreenX, aScreenY), 10);
                ActionNewExtent(W);
            }
            return true;
        }
        return false;
    }

I think this will work:

ActionNewExtent(MapUtil.ZoomToScale(10, this.WorldExtent, GeographyUnit.Meter, this.Size.Width, this.Size.Height, new ScreenPointF(aScreenX, aScreenY)));

Good to know it works. I am going to close this one. Go ahead let us know if you have any more questions.

Thanks

Frank