Hi Matt- Right you are. I've updated our internal bug and created an external bug for you to track: http://code.google.com/p/gmaps-api-issues/issues/detail?id=1156
I'm not sure if it would work, but you could create a custom Sprite icon for your marker, and detect mouse down/mouse up on that Sprite. You could also just extend OverlayBase and create a completely custom marker. - pamela On Fri, Mar 20, 2009 at 11:46 PM, matt <[email protected]> wrote: > > Pamela... I am pasting your reply which came in an e-mail. I had > meant for my original question (and thus the response) to be in the > forum but I clicked the wrong button.. > > However, in looking at the difference between your code and mine, I > found the problem and I am wondering if it is by design or a bug. > > As you report, you do get MOUSE_UP events in your code. However, if > you turn draggable to false, you will only get MOUSE_DOWN events. Is > there a good reason for that? The irony for my purposes is that I am > answering these events in an attempt to implement my own "drag/drop". > My drag/drop needs differ enough that that the default implementation > won't work for me. So... turning on draggable is not really an option > for me. > > So in the end, my question is... is there a reason that non-draggable > markers fire MOUSE_DOWN events but not MOUSE_UP events. > > ps... As you indicate MOUSE_MOVE doesn't seem to fire in either case. > > > --- pasted response. > > Hi Matt- > > I can't get MOUSE_MOVE firing, but I have gotten MOUSE_UP and > MOUSE_DOWN with the following code: > private function onMapReady(event:Event):void > { > var marker:Marker=new Marker(map.getCenter(), new > MarkerOptions({draggable:true})); > marker.addEventListener(MapMouseEvent.MOUSE_DOWN, > function(e:Event):void > { > trace("mouse down"); > marker.openInfoWindow(new > InfoWindowOptions({content: "mouse down"})); > }); > marker.addEventListener(MapMouseEvent.MOUSE_UP, > function(e:Event):void > { > trace("mouse up"); > marker.openInfoWindow(new > InfoWindowOptions({content: "mouse up"})); > > }); > marker.addEventListener(MapMouseEvent.MOUSE_MOVE, > function(e:Event):void > { > trace("mouse move"); > marker.openInfoWindow(new > InfoWindowOptions({content: "mouse move"})); > }); > marker.addEventListener(MapMouseEvent.ROLL_OVER, > function(e:Event):void > { > trace("roll over"); > > }); > map.addOverlay(marker); > } > > > I'll file a bug in regards to MOUSE_MOVE, and see if we can find a way > to document which overlays fire what > > > On Mar 19, 8:29 am, matt <[email protected]> wrote: >> In a previous >> thread,http://groups.google.com/group/google-maps-api-for-flash/browse_threa..., >> it lists the events that fire for an overlay (marker). >> >> However, I cannot seem to get certain of those events to fire. >> Specifically, I never get MOUSE_UP or MOUSE_MOVE events for markers. >> The event seems to fire for the map control itself but not for the >> markers. The code is below (it is simply the marker example program >> with a couple added event listeners). I imagine there is something >> simply I am missing but I cannot see it. >> >> private function onMapReady(event:Event):void { >> map.setCenter(new LatLng(48.858842, 2.346997), 14, >> MapType.NORMAL_MAP_TYPE); >> var markerA:Marker = new Marker( >> new LatLng(48.858842, 2.346997), >> new MarkerOptions({ >> strokeStyle: new StrokeStyle({color: 0x987654}), >> fillStyle: new FillStyle({color: 0x223344, alpha: >> 0.8}), >> radius: 12, >> hasShadow: true >> }) >> ); >> >> map.addEventListener(MapMouseEvent.MOUSE_UP, onMapMouseUp); >> >> markerA.addEventListener(MapMouseEvent.MOUSE_UP, onMapMouseUp); >> markerA.addEventListener(MapMouseEvent.MOUSE_DOWN, >> onMapMouseDown); >> markerA.addEventListener(MapMouseEvent.MOUSE_MOVE, >> onMapMouseMove); >> >> map.addOverlay(markerA); >> } >> >> private function onMapMouseDown(event:MapMouseEvent):void >> { >> trace("MapMouseDown:" + event.feature + ", " + event.target); >> } >> >> private function onMapMouseUp(event:MapMouseEvent):void >> { >> trace("MapMouseUp:" + event.feature + ", " + event.target); >> } >> >> private function onMapMouseMove(event:MapMouseEvent):void >> { >> trace("MapMouseMove:" + event.feature + ", " + event.target); >> } > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
