Skip to content

Instantly share code, notes, and snippets.

@samueleastdev
Last active October 10, 2016 16:58
Show Gist options
  • Save samueleastdev/07dcc780263e497625fb93bed4bc3e0c to your computer and use it in GitHub Desktop.
Save samueleastdev/07dcc780263e497625fb93bed4bc3e0c to your computer and use it in GitHub Desktop.
Show Annotations Android Appcelerator
// function
function showAnnotationsAndroid(_data) {
var largestLat = Math.max.apply(Math, _data.map(function(o) {
return o.latitude;
}));
var smallestLat = Math.min.apply(Math, _data.map(function(o) {
return o.latitude;
}));
var largestLon = Math.max.apply(Math, _data.map(function(o) {
return o.longitude;
}));
var smallestLon = Math.min.apply(Math, _data.map(function(o) {
return o.longitude;
}));
var latDelta = (largestLat - smallestLat);
var lonDelta = (largestLon - smallestLon);
$.searchTrainerMapView.setRegion({
latitude : Ti.App.cords.latitude,
longitude : Ti.App.cords.longitude,
latitudeDelta : latDelta,
longitudeDelta : lonDelta,
bearing : Ti.App.cords.heading,
tilt : 60
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment