Created
January 4, 2014 04:41
-
-
Save csemrm/8251807 to your computer and use it in GitHub Desktop.
Alloy: Map view in Titanium 3.2.0.GA http://docs.appcelerator.com/titanium/latest/#!/api/Modules.Map Test Environment Mac OS X 10.8.5
Ti SDK 3.2.0.GA
Ti CLI 3.2.0 Android
This file contains hidden or 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
Alloy.Globals.Map = require('ti.map'); | |
This file contains hidden or 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
// API calls to the map module need to use the Alloy.Globals.Map reference | |
var mountainView = Alloy.Globals.Map.createAnnotation({ | |
latitude : 37.390749, | |
longitude : -122.081651, | |
title : "Appcelerator Headquarters", | |
subtitle : 'Mountain View, CA', | |
pincolor : Alloy.Globals.Map.ANNOTATION_RED, | |
myid : 1 // Custom property to uniquely identify this annotation. | |
}); | |
$.mapview.region = { | |
latitude : 33.74511, | |
longitude : -84.38993, | |
latitudeDelta : 0.01, | |
longitudeDelta : 0.01 | |
}; | |
$.mapview.addAnnotation(mountainView); | |
$.index.open(); |
This file contains hidden or 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
<Alloy> | |
<Window> | |
<!-- Use the Alloy.Globals.Map namespace to create a map module view --> | |
<View id="mapview" ns="Alloy.Globals.Map" /> | |
</Window> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment