Skip to content

Instantly share code, notes, and snippets.

@csemrm
Created January 4, 2014 04:41
Show Gist options
  • Save csemrm/8251807 to your computer and use it in GitHub Desktop.
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
Alloy.Globals.Map = require('ti.map');
// 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();
<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