Map on touchscreen

2 posts, 0 answers
  1. Luke
    Luke avatar
    9 posts
    Member since:
    Jan 2015

    Posted 15 May 2015 Link to this post

    Hi - my application works fine with the mouse - panning (left button and drag), zooming (mouse wheel), selecting shapes (left button)

     

    With the above, when selecting a shape, I have a handler for any MapShape and the MouseLeftButtonDown event - works fine.

     

    Now I want to add this flexibility to a touchscreen usage of the same app, so expected (vb.net);

     

        AddHandler shape.MouseLeftButtonDown, AddressOf Shape_MouseLeftButtonDown
        AddHandler shape.TouchDown, AddressOf Shape_TouchDown

     

    ...to work fine for either mouse or touch.  Mouse works fine, but for touch;

    What works - panning (finger and drag), zooming (pinching) - these worked regardless of attempting to integrate touch

    What does not work is the selection of a shape with touch - adding a breakpoint shows that the event is not being hit with the above handler

     

    Any ideas where I am going wrong, thanks

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 19 May 2015 Link to this post

    Hello Luke,

    I guess you use MapShape objets in Information Layer. They are Controls which you usually define in XAML but they are never added in the Visual Tree. You should consider them as wrappers over other objects. MapShapes internally create and use corresponding Framework elements - Ellipse, Path, Line, Rectangle etc. which are added in the Canvas in the Template of the InformationLayer. The MapShape also subscribes for MouseLeftButtonDown / Up, MouseEnter / Leave and some other Mouse events and throws them so that you can subscribe to the MapShape's Mouse events and receive them. The Touch events are not part of this process. Unfortunately, there is no mechanism to access the underlying Shape from the MapShape.

    However, in InformationLayer you can also add the System elements like Rectangle, Path, Line, Polyline and you will be able to subscribe and use the Touch events.
    Also an option you might consider is using the VisualizationLayer which provides mechanism to access its data objects and subscribe to events to their ContentPresenters.

    I am also pleased to inform you that in Q2 we will add TouchManager in our suite and you will be able to use it and subscribe to events like Swipe / Pinch / TapAndHold etc. for better customizations in touch scenarios.


    Regards,
    Petar Mladenov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top