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

iOS: Migrate to Maplibre #2

Closed
m0nac0 opened this issue Mar 9, 2021 · 9 comments
Closed

iOS: Migrate to Maplibre #2

m0nac0 opened this issue Mar 9, 2021 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@m0nac0
Copy link
Collaborator

m0nac0 commented Mar 9, 2021

Currently, I've gotten the plugin to compile on iOS, but it still uses Mapbox GL Native, not Maplibre GL Native.

I most likely won't be able to perform this migration, so any help/contributions are very welcome!

@m0nac0 m0nac0 added the help wanted Extra attention is needed label Mar 9, 2021
@thiphariel
Copy link

Hi @m0nac0 , I have all the setup to build on macOS, but i'm just not used to all of this and mapbox-gl in general. If you think you can guide a bit through, I can test some things for you.

Just tell me !

@m0nac0
Copy link
Collaborator Author

m0nac0 commented Mar 28, 2021

Amazing! I'll be happy to help as much as possible, but I don't know much about iOS development either 😂

You can take a look at the m0-ios-extension branch. (Most important commits are 0961470 and 4e617e5)
I played around a little bit there, but without a Mac I always had to push and wait for the Github Actions build to fail and wasn't able to solve the error.

This plugin directly referenced the Mapbox iOS SDK, which I changed to use the Maplibre iOS SDK. But the plugin also referenced the Mapbox iOS Annotation extension, which in turn also references the Mapbox iOS SDK. So I forked the Annotation extension (https://github.com/m0nac0/maplibre-annotation-extension) and modified it to also use the Maplibre SDK. Then I modified this plugin to use my fork of the annotation extension.

But when I now try to compile the example app I get this error (because of the annotation extension):

flutter-maplibre-gl/flutter-maplibre-gl/example/ios/Pods/MaplibreAnnotationExtension/MapboxAnnotationExtension/Annotations/MGLStyleAnnotation.h:2:9: fatal error: module 'Mapbox' not found
    @import Mapbox;

If I replace @import Mapbox with @import MapLibre in my fork of the annotation extension I still get a similar error that module 'MapLibre' was not found.

So I think the best way to start would be opening both projects (this repo and the forked annotation extension) in Xcode and try:

  • to compile the example app and see if Xcode provides more helpful error messages or tools
  • try to edit the @import Mapbox; line in MaplibreAnnotationExtension/MapboxAnnotationExtension/Annotations/MGLStyleAnnotation.h in the forked annotation extension and see if Xcode helps you pick/autocomplete the right module name.

Let me know if you have more questions, I'm not sure how good my explanation was ;)

@thiphariel
Copy link

Oh, I didn't see your response...

I could try something on some off day, but I really don't know when I could try this ahah

I'll report here when I can watch it 😁

@mindthefish
Copy link

I was able to compile for iOS. Changes have to be made in maplibre-cocoapods, maplibre-annotation-extension and here in flutter-maplibre-gl. Due to dependant references it makes sense to apply changes one after the other. I opened m0nac0/maplibre-cocoapods#1 for the cocoapods changes and m0nac0/maplibre-annotation-extension#1 for annotation extension changes. These currently still link to my fork and should be changed after the cocoapods PR merge.

@mindthefish
Copy link

mindthefish commented May 20, 2021

In order to run the updated flutter-maplibre-gl package, I had to merge your changes from the master @m0nac0. PR is open: #7

Also we have to update the Podfile in the example folder, once the PRs are merged.

@mindthefish
Copy link

@m0nac0 did you find some time to look at the open PRs?

@m0nac0
Copy link
Collaborator Author

m0nac0 commented Jul 22, 2021

@mindthefish Amazing work, I finally noticed the activity in this repo! I'm so sorry for missing it for such a long time. I merged your three PRs. We can still update the reference in the annotation extension, what else has to be done?
(Sorry, I wanted to get back to your right away, I'll need to allocate some time to get back into the details of this project)

@mindthefish
Copy link

I am also just trying to get back into the project. 😆
I think I got the example project to compile again. I'm not an expert in these topics either, but together I'm sure we'll get a good bit further. 👍

@m0nac0
Copy link
Collaborator Author

m0nac0 commented Oct 3, 2021

#9 is merged and this library should now work on iOS. 🎉

Thank you @mindthefish !

Please open new issues if you find any bugs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants