Titanium Community Questions & Answer Archive

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

zIndex of annotations

Hi,
I have a map with a lot of annotations (locations of panoramio photos). Over all ist a helicopter annotation, its position is changed by event.
How can I realize the top position of this marker?

My code:

for (var i=0;i<datas.panoramio.length;i++) {
    var p = datas.panoramio[i];
    var a = Ti.Map.createAnnotation({
        latitude  : p.lat,longitude : p.lng,
        image     : './assets/map/p.png'
    });
    mapView.addAnnotation(a);
}
var heli= Ti.Map.createAnnotation({
    latitude  : datas.panoramio[ndx].lat,
    longitude : datas.panoramio[ndx].lng,
    image     : '/assets/heli.png',
    zIndex: 999
});
mapView.addAnnotation(heli);

And ofter changig ofheli position:

mapView.region={
    latitude:datas.panoramio[lastndx].lat,
        longitude:datas.panoramio[lastndx].lng,
        latitudeDelta: 4.5,
        longitudeDelta:4.5
};
mapView.removeAnnotation(heli);
heli.latitude  = datas.panoramio[lastndx].lat;
heli.longitude = datas.panoramio[lastndx].lng;
mapView.addAnnotation(heli);

The heli is "under" the maker points. Is it possible the change the order?

Best regards from Hamburg

Rainer

PS: How can I change my photo on my profile page from avatar to my personal photo?

— asked October 7th 2011 by Rainer Schleevoigt
  • annotation
  • dynamic annotation
  • zindex
0 Comments

3 Answers

  • Could you provide more of an example of what your goal would look like?

    As for the avatar, we use gravatar, so to update your avatar, you must se it at gravatar.com

    — answered October 7th 2011 by Matt Apperson
    permalink
    0 Comments
  • Old question, but… any options here? I'm also trying to find a way to manage the z-index of annotations.

    It looks like setting zIndex on the annotation itself isn't supported, and neither is setting a zIndex on a customView. Manipulating the order of the annotations in the array to be added doesn't seem to work either, which is kinda what I expected from reading the map view api docs.

    — answered July 29th 2013 by Michael X
    permalink
    0 Comments
  • Here is the full listing: http://pastie.org/2655407

    My problem is only the zIndex of annotations.

    Rainer

    — answered October 7th 2011 by Rainer Schleevoigt
    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.