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

Map Touch screen right click

Aug 24, 2015 at 1:54 PM
Hi is it possible to send the Touch gestures to the map children? Like the hold gesture ect. And if possible how, any help would be appreciated.
Coordinator
Aug 24, 2015 at 5:19 PM
That shouldn't be too complicated. Have you tried anything? Which platform are we talking about?
Aug 25, 2015 at 7:59 AM
No stated playing with it no idea where to start, I have context menus on the map and on most of the map children (right click) and have routed mouse events, I want them to trigger with touch gestures, but seems that on the map all touch gestures are e.Handle before the mouse event triggers. I am using vs 2015 wpf 4.5 windows 64bit. Thank you very much for replying, Is there anything you can suggest, any help would be nice.
Coordinator
Aug 25, 2015 at 8:23 AM
The map control doesn't explictly handle any Touch events. The only touch-related code is in class Map, which overrides OnManipulationStarted and OnManipulationDelta. Instead of class Map you may use MapBase, which does not have any input handling. You may take a look at the code in Map.WPF.cs to see what you would have to do to implement your own input handling.
Aug 25, 2015 at 9:17 AM
Thank you I will implement with mapbase and will let you know if it works. Thank you
Aug 25, 2015 at 9:35 AM
Right click gesture does not work but touch down now executes left mouse click the OnManipulation did effect it , Is there any reason why the touch hold (right click) would not work? Thanks I will look if I can find anything
Aug 26, 2015 at 4:45 PM
Try this:
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
{
    base.OnManipulationCompleted(e);

    if (e.TotalManipulation.Translation.X == 0 && e.TotalManipulation.Translation.Y == 0) //revert to right-click
    {
        e.Cancel();
    }
}