MapView annotation not hiding ?!
Hi,
I have a map with annotations. You can open the annotation and then click on the "rightButton" to slide in a detail view.
mapView.addEventListener('click',function(evt)
{
// map event properties
var annotation = evt.annotation;
var clickSource = evt.clicksource;
// Titanium.API.info('MAPVIEW EVENT - click source = '+clickSource+' and offer for '+evt.annotation.offer.city);
// if (clickSource == 'leftButton' || clickSource == 'title' || clickSource == 'subtitle' || clickSource == 'rightButton')
if (clickSource == 'rightButton')
{
var offer = evt.annotation.offer;
// not working when clicking left or right button
mapView.deselectAnnotation(annotation);
openOfferDetails(offer);
}
});
My problem is, the annotation is not hidden when I get back from the detail view.
Any idea why?
THX
3 Answers
-
We are also trying to do almost the exact same thing with zero luck. Anyone made any progress here?
-
Hi,
I try also to hide a part from my annotations. Here is screenshot:
http://familientagebuch.de/rainer/2011/28.html#2In the back page I want to hide/unhide the annotations. They are in an array and are added to the mapview.
In my function:
function switchStations(onoff) { for (var i=0;i<stations.length;i++) { if (onoff=='1') { mapView.selectAnnotation(stations[i]); } if (onoff=='0') { mapView.deselectAnnotation(mapView.annotations[i]); } } }
I tried:
stations[i]
andmapView.annotations[i]
. In both cases nothing happens.Rainer
-
Having the same problem here. I created an array of annotations:
markers[i] = Titanium.Map.createAnnotation({ // etc. // etc. mapview.addAnnotation(markers[i]);
Then
for (i = 0; i < markers.length; i++) { mapview.deselectAnnotation(markers[i]); }
This code does not deselect the annotations, nor does it produce an error. I've printed the object info and verified that markers[i] is in fact an Annotation object.
RJ