Titanium Community Questions & Answer Archive

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

My annotations don't show up in mapview

I have blacked out on my code, don't know what I've been doing wrong to not get any annotations to show on my mapview when reading them from a json file.

Any suggestions on what I've been doing wrong?

I get the info from the json file in the debug console, but don't appear to show in the simulator or on the device.

code: http://pastie.org/1334352

— asked November 30th 2010 by Isak Anklew
  • annotations
  • array
  • iphone
  • json
  • mapview
1 Comment
  • can you post a sample of the JSON that is file?

    — commented November 30th 2010 by Aaron Saunders

1 Answer

  • just looking at your code, I think you need to create the mapView after you have the annotations created or add the annotations at the end of your for loop… see snippet below

    Ti.API.debug("Adding annotation for " + annotation.latitude + " " + annotation.longitude    );
    mapview .addAnnotation (annotation)
    aAnnotations.push(annotation);
    
    — answered November 30th 2010 by Aaron Saunders
    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.