ZoomInCommand not working when bound to a button command

Hi Pascal, 
 
Thanks for contacting Syncfusion support. 
 
We have analyzed your query; currently zooming and panning commands are working only for ShapeFileLayer. We don’t have zooming command support for ImageryLayer. When using zooming command for imagery layer, this layer casting into shapes layer, hence exception thrown.  
We have considered zooming commands support for imager layer as a feature enhancement and it will be available in any of our upcoming releases. 
 
Regards, 
Yogapriya.S 


1 Reply

PD Pascal Desmet July 26, 2018 12:55 PM UTC

Hi,

when I try to bind the ZoomInCommand of a map to a button's command property, I get exception 'System.NullReferenceException: 'Object reference not set to an instance of an object.' during runtime at the maps ZoomInCommand.Execute(object) line.
Zooming using the scrollwheel of my mouse works fine.
How can I provide buttons for zooming and panning in my application.

Kind regards,
Pascal Desmet


The Xaml is straightforward:
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:TestMaps"
             xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
           
               
               
           

           
               
                   
               
           

Grid.Row="1"
Command="{Binding ElementName=Map, Path=ZoomInCommand}"
Content="Zoom In" />
       
   
   

Top lines of the stack trace:
 at Syncfusion.UI.Xaml.Maps.ZoomInCommand.Execute(Object parameter)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()


Loader.
Up arrow icon