Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
/**
* Map view with annotation
* @author Danang Iswadi
*
*/
var Map = require('ti.map');
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var modernlandView = Map.createAnnotation({
latitude: -6.197766,
longitude: 106.647146,
title: "Padang Golf Modernland",
subtitle: 'Jl. Modern Golf Raya no.1, Tangerang',
pincolor: Map.ANNOTATION_RED,
myid: 1
});
var mapView = Map.createView({
mapType: Map.NORMAL_TYPE,
region: {latitude:-6.197766, longitude:106.647146,
latitudeDelta:0.01, longitudeDelta:0.01},
animate: true,
regionFit: true,
userLocation: true,
annotations: [modernlandView]
});
win.add(mapView);
mapView.addEventListener('click', function(evt) {
Ti.API.info("Annotation " + evt.title + " clicked, id: " + evt.annotation.myid);
});
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment