How to use @ionic-native/geolocation - 3 common examples

To help you get started, we’ve selected a few @ionic-native/geolocation examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TechnionYP5777 / SmartCity-Accessibility / client-side / src / pages / mapview / mapview.ts View on Github external
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);
github TechnionYP5777 / SmartCity-Accessibility / client-side / src / pages / navigation / navigation.ts View on Github external
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();
	}
github TechnionYP5777 / SmartCity-Accessibility / client-side / src / pages / complex-search / complex-search.ts View on Github external
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;
		});
		
		
   }

@ionic-native/geolocation

Ionic Native - Native plugins for ionic apps

MIT
Latest version published 3 years ago

Package Health Score

75 / 100
Full package analysis

Popular @ionic-native/geolocation functions

Similar packages