Or you could use the ItemizedOverlay class which has an onTap(int item) method. Set up each "dot" as a marker item.
Cheers, Richard www.creelcard.com On Jun 16, 4:20 am, adamphillips12 <[email protected]> wrote: > If you look at the Overlay class, there is an onTap() method, this > will be called when a tap gesture on your map is made and it will be > called on all Overlays in the MapViews list. onTap() asks you to > return true if the given point was an overlay. > > This check is up to you to decide, presumably if you're successfully > drawing them using the draw() method, you will know how to check for > bounds. Naturally if you're returning true, you will be on the Overlay > object that is being hit, so you can tell it to perform some action on > it self (highlight etc) or callback to some other method somewhere > else, whatever you want. > > This is probably the easiest way to check of an Overlay was tapped. > Though note if you're blocking MapViews onTouchEvent() from running, > you may also be blocking the calls to onTap(), so if you override > onTouchEvent(), make sure to call super. > > On Jun 16, 7:30 am, Hamy <[email protected]> wrote: > > > > > Hey all, > > > I would like to put a bunch of dots on a google map, and have the > > appropriate listener called when one of them gets clicked. > > > All i seem to be able to find is to get the location at which the > > click occurred, and then iterate through the dots until I find one > > that I think matches. Is there no listener for an arbitrary shape, > > like a drawable? I feel like this might be a Java question more so > > than android, but hopefully someone can still answer it. > > > Thanks, > > Hamilton --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" 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/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

