mirror of
https://github.com/bspeice/UNCCGameDay
synced 2024-11-05 07:38:13 -05:00
Add utility code to make navigation easy
This commit is contained in:
parent
5ad1f3b075
commit
a20b2e4789
@ -1,5 +1,8 @@
|
||||
package com.uncc.gameday.parking;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
public class ParkingCoordinate {
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
@ -24,6 +27,16 @@ public class ParkingCoordinate {
|
||||
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) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
|
Loading…
Reference in New Issue
Block a user