Time for action – adding annotations to a map
Perform the following steps to add annotations to a map:
Putting a pin bar annotation to a map is simply a case of specifying the coordinates of the pin placement and the properties of the pin such as its color, title, and button:
var tourmalet = Titanium.Map.createAnnotation({ latitude: 42.908655, longitude: 0.145054, title: 'Col du Tourmalet', subtitle: 'France', pincolor: Ti.Map.ANNOTATION_RED, animate: true }); theMap.addAnnotation(tourmalet);
Run the app!
What just happened
You added code to display a satellite picture of the Tourmalet region of France (it's one of the epic climbs in the Tour De France). You also added a pin showing the rough position of the top of the climb: