SwiftLocation icon indicating copy to clipboard operation
SwiftLocation copied to clipboard

horizontalAccuracy is not checked for negative value

Open OlKir opened this issue 4 years ago • 0 comments

In line 139 of GPSLocationRequest.swift there is a check for horizontalAccuracy

        guard data.horizontalAccuracy <= options.accuracy.value else {
            return .notMinAccuracy // accuracy level is below the minimum set
        }

that doesn't take into account negative value.

According to Apple documentation:

A negative value indicates that the latitude and longitude are invalid. https://developer.apple.com/documentation/corelocation/cllocation/1423599-horizontalaccuracy

OlKir avatar Feb 10 '21 14:02 OlKir