Skip to content
Adam Paxton edited this page Apr 27, 2014 · 3 revisions

Note: Annotations are a work in progress. You can set them like this:

mapView.setAnnotation({
    latitude: 18.467354,
    longitude: -91.903534,
    title: 'Test Title',
    subtitle: 'Subtitle'
});

Or you can also add them like the standard Ti map annotations:

var a1 = mapbox.createAnnotation({
    latitude: 18.467354,
    longitude: -91.903534,
    title: 'Test Title',
    subtitle: 'Subtitle'
});
mapView.addAnnotation(a1);

Just keep in mind that stuff like annotation events and other annotation-level setter/getters aren’t yet available.

Removing Annotations

removeAnnotation()

  • You can remove a single annotation by calling mapView.removeAnnotation('Test Title'); and passing the annotation's title.
  • Alternatively, you could pass the entire annotation object, like mapView.removeAnnotation(a1);

removeAllAnnotations()

  • Removes all annotations and shapes from the map
Clone this wiki locally