【发布时间】:2015-04-24 23:56:01
【问题描述】:
我正在使用 Visual Studio 2013 Update 4,并且我已经安装了 Visual Studio for Cordova 插件(版本 0.3.22015.1)。
我创建了一个基于 Ionic SideMenu Starter Template for Cordova 示例的基于 Angular 的应用程序。我在 config.xml 文件中包含了 Cordova 地理定位插件。
在此示例中,我使用以下代码获取设备的位置:
$scope.showPosition = function (position) {
// ...
}
$scope.getLocation = function () {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition($scope.showPosition, $scope.showError);
}
else {
$scope.error = "Geolocation is not supported by this browser.";
}
}
执行此代码时,我希望传递给 showPosition 回调的位置对象具有在 Ripple 模拟器中指定的模拟地理位置值。但是我没有得到这些模拟值,我得到了我的实际位置。
如何让我的代码使用模拟值?
【问题讨论】:
标签: cordova gps cordova-plugins visual-studio-cordova ripple