//Predefined Location. You always override this by overriding lastData from another class private LocationInfoExt getMockLocation() { LocationInfoExt location = new LocationInfoExt(); location.latitude = 59.000f; location.longitude = 18.000f; location.altitude = 0.0f; location.horizontalAccuracy = 5.0f; location.verticalAccuracy = 5.0f; location.timestamp = 0f; return(location); }
public LocationServiceExt(bool mockLocation = false) { this.useMockLocation = mockLocation; if (mockLocation) { mIsEnabledByUser = true; mockedLastData = getMockLocation(); } else { realLocation = new LocationService(); } }
private LocationInfoExt getRealLocation() { if (realLocation == null) { return(new LocationInfoExt()); } LocationInfo realLoc = realLocation.lastData; LocationInfoExt location = new LocationInfoExt(); location.latitude = realLoc.latitude; location.longitude = realLoc.longitude; location.altitude = realLoc.altitude; location.horizontalAccuracy = realLoc.horizontalAccuracy; location.verticalAccuracy = realLoc.verticalAccuracy; location.timestamp = realLoc.timestamp; return(location); }