Skip to content

Instantly share code, notes, and snippets.

@danang-altastratus
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danang-altastratus/f5ea584aee702a69c684 to your computer and use it in GitHub Desktop.
Save danang-altastratus/f5ea584aee702a69c684 to your computer and use it in GitHub Desktop.
/**
* 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