ComponentOne Maps for WinForms
Working with Map Control / Repositioning Map Tools
In This Topic
    Repositioning Map Tools
    In This Topic

    The tools in the Map control are positioned on the left side of a map. Although, you can change their position according to your requirements. Following code illustrates repositioning of the map tools:

    C1Map1.TileLayer.TileSource = New VirtualEarthAerialSource()
    C1Map1.DistanceScale.Alignment = ContentAlignment.BottomRight
    C1Map1.PanTool.Alignment = ContentAlignment.TopCenter
    C1Map1.ZoomTool.Alignment = ContentAlignment.MiddleLeft
    C1Map1.ZoomTool.Orientation = Orientation.Horizontal
    
    c1Map1.TileLayer.TileSource = new VirtualEarthAerialSource();
    c1Map1.DistanceScale.Alignment = ContentAlignment.BottomRight;
    c1Map1.PanTool.Alignment = ContentAlignment.TopCenter;
    c1Map1.ZoomTool.Alignment = ContentAlignment.MiddleLeft;
    c1Map1.ZoomTool.Orientation = Orientation.Horizontal;
    

    On repositioning the tools on a map, the map will look similar to the image given below.

     Appearance of map after repositioning tools on map

    C1Map also allows you to set the custom location and size of a map tool by setting the Bounds property. Following code demonstrates the use of Bounds property to set the custom location and size of the Pan tool:

    C1Map1.PanTool.Bounds = New Rectangle(100, 100, 100, 100)
    
    c1Map1.PanTool.Bounds = new Rectangle(100, 100, 100, 100);