Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Help in coverting a mapbox function #2221

Open
mooncatventures-group opened this issue Aug 2, 2024 · 1 comment
Open

Need Help in coverting a mapbox function #2221

mooncatventures-group opened this issue Aug 2, 2024 · 1 comment

Comments

@mooncatventures-group
Copy link

mooncatventures-group commented Aug 2, 2024

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,

@aleksproger
Copy link
Contributor

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)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants