Last active
October 10, 2016 16:58
-
-
Save samueleastdev/07dcc780263e497625fb93bed4bc3e0c to your computer and use it in GitHub Desktop.
Show Annotations Android Appcelerator
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
// 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