Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229599

Ionic search autocoplete doesnt pick acutal location

$
0
0

my search autocomplete doesnt pick actual location, how can i make it be accurate to pick latitude and longitude of a place searched, this is my code
startpage.ts

constructor(public navCtrl: NavController,
public navParams: NavParams,
platform: Platform,
public geolocation: Geolocation,
public afAuth: AngularFireAuth,

private modalCtrl: ModalController,
public toastCtrl: ToastController,

public http: Http) {



//   platform.ready().then(() => {
//
//     this.geolocation.getCurrentPosition().then(position => {
//                     let locationObj = {
//                         lat: position.coords.latitude,
//                         lon: position.coords.longitude,
//                         timestamp: position.timestamp,
//                         accuracy: position.coords.accuracy
//                     };
//                     resolve(locationObj);
//                 })
//
// });

  //pick current user mail


//autocomplete
this.address = {
  place: ''
};

}

//modal autocomplete
showAddressModal () {
let modal = this.modalCtrl.create(AutoPage);
let me = this;
modal.onDidDismiss(data => {
this.address.place = data;
});
modal.present();

}
my html input is this
<ion-input (click)=“showAddressModal()” [(ngModel)]=“address.place” type=“text” placeholder=“From” id=“destination-input” floating placeholder="From " [(ngModel)]=“Start” [(ngModel)]=“destination” name=“destination”>


Viewing all articles
Browse latest Browse all 229599

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>