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
/** | |
* Movies | |
* | |
* @copyright | |
* Copyright (c) 2015 by Appcelerator, Inc. All Rights Reserved. | |
* | |
* @license | |
* Licensed under the terms of the Apache Public License | |
* Please see the LICENSE included with this distribution for details. | |
*/ |
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
var updateMapTimeout; | |
$.mapView.addEventListener('regionChanged', function() { | |
if (updateMapTimeout) clearTimeout(updateMapTimeout); | |
// Wait 100ms and if timeout hasn't been cleared by another regionChanged event then it's good to go | |
updateMapTimeout = setTimeout(function() { | |
// update your map | |
}, 100); | |
}); |
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
/** | |
* Find out if Titanium device is online. Doing it this way because of false positives using Ti.Network.online | |
* @method isOnline | |
*/ | |
function isOnline() { | |
var onlineStatus = false; | |
if (Titanium.Network.networkType === Titanium.Network.NETWORK_NONE) { | |
onlineStatus = true; | |
Ti.API.info("Network Status: online"); | |
} else { |
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
// Origonally from http://www.oodlestechnologies.com/blogs/GOOGLE-MAPS-IN-TITANIUM | |
// Also see this great resource: https://wiki.appcelerator.org/display/guides/Tracking+Position+and+Heading#TrackingPositionandHeading-ContinuallymonitortheGPSposition | |
/* | |
mapType : Indicates what type of map should be displayed.(Ti.Map.STANDARD_TYPE, Ti.Map.SATELLITE_TYPE and Ti.Map.HYBRID_TYPE ). | |
region : This is an object that contains the 4 properties defining the visible area of the MapView.(latitude and longitude of a region can be represented with a different level of zoom using latitudeDelta and longitudeDelta properties). | |
animate : A boolean that indicates whether or not map actions, like opening and adding annotations, should be animated. | |
userLocation : A boolean that indicates if the map should attempt to fit the MapView into the region in the visible view. | |
userLocation : A boolean that indicates if the map should show the user's current device location as a blue dot on the 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
/*** | |
* @class Lib.TiGeo | |
* This library is a helper for geolocation | |
* | |
* @author Steven House <[email protected]> | |
* @example | |
var geo = require('ti.geolocation.helper'); | |
function success(_location) { | |
console.warn("location callback success"); |
NewerOlder