mapbox-maps-ios
mapbox-maps-ios copied to clipboard
LocationProvider' is ambiguous for type lookup in this context
step1: MapboxSearch and MapboxMaps are required
import MapboxSearch
import MapboxMaps
step2:
lazy var locationProvider: AppleLocationProvider = {
let make = AppleLocationProvider()
make.setDelegate(self)
return make
}()
step3:
func locationProvider(_ provider: LocationProvider, didUpdateLocations locations: [CLLocation]) {
if locations.isNotEmpty, let current = locations.first?.coordinate {
currentLocation.accept(current)
provider.stopUpdatingLocation()
logDebug("Location didUpdateLocations: \(current.latitude),\(current.longitude)")
} else {
logError("Location fail ...")
}
}
func locationProvider(_ provider: LocationProvider, didUpdateHeading newHeading: CLHeading) {
logDebug("Location didUpdateHeading: \(newHeading)")
}
func locationProvider(_ provider: LocationProvider, didFailWithError error: Error) {
provider.stopUpdatingLocation()
logError("Location didFailWithError: \(error.localizedDescription)")
}
a
An error occurred
'LocationProvider' is ambiguous for type lookup in this context
If you remove one, you won't report the above error
Because LocationProvider
is defined in both imported frameworks, you need to include module(framework) name when using it - e.g. MapboxMaps.LocationProvider
.