mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

<<error type>> returning for most methods

Open jay-cohen opened this issue 3 years ago • 1 comments

Environment

  • Xcode version: 13.4.1
  • iOS version: NA
  • Devices affected: NA
  • Maps SDK Version: 10.8.1

Observed behavior and steps to reproduce

<<error type>> returning for all the important methods you need in MapBox.

let touchPoint  = gesture.location(in: mapView)
let coordinates = mapView.mapboxMap.coordinate(for: touchPoint) -> <<error type>>
let coordinate = LocationCoordinate2D(latitude: coordinates.latitude, longitude: coordinates.longitude)
		
for ann in mapped.annotations where ann.point.coordinates == coordinate {
	print("FOUND: \(ann.image!.name)")
}
Screenshot 2022-10-11 at 13 13 36

Not sure if this is expected behaviour but it's quite annoying to see this without Xcode giving a reason. It also causes the compiler to act strange (example: Ambiguous use of ==).

Expected behavior

Methods to return expected type.

Workaround

Convert to point instead: let point = Point(LocationCoordinate2D(latitude: coordinates.latitude, longitude: coordinates.longitude))

jay-cohen avatar Oct 11 '22 12:10 jay-cohen

@jay-cohen this is expected behavior within Xcode. If you don't have something defined properly that's the error you receive. Additionally, when testing the code you provided, it raises no errors on my end.

ZiZasaurus avatar Oct 13 '22 13:10 ZiZasaurus

Closing this issue, but please feel free to reopen if you have additional questions.

ZiZasaurus avatar Oct 24 '22 14:10 ZiZasaurus