设置双击事件而不禁用默认的 mouseup/mousedown 行为
我试图在 Flex 控件上启用双击事件,而不禁用默认的 mouseup/mousedown 行为。
我正在使用用于 arcgis 服务器的 ESRI Flex API,并且我有一个带有一个背景层和一个 GraphicLayer 的地图控件。图形层有几个响应鼠标悬停的 Graphic 对象,并允许用户在单击并按住时平移地图。但是,当我为图形对象实现双击事件处理程序时,它们似乎不再将其默认行为冒泡到地图上。
有没有办法实现图形对象上的双击,同时保留旧的单击和按住行为?
I'm trying to enable a double click event on a flex control without disabling the default mouseup/mousedown behaviors.
I'm using the ESRI Flex API for arcgis server, and I have a map control with one background layer and a GraphicLayer. The graphics layer has several Graphic objects that respond to mouseover, and allow the user to pan the map if they click and hold. However, when I implement a double click event handler for the graphic objects, they no longer seem to bubble up their default behavior to the map.
Is there a way to implement a double click on a Graphic object while preserving the old behavior from clicking and holding?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过将双击事件附加到地图而不是图形,并使用事件的目标属性来获取我想要使用的图形来解决这个问题。
像这样:
I solved this by attaching the double click event to the map, rather than the graphic, and using the target attribute of the event to get the graphic I wanted to use.
Like this:
如果您将 Graphic 对象上的“checkForMouseListeners”属性设置为 false,则将保留默认的地图单击/拖动行为。
http:// resources.esri.com/help/9.3/ArcGISServer/apis/Flex/apiref/com/esri/ags/Graphic.html#checkForMouseListeners
If you set the "checkForMouseListeners" property to false on your Graphic objects, then the default map click/drag behavior will be preserved.
http://resources.esri.com/help/9.3/ArcGISServer/apis/Flex/apiref/com/esri/ags/Graphic.html#checkForMouseListeners