本文整理汇总了TypeScript中com.unarin.cordova.beacon.underscorejs.default类的典型用法代码示例。如果您正苦于以下问题:TypeScript unarin.cordova.beacon.underscorejs.default类的具体用法?TypeScript unarin.cordova.beacon.underscorejs.default怎么用?TypeScript unarin.cordova.beacon.underscorejs.default使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了unarin.cordova.beacon.underscorejs.default类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: TypeError
Regions.fromJson = function(jsonMap) {
var typeName = jsonMap.typeName;
if (!_.isString(typeName) || _.isEmpty(typeName)) {
throw new TypeError('jsonMap need to have a key "typeName"');
}
var identifier = jsonMap.identifier;
var region = null;
if (typeName === 'CircularRegion') {
var latitude = jsonMap.latitude;
var longitude = jsonMap.longitude;
var radius = jsonMap.radius;
region = new CircularRegion(identifier, latitude, longitude, radius);
} else if (typeName === 'BeaconRegion') {
var uuid = jsonMap.uuid;
var major = jsonMap.major;
var minor = jsonMap.minor;
region = new BeaconRegion(identifier, uuid, major, minor);
} else {
console.error('Unrecognized Region typeName: ' + typeName);
}
return region;
};
示例2: function
LocationManager.prototype._registerDelegateCallbackId = function () {
this.appendToDeviceLog('registerDelegateCallbackId()');
var d = Q.defer();
exec(_.bind(this._onDelegateCallback, this, d), _.bind(this._onDelegateCallback, this, d), "LocationManager",
"registerDelegateCallbackId", []);
return d.promise;
};
示例3: function
Delegate.safeTraceLogging = function(message) {
if (!_.isString(message)) {
return;
}
try {
cordova.plugins.locationManager.appendToDeviceLog(message);
} catch (e) {
console.error('Fail in safeTraceLogging()' + e.message, e);
}
};