Disable Map double-click zoom

852
2
Jump to solution
07-26-2017 11:32 PM
by
New Contributor II

I would like to disable the zoom that occurs when you double click the map.

I found a InteractionOptions. So I wrote some code, but is not working.

<sample>
MyMapView. InteractionOptions. IsZoomEnabled=false;
->this code is error.[System. NullReferenceException]

Is there any workaround for this problem?

Reply
0 Kudos
1 Solution

Accepted Solutions
Occasional Contributor III

Hi SK,

First you need to create MapViewInteractionOptions() instance and set the navigation property as below:

// code based

var interactions = new MapViewInteractionOptions() ;
interactions.IsZoomEnabled = false;
MyMapView.InteractionOptions = interactions;

OR

If you would like to do through XAML, you could create the instance in XAML :

<esri:MapView x:Name="MyMapView">
        <esri:MapView.InteractionOptions>
           <esri:MapViewInteractionOptions IsZoomEnabled = false/>
     </esri:MapView.InteractionOptions>

</esri:MapView>

Hope that helps.

Nagma

View solution in original post

2 Replies
Occasional Contributor III

Hi SK,

First you need to create MapViewInteractionOptions() instance and set the navigation property as below:

// code based

var interactions = new MapViewInteractionOptions() ;
interactions.IsZoomEnabled = false;
MyMapView.InteractionOptions = interactions;

OR

If you would like to do through XAML, you could create the instance in XAML :

<esri:MapView x:Name="MyMapView">
        <esri:MapView.InteractionOptions>
           <esri:MapViewInteractionOptions IsZoomEnabled = false/>
     </esri:MapView.InteractionOptions>

</esri:MapView>

Hope that helps.

Nagma

View solution in original post

by
New Contributor II

Hi Nagma.


Thank you very much for your advice.
I could solve the problem by following your advice to revise some code.