Ejemplo n.º 1
0
        //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);
        }
Ejemplo n.º 2
0
        public LocationServiceExt(bool mockLocation = false)
        {
            this.useMockLocation = mockLocation;

            if (mockLocation)
            {
                mIsEnabledByUser = true;
                mockedLastData   = getMockLocation();
            }
            else
            {
                realLocation = new LocationService();
            }
        }
Ejemplo n.º 3
0
        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);
        }