Bing 地图 AJAX Control V7 - 如何检测点击但不检测拖动?
我的网页上有一个 Bing 地图,我想检测用户何时单击窗口。但是,我不希望检测用户何时拖动地图(这也会生成“单击”事件)。仅获取“纯”点击事件的最佳方法是什么?
I have a Bing map on my web page, and I want to detect when the user clicks in the window. However, I do not wish to detect when the user drags the map (this also generates a "click" event) . What is the best way to get only "pure" click events?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我的解决方案最终是手动检查单击位置是否接近鼠标被按下的位置。
My solution ended up beeing a manual check if the click position was close to the position where the mouse was pushed down.
非常简单:
mouseMoved 在拖放时为 true,否则为 false。
MouseEventArgs 文档 http://msdn.microsoft.com/en-us/library/ gg406731.aspx 不引用 mouseMoved :/
Very simple:
mouseMoved is true with a drag and drop and false otherwise.
The MouseEventArgs documentation http://msdn.microsoft.com/en-us/library/gg406731.aspx does not reference mouseMoved :/