Titanium Community Questions & Answer Archive

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

Map view click event not firing (in Kitchen Sink or my own app)

Hi,

I'm writing an application that uses annotations on a map view. I'm retrieving data from a remote server and plotting it on a map with no problems. If you click a map pin it will show some information just like in the Kitchen Sink map view example.

Each time the user performs a new search I remove all existing annotations and then add the new ones. Unfortunately, if the user left an annotation info popup open this remains on the map even when all annotations are removed using "removeAllAnnotations". To work round this I decided to use the click event of the map view to track which annotation was the last one to be clicked and then use "deselectAnnotation" to deselect before calling "removeAllAnnotations".

The problem I have now come across is that the map view click event simply isn't firing. Having failed to get it to work in my app I ran the Kitchen Sink map view example and it doesn't work in there either. Its my understanding that the following line in the Kitchen Sink example should cause debug to be written to the output every time the map is clicked but it doesn't and the rest of the code in the click event doesn't get executed either:

"Ti.API.info('mapview click clicksource = ' + clickSource)"

Can anyone help with this (or that "removeAllAnnotations" doesn't remove an open annotation popup)?

Thanks for your time in advance

— asked November 9th 2010 by Keith Rosenheck
  • platform
2 Comments
  • what platform? iphone? android?

    — commented November 9th 2010 by Aaron Saunders
  • The platform is Android and I'm using Titanium Developer 1.2.1 on Windows 7. I was using SDK v1.4.0 but I've just downloaded the latest 1.4.2 and tried that but I'm having the same problems with both my app and the Kitchen Sink.

    If it helps, I've found that you can really easily recreate the annotation popup staying when the annotation is removed by displaying the map view example in the Kitchen Sink, pressing menu, then more and then remove all. The "Atlanta, GA" popup just stays there even though the map pin is removed.

    — commented November 9th 2010 by Keith Rosenheck

0 Answers

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.