UWP MapControl指针RoutedEvents [英] UWP MapControl Pointer RoutedEvents

查看:91
本文介绍了UWP MapControl指针RoutedEvents的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我遇到了UWP MapControl的问题。我正在尝试复制Windows 10地图应用的功能,特别是它在我自己的应用中的位置跟踪。但我有一个问题,告诉用户是否已对地图进行了修改。如果用户平移地图,
中心将不再锁定到当前位置(例如W10地图应用)。

Hi all, I have hit a problem with the UWP MapControl. I’m trying to replicate a feature of the Windows 10 Maps app specifically its location tracking in my own app. But I’m having an issue telling if the user has paned the map. If the user pans the map the centre will no longer be locked to the current location (like the W10 Maps app).

我真的想要"处理" "PointerMoved的路由事件(或同样有用的东西),但这似乎不会出现在MapControl中。我已经尝试向CoreWindow和有问题的控件添加一个处理程序,但只有当我超过MapControl

I’d really like to get a "handled" routed event for PointerMoved (or something equally helpful) but this doesn’t appear to emerge from the MapControl. I have tried adding a handler to the CoreWindow and the control in question but only get events (from CoreWindow) when I'm over anything but the MapControl


时才会获取事件(来自CoreWindow)

我已经在这几天工作了所以我可能没有看到"用于树木的树木"!

I've been working on this a few days now so I might not be seeing "the wood for the trees"!

任何想法?

Any ideas?

推荐答案

好的我通过使用  ActualCameraChanged事件(最初对我来说不是很明显)来找到解决方案地图控件。您需要查看事件args上的ChangeReason属性以区分。我希望这可以帮助别人
else。
Ok I've a solution by using the ActualCameraChanged event (which wasn't initially obvious to me to find it there) on the MapControl. You'll need to look at the ChangeReason property on the event args to differentiate. I Hope this helps someone else.


这篇关于UWP MapControl指针RoutedEvents的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆