public Core.GetMaxZoomToFitRect

May 20, 2009 at 1:17 PM

Can you please make public visible

Core.GetMaxZoomToFitRect() ?

Coordinator
May 20, 2009 at 5:53 PM

can i ask why?

May 20, 2009 at 6:25 PM

I have a RectLatLng  (coming from external) and wand to display it on the map in a nice way and want to adjust the slider to the correct value. 

My code:

<font size="2">

 

</font>

int maxZoom = MainMap.Core.GetMaxZoomToFitRect( rect );
if (maxZoom > 0)
{
   PointLatLng center = new PointLatLng(rect.Lat - (rect.HeightLat / 2), rect.Lng + (rect.WidthLng / 2));
   MainMap.CurrentPosition = center;
 
if (MainMap.Zoom != maxZoom)
  {
     MainMap.Zoom = maxZoom;
    
trackBarGeoZoom.Value = MainMap.Zoom;
  }
  else
  {
      MainMap.GoToCurrentPosition();
  }
}
MainMap.ReloadMap();

Coordinator
May 20, 2009 at 6:40 PM

added SetZoomToFitRect, sets zoom to max to fit rect:

if(MainMap.SetZoomToFitRect(rect))
{
   trackBarGeoZoom.Value = MainMap.Zoom;
}

May 20, 2009 at 6:46 PM

Great! Thanks