@capgo/nativegeocoder 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -99,9 +99,29 @@ struct NativeGeocoderOptions: Decodable {
|
|
|
99
99
|
options.maxResults = call.getInt("maxResults") ?? 1
|
|
100
100
|
|
|
101
101
|
forwardGeocodeHandler(address, options: options, completionHandler: { (resultObj, error) in
|
|
102
|
-
if let error = error {
|
|
103
|
-
|
|
104
|
-
|
|
102
|
+
if let error = error as? CLError {
|
|
103
|
+
var msg = "CLGeocoder:forwardGeocodeLocation Error"
|
|
104
|
+
switch error.code {
|
|
105
|
+
case .locationUnknown:
|
|
106
|
+
msg = "locationUnknown: location manager was unable to obtain a location value right now."
|
|
107
|
+
case .denied:
|
|
108
|
+
msg = "denied: user denied access to the location service."
|
|
109
|
+
case .promptDeclined:
|
|
110
|
+
msg = "promptDeclined: user didn’t grant the requested temporary authorization."
|
|
111
|
+
case .network:
|
|
112
|
+
msg = "network: network was unavailable or a network error occurred."
|
|
113
|
+
case .headingFailure:
|
|
114
|
+
msg = "headingFailure: heading could not be determined."
|
|
115
|
+
case .rangingUnavailable:
|
|
116
|
+
msg = "rangingUnavailable: ranging is disabled."
|
|
117
|
+
case .rangingFailure:
|
|
118
|
+
msg = "rangingFailure: a general ranging error occurred."
|
|
119
|
+
default : break
|
|
120
|
+
}
|
|
121
|
+
print(msg)
|
|
122
|
+
call.reject(msg)
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
105
125
|
call.resolve(["addresses": resultObj])
|
|
106
126
|
}
|
|
107
127
|
})
|