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

Need Help in coverting a mapbox function

Open mooncatventures-group opened this issue 1 year ago • 1 comments

We are converting our app from 10.0.rc6 to 10.18 and seem to be stuck on a conversion.

What is the equivalent of this function I cannot find any documentation on using this with the newer versions of Turf

let point = annotations.feature.geometry.value as! Turf.Point

Geometry no longer has the value enum

We can't convert to version 11 because it breaks our custom polygon dragging. 10.18 seemed like a possible compromise but we ran into this issue among others, it would be great to have some conversion guide or at least update examples like the MultipointAnnotation example between versions,

mooncatventures-group avatar Aug 02 '24 03:08 mooncatventures-group

Hey @mooncatventures-group, if understand correctly with Turf 2.8.0 what you want to do can be achieved with the following code

if case let .point(point) = feature.geometry {
  //  point is Turf.Point here after unwrapping
  print(point.coordinates)
}

aleksproger avatar Aug 02 '24 10:08 aleksproger