New to Telerik UI for Xamarin? Download free 30-day trial

Commands

RadMap provides the following commands of type ICommand which handle the zoom level of the visualized shapes:

  • ZoomInCommand

  • ZoomOutCommand

You can manually call these commands, for example on button click action, to zoom-in or zoom-out respectively, the shapes displayed in RadMap.

Following is a quick example on how the commands of the Map control can be called from external UI:

Let's have the following Map definition:

<telerikMap:RadMap x:Name="map" MinZoomLevel="2" MaxZoomLevel="5">
    <telerikMap:RadMap.Layers>
        <telerikMap:ShapefileLayer>
            <telerikMap:ShapefileLayer.Reader>
                <telerikMap:MapShapeReader x:Name="reader"/>
            </telerikMap:ShapefileLayer.Reader>
        </telerikMap:ShapefileLayer>
    </telerikMap:RadMap.Layers>
</telerikMap:RadMap>

where the Source of the MapShapeReader is defined like this:

var assembly = this.GetType().Assembly;
var source = MapSource.FromResource("SDKBrowser.Examples.MapControl.world.shp", assembly);
this.reader.Source = source;

Lastly, add two buttons that will execute the Map commands - their Command property is bound to the corresponding Zoom command of the Map instance:

<Button Text="Zoom In" Command="{Binding Source={x:Reference map}, Path=ZoomInCommand}"/>
<Button Text="Zoom Out" Command="{Binding Source={x:Reference map}, Path=ZoomOutCommand}"/>

See Also

In this article