0
Googleは安全でない起源からgetCurrentPosition()とwatchPosition()メソッドを非推奨にしました。イオンフレームワークを使ってアンドロイドアプリケーションを開発しているとき、私はHTTPSを使えません。そこで、私はCordovaジオロケーションプラグインを使用しようとしましたが、動作していません。コルドバのプラグインのコードスニペットはコードバージオロケーションがイオン性で働いていません(Android)
$scope.getLocation = function() {
alert('Get location Called')
var posOptions = {
timeout: 10000,
enableHighAccuracy: false
}
$cordovaGeolocation
.getCurrentPosition(posOptions)
.then(function (position) {
alert('getting current position')
var lat = position.coords.latitude
alert(lat)
var long = position.coords.longitude
alert(long)
}, function (err) {
console.log(err)
alert(err.message)
})
}
<button class="button button-full button-assertive" ng-click="getLocation()">
Get Location
</button>
であるそれは私に私が唯一の現在位置を取得したい
PositionError {message: "Timeout expired", code: 3, PERMISSION_DENIED: 1, POSITION_UNAVAILABLE: 2, TIMEOUT: 3}
ようにconsole.logにエラー(ERR)を与えますユーザー。現在の緯度と経度を得るために使用できる他の方法はありますか?
try *プラグインを削除してから*もう一度*をインストールしてください。 – Atula
@Vaibhavデバイスでテストしている場合、デバイスを一度再起動できますか?また、設定 - >場所とセキュリティ - >ネットワークを使用します。それをアクティブにしてください – Gandhi
@Atulaプラグインを削除しようとしましたが、もう一度インストールしても動作しません。 –