Hi Chris- Since 1.6, markers do support double click. (See http://code.google.com/p/gmaps-api-issues/issues/detail?id=405)
I just tried it in 1.9 and it seemed like a double-click to me. What OS are you on? Do you have problems with double-click in other Flash/Flex apps? Are you using the Flex SWC or other SWC? - pamela On Fri, Mar 13, 2009 at 8:16 AM, chris <[email protected]> wrote: > > I'm not sure if this is related or not, but I'm experiencing a problem > with double-clicks on markers. From the documentation, it's unclear > whether or not this is supported (one area says explicitly that it > isn't, but another implies that it is...) The behavior I'm seeing > using 1.9 (and ever since 1.7) is that a double-click won't fire > unless I do a "machine gun" click (i.e. roughly a 6-click in rapid > succession) in which case it will fire. Behavior is the same across > several browsers, platforms, and versions of Flash player. > > Version 1.6 and previous of the API works great for marker double- > clicks, leading me to believe it's supposed to be supported. Does > anyone else have this problem, or know whether the marker is supposed > to be able to fire a double-click event? > > Thanks, > Chris > > On Mar 2, 11:10 am, Kevin Macdonald <[email protected]> > wrote: >> Hi >> >> I resolved the CLICK &DOUBLE_CLICKissue as follows: >> >> I handle a CLICK event by clearing a "double_click" flag and then set >> a timer to call function "X" in 500 milliseconds. >> I handle theDOUBLE_CLICKevent by simply setting the "double_click" >> flag. >> >> Function "X" examines the "double_click" flag: if it's set, we have a >> double click event to handle; otherwise we have a single click event >> to handle. >> >> You can see how this performs by visiting >> >> http://spatialdatabox.com/million-marker-map/million-marker-map.html >> >> and zooming in until you see individual markers. You can still double- >> click the map to zoom in, or single click over amarkerto display the >> info window (the markers, info window and the user's interaction with >> them is custom, which is why I handle all click events myself.) >> >> Here's the relevant code snippet, if you're curious: >> >> "in constructor" { >> map.addEventListener(MapMouseEvent.CLICK, onClick); >> map.addEventListener(MapMouseEvent.DOUBLE_CLICK, onDoubleClick); >> >> } >> >> private function onClick (e:MapMouseEvent):void >> { >> if (! handCursor.isVisible ()) { >> // Click is active only if hand cursor is visible. >> return; >> } >> >> doubleClickEvent = false; >> clickLatLon = e.latLng; >> >> // Wait to ensure this click isn't part of a double-click event. >> >> clickTimer = new Timer (DOUBLE_CLICK_INTERVAL_MSEC, 1); >> clickTimer.addEventListener(TimerEvent.TIMER, doClickTimer); >> clickTimer.start (); >> >> } >> >> private function onDoubleClick (e:MapMouseEvent):void >> { >> doubleClickEvent = true; >> clickLatLon = null; >> >> } >> >> private function doClickTimer (e:TimerEvent):void >> { >> if (doubleClickEvent || clickLatLon == null) { >> // Click was part of a double-click event. >> return; >> } >> >> // Handle single click event ... >> : >> : >> >> } >> >> Thank you >> >> On Mar 2, 1:44 am, sydney <[email protected]> wrote: >> >> > On 27 Feb, 21:13, Richard <[email protected]> wrote: >> >> > > I ended up just listening for the MOUSE_DOWN and inferring my own >> > > click. >> >> > > If you have to, you can catch the CLICK or MOUSE_DOWN and either: >> >> > > Create a timer, and have that TIMER event perform the click activity >> > > (make sure you null-out the persistent timer reference variable) >> > > or >> > > See that the timer exists, kill it, and perform theDOUBLE_CLICK >> > > activity. >> >> > As an ugly workaround, I tried catching the MOUSE_DOWN event and >> > setting up a timer. If I get another MOUSE_DOWN before the timer >> > expires then I have a double click and otherwise I have a single >> > click. Anyway, this did not work because if the two mouse clicks of a >> > double click are too close to each other (as it is the case in a >> > typical double click) then I don't receive the second MOUSE_DOWN event >> > at all. I kind of solved the problem by asking the user to press the >> > Shift key while performing a click, but I'm still looking for a better >> > solution. >> >> > Sydney > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en -~----------~----~----~----~------~----~------~--~---
