Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Why Does rightButton Click on Annotation Sometimes get Reported Twice?

I'm working on an app that has annotations with a disclosure button for the rightButton to get more detail on that item. I noticed that the sub-window was opening twice, and eventually tracked the problem back to the fact that Titanium is firing the click event twice for that tap.

I fired up KitchenSink to see if it was something in my code, but it does the same thing for the Atlanta annotation in that app. Oddly, the Steve Jobs rightButton only fires the click event once. I'm not sure what difference between those annotations causes the different behavior, but would love to have a fix or workaround.

UPDATE: I did check the clicksource and had looked at the API. The clicksource is rightButton for both firings of the event. Here's the log from clicking once on the Atlanta rightButton in KitchenSink:

[INFO] MAPVIEW EVENT - you clicked on Atlanta, GA with click source = rightButton
[INFO] removing mountain view annotation
[INFO] MAPVIEW EVENT - you clicked on Atlanta, GA with click source = rightButton
[INFO] removing mountain view annotation
[INFO] ANNOTATION EVENT - you clicked on Atlanta? with click source = annotation
[INFO] MAPVIEW EVENT - you clicked on Atlanta? with click source = annotation
[INFO] removing mountain view annotation

You can see that the click event fires several times, two of which show the rightButton clicksource.

— asked March 12th 2010 by Sean McMains
  • annotations
  • event
  • mapview
0 Comments

1 Answer

  • You'll want to check the clicksource property since the click might come from the annotation or the underlying view iteself. Check out the latest API docs for MapView

    — answered March 12th 2010 by Jeff Haynie
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.