Skip to content

Instantly share code, notes, and snippets.

View shouse's full-sized avatar

Steven shouse

  • SIVCI
  • Kansas City, MO
View GitHub Profile
@shouse
shouse / Ti.Geolocation.Example.js
Last active July 31, 2019 19:43
Ti.Geolocation Example
/***
* @class Lib.TiGeo
* This library is a helper for geolocation
*
* @author Steven House <steven.m.house@gmail.com>
* @example
var geo = require('ti.geolocation.helper');
function success(_location) {
console.warn("location callback success");
// 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.
@shouse
shouse / isOnline.js
Created September 4, 2014 17:53
Titanium: Find out if device is online
/**
* 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 {
@shouse
shouse / regionChangedFix.js
Last active August 29, 2015 14:06
Ti.Map :: Event : Region Changed happens continuously when moving map. Here's a fix
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);
});
/**
* 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.
*/
/**
* 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.
*/
/**
* 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.
*/
@shouse
shouse / Camera.js
Created March 21, 2015 05:18
Not tested yet.
/**
* This handles the camera and related functions. It handles video as well
* @class Util.VideoRecorder
* @author Steven House <steven.m.house@gmail.com>
*
* This is the Video Recorder Library
*/
// Access Global Logging Utility
var log = Alloy.Globals.log;
/**
* This is a library for recording audio on Android and iOS using Titanium
*
* @Class Lib/AudioRecorder
* @author steven.m.house
*/
/**
* Start it rolling
* @method init
/**
* @class Util.map
*
* @author Steven House
* @email steven.m.house@gmail.com
*
* Map utility functions
*/
// Include logging utility