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?
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.
-
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! :)