//crea ventana
var win = Titanium.UI.currentWindow;
//crea mapview
var latitude=51.50015;
var longitude=-0.12623;
var mapview = Titanium.Map.createView({
top: 110,
height: 350,
mapType: Titanium.Map.STANDARD_TYPE,
region: {latitude:latitude ,
longitude:longitude,
latitudeDelta:0.5,
longitudeDelta:0.5},
animate: true,
regionFit: true,
userLocation: true
});
//agrega mapa a la ventana
win.add(mapview);
//crea una anotacion(un PIN)
var annotation = Titanium.Map.createAnnotation({
latitude: latitude,
longitude: longitude,
title: 'Localizacion',
subtitle: 'Esta es tu localizacion actual',
animate:true,
pincolor: Titanium.Map.ANNOTATION_GREEN
});
//agrega la anotacion al mapa
mapview.addAnnotation(annotation);