Last active
August 29, 2015 14:03
-
-
Save danang-altastratus/f5ea584aee702a69c684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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