mirror of
				https://github.com/bspeice/UNCCGameDay
				synced 2025-11-04 02:10:35 -05:00 
			
		
		
		
	Add utility code to make navigation easy
This commit is contained in:
		@ -1,5 +1,8 @@
 | 
				
			|||||||
package com.uncc.gameday.parking;
 | 
					package com.uncc.gameday.parking;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import android.content.Intent;
 | 
				
			||||||
 | 
					import android.net.Uri;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class ParkingCoordinate {
 | 
					public class ParkingCoordinate {
 | 
				
			||||||
	private double latitude;
 | 
						private double latitude;
 | 
				
			||||||
	private double longitude;
 | 
						private double longitude;
 | 
				
			||||||
@ -24,6 +27,16 @@ public class ParkingCoordinate {
 | 
				
			|||||||
		this.label = label;
 | 
							this.label = label;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
 | 
						public Uri getNavigationURI() {
 | 
				
			||||||
 | 
							// URI used to construct an intent for navigation
 | 
				
			||||||
 | 
							return Uri.parse("google.navigation:q=" + this.getLatitude() + "," + this.getLongitude());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						public Intent getNavigationIntent() {
 | 
				
			||||||
 | 
							// Intent used to do navigation
 | 
				
			||||||
 | 
							return new Intent(Intent.ACTION_VIEW, this.getNavigationURI());
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
	public ParkingCoordinate(double latitude, double longitude, String label) {
 | 
						public ParkingCoordinate(double latitude, double longitude, String label) {
 | 
				
			||||||
		this.latitude = latitude;
 | 
							this.latitude = latitude;
 | 
				
			||||||
		this.longitude = longitude;
 | 
							this.longitude = longitude;
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user