This is a migrated thread and some comments may be shown as answers.

Map on touchscreen

1 Answer 82 Views
Map
This is a migrated thread and some comments may be shown as answers.
Luke
Top achievements
Rank 1
Luke asked on 15 May 2015, 11:39 AM

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

1 Answer, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 19 May 2015, 11:11 AM
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
Tags
Map
Asked by
Luke
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Share this question
or