1
私はイオンを学んでおり、Android携帯の地理的位置(緯度と経度)を画面に表示するのに問題があります。これどうやってするの? https://www.tutorialspoint.com/ionic/ionic_geolocation.htmイオンの画面上に携帯電話の地理的位置を表示
.controller('GeoCtrl', function($scope, $cordovaGeolocation) {
$scope.result = "";
var posOptions = {timeout: 10000, enableHighAccuracy: false};
$cordovaGeolocation
.getCurrentPosition(posOptions)
.then(function (position) {
var lat = position.coords.latitude;
//$scope.geo.lat = position.coords.latitude;
var long = position.coords.longitude;
//$scope.geo.long = position.coords.longitude;
console.log(lat + ' ' + long)
$scope.geo = lat + ' ' + long;
}, function(err) {
console.log(err)
});
})
から
コード取るそして、ここで私は地理の位置が表示されるようにしたいHTMLです:
<ion-view view-title="Submit New Thing">
<ion-content class="padding">
<h2>List of items for sale</h2>
<div >
<h3> Geo locaton is {{geo}}</h3>
</div>
</ion-content>
</ion-view>
私は自分の携帯電話でテスト{{地理}}は、文字通りです表示されます。