gpt4 book ai didi

windows - UWP map 控制 : distinction between user- and app-manipulation

转载 作者:可可西里 更新时间:2023-11-01 11:16:45 24 4
gpt4 key购买 nike

在包含 MapControl 的 UWP-App 中,是否有一种方法可以区分用户对 map 的操作(例如,通过捏合缩放)和应用程序本身对 map 进行的操作? (例如,通过调用 mapControl.TrySetViewAsync(...))

似乎没有相应的事件处理程序,对吗?我已经尝试了几个(比如 LoadingStatusChangedCenterChanged),但它们都没有在用户操作和应用程序操作之间产生任何区别。

最佳答案

您应该能够注册以接收 TargetCameraChanged map View 更改时将触发的事件。 MapTargetCameraChangedEventArgs返回包含 ChangeReason属性(property)。

ChangeReason 属性将为SystemUserInteractionProgrammatic

由调用 API(例如 TrySetViewAsync(...) 引起的事件导致具有 ChangeReason == Programmatic 的 map 移动,以及由用户操作(例如捏合)引起的移动zoom 应该有 ChangeReason == UserInteraction

关于windows - UWP map 控制 : distinction between user- and app-manipulation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37694384/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com