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

Migrate to a recent Mapbox SDK on iOS, e.g. 10.x #92

Open
madmas opened this issue Sep 12, 2022 · 5 comments
Open

Migrate to a recent Mapbox SDK on iOS, e.g. 10.x #92

madmas opened this issue Sep 12, 2022 · 5 comments

Comments

@madmas
Copy link
Contributor

madmas commented Sep 12, 2022

As the current SDK used is 5.1.1 and there is a "warning" from mapbox that those version will no longer be kept compatible after April 2023, we should start to work on a migration in order to keep this plugin working beyond that point.

Bildschirmfoto 2022-09-12 um 20 25 37

Currently, when trying to run with 10.8.1, we get

 ERROR Error: Uncaught (in promise): TypeError: Could not load view for: Mapbox.ReferenceError: MGLMapViewDelegate is not defined
 TypeError: Could not load view for: Mapbox.ReferenceError: MGLMapViewDelegate is not defined
  a

which is, after a quick search in their current docs, a good sign we need a rewrite here....

(and this is probably a good starting point to it: https://docs.mapbox.com/ios/maps/guides/migrate-to-v10/ )

@farfromrefug
Copy link
Member

@madmas can you try forcing the pod version in your app podfile?

@felixkrautschuk
Copy link

I think it will be getting tricky to migrate this plugin to using Mapbox SDK 10 on iOS. I already gave it a try to import the latest pod and generate the typings, but it seems impossible right now as NativeScript needs Obj-C backwards compatibility and this seems to be the problem as stated here in the last question:

If your iOS application is written in Objective-C, you will need to write a Swift compatibility shim for those parts of the public API that your application uses. This is because the SDK uses pure Swift constructs that cannot be used from Objective-C directly, for example, associated enums, default values, the Result type and similar.

There is already a Github issue in the Mapbox repo: mapbox/mapbox-maps-ios#358

And also a general discussion in the NativeScript CLI repo: NativeScript/nativescript-cli#5575

@farfromrefug
Copy link
Member

@felixkrautschuk indeed if mapbox 10 is in swift without the obj-c comp layer you will have to do that all on your own :(
Definitely means for me that i will stop supporting mapbox sdk.

@darksnow
Copy link

It seems that a lot has changed for Android too. Similar to the above there's a migration guide https://docs.mapbox.com/android/maps/guides/migrate-to-v10/

Looking at the code for this project it appears to need 8.6.6 which is now an old release of MapBox and does not support 3D maps and the globe projection. While I'd love to help with this I'm not familiar with Nativescript or native app development on iOS or Android so not sure how much help I could be.

@timoschlueter
Copy link

I ran into this problem as well today. Is there a way to help migrating this (awesome) plugin to MapBox 10+?
This is by far the best option for using Maps in NativeScript in my opinion.

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

5 participants