Created
September 14, 2018 07:35
-
-
Save AppWerft/a302d6a10aff3e9d3a2aa95177bea40e to your computer and use it in GitHub Desktop.
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
| function onLocation(e) { | |
| const coords = (Ti.App.Properties.getBool("MOCKING") == true) ? { | |
| latitude : Ti.App.Properties.getString("MOCK_LOCATION").split(',')[0], | |
| longitude : Ti.App.Properties.getString("MOCK_LOCATION").split(',')[1], | |
| } : e.coords; | |
| $.mapView && $.mapView.onLocation(coords); | |
| $.panoView && $.panoView.onLocation(coords); | |
| } | |
| $.addEventListener("open", function() { | |
| Log('OPEN'); | |
| Ti.Geolocation.addEventListener('location', onLocation); | |
| }); | |
| $.addEventListener("close", function() { | |
| Log('CLOSE'); | |
| Ti.Geolocation.removeEventListener('location', onLocation); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment