Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadMap(){
this.geolocation = new Geolocation();
this.geolocation.getCurrentPosition().then((position) => {
let latLng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
let mapOptions = {
center: latLng,
zoom: 15,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
this.map = new google.maps.Map(document.getElementById('map'), mapOptions);
google.maps.event.addListener(this.map,'click',(event)=>{
let clickMenu = this.modalCtrl.create(MapClickMenuPage,{latlng : event.latLng});
clickMenu.present();
} );
this.trackUser();
if (!!this.userQuery){
this.callSearch(this.userQuery);
startNavigation(){
this.createCustomLoading();
this.geolocation = new Geolocation();
this.geolocation.getCurrentPosition().then((position) => {
this.srcLocation.lat = String(position.coords.latitude);
this.srcLocation.lng = String(position.coords.longitude);
this.navigationService.navigatee(this.srcLocation,this.dstLocation,this.minRating).subscribe(
data => {
this.events.publish('navigation:done', data.json(),this.loading);
}
, err => {
this.handleError(err.json());
}
);
});
this.navCtrl.pop();
}
coordsComplexSearch(type, radius, minRating) {
this.loading = this._constants.createCustomLoading();
this.loading.present();
this.geolocation = new Geolocation();
this.geolocation.getCurrentPosition().then((position) => {
this.startLocationCoordinates = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
this.complexSearchService.complexSearchCoords(type, radius, position.coords, minRating).subscribe(data => {
this.events.publish('complexSearch:pressed', data, this.startLocationCoordinates);
this.loading.dismiss().catch(() => {});
});
this.navCtrl.pop();
}, (err) => {
this.handleError(err.json());
this.loading.dismiss().catch(() => {});
return;
});
}