Titanium Community Questions & Answer Archive

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

Removing an annotation crashes app

I see a similar, unanswered question for iphone. I'm running on Android. In both the simulator and on my Droid, attempting to remove a map annotation crashes the app.

var theAnno;
var mapview_event = mapview.addEventListener('click', function(e) {
    if(e.clicksource == 'rightButton') {
        saleID = e.annotation.myid;
        theAnno = e.annotation;
        // open options dialog
        dialog.show();
    }
});
...
// later, within the options dialog event listener
// I'm using:
if(theAnno != null) mapview.deselectAnnotation(theAnno);
// which crashes

I've also tried by using the annotation's title. So, theAnno = e.annotation.title but in my app, the titles could in theory be duplicated or maybe even empty strings. The API docs says that deselectAnnotation accepts either an annotation object or a title. Neither works for me though.

Any suggestions?

— asked September 29th 2010 by Tim Poulsen
  • android
  • annotation
  • geolocation
0 Comments

2 Answers

  • Sorry, forgot to follow up on this. Turns out this was a bug in the SDK, now fixed in one of the nightly builds. I forget exactly when.

    — answered October 31st 2010 by Tim Poulsen
    permalink
    1 Comment
    • Trying to do the same, but I'd like to use the my annotation ID or something else besides the Title….

      — commented September 2nd 2011 by Edwin Huertas
  • It was very conscientious of you to update this ticket with the solution. If only everyone did that, this Q&A would be a much greater help to people! :)

    — answered November 20th 2010 by Paul Dowsett
    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.