This project has moved. For the latest updates, please go here.

IsRotateEnabled

May 6, 2013 at 8:34 PM
https://xamlmapcontrol.codeplex.com/SourceControl/network

Is it possible to have the change in the IsRotateEnabled fork merged? I made the same change myself before I knew the fork existed. IsZoomEnabled and IsPanEnabled could also be added in a similar way.
Coordinator
May 7, 2013 at 7:44 AM
Edited May 7, 2013 at 5:03 PM
Such a property is not necessary, and I must say that it would have been a good idea if user vinodkhare would have started a discussion here instead of just forking the code.

The map control is separated into classes MapBase and Map. The former has no input handling, whereas the latter is derived from MapBase and exists only to implement some kind of default input handling. It has a very simple ManipulationDelta event handler where it does
TransformMap(e.ManipulationOrigin,
    (Point)e.DeltaManipulation.Translation, e.DeltaManipulation.Rotation,
    (e.DeltaManipulation.Scale.X + e.DeltaManipulation.Scale.Y) / 2d);
You could easily derive you own map class from MapBase and implement your custom input handling that ignores the Rotation value.

Another solution would be to restrict the ManipulationModes that are enabled during manipulation input. You would have to do that in a ManipulationStarted event handler:
map.ManipulationStarted += (o, e) => Manipulation.SetManipulationMode(
    map, ManipulationModes.Scale | ManipulationModes.Translate);
May 7, 2013 at 6:51 PM
Why should a user have to derive their own class when adding a simple property provides that functionality?
May 7, 2013 at 7:14 PM
I agree. For me, the properties seem like basic functionality that should be included. And by adding them as dependency properties, it allows them to be set and bound in XAML.
Coordinator
May 7, 2013 at 8:12 PM
Edited May 7, 2013 at 8:25 PM
Actually, you don't need to derive from MapBase. Just set an appropriate ManipulationMode in a ManipulationStarted event handler as shown above.

Having said that, a sensible way to add a property that controls manipulation behaviour would be to resemble the UIElement.ManipulationMode property from WinRT. See here: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.manipulationmode.aspx.

I may give this a try.
May 7, 2013 at 8:31 PM
One way, as becoming popular with Blend, is to use Behaviours instead.. i.e. separate the map functionality from user interactivity. My post on Zoom Select explains this approach. My fork on this has paid dividends for me anyway. This approach basically means that you add in the users capabilities to manipulate the map by adding Behaviours. This means ClemensF doesn't keep having to add new properties for this an that behaviour such as rotate and zoom. Just a thought..
May 8, 2013 at 2:04 PM
Yes, something like UIElement.ManipulationMode described above is more versatile and would be good to have.
Coordinator
May 8, 2013 at 3:14 PM
Added a ManipulationMode property to the WPF version of class Map. You may now set something like this in XAML:
<m:Map ManipulationMode="Scale,Translate" ... />
May 8, 2013 at 5:29 PM
Thanks! It is helpful to have access to the manipulations through XAML.