maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
226 stars 125 forks source link

Moved EventChannel creation in the downloadOfflineRegion method #205

Closed mariusvn closed 1 year ago

mariusvn commented 1 year ago

Here i splitted the downloadOfflineRegion method on the native side both on IOS and android. This is to avoid edge case when the download is so fast that the event channel doesnt link to the native side. When this happen, the callback onEvent is never called. This is an inconsitency that can create infinite loadings.

mariusvn commented 1 year ago

The implementation should be ready for merge. if anyone can test it on IOS because I don't have an IOS device, that would be cool.

Also, to be sure, there is no implementation of the offline tiles in web right ? Didn't found any.

mariusvn commented 1 year ago

I just need to add a small adjustment in offlinemanagerutils on android

mariusvn commented 1 year ago

should be ready to merge now

mariusvn commented 1 year ago

@m0nac0 can you check it when you have the time to do so ? thanks 👍

m0nac0 commented 1 year ago

Looks good, but this would need some testing on iOS, right?

You're right, there is no web implementation of offline tiles.

GaelleJoubert commented 1 year ago

I will be able to test that on IOS, but probably next week.

mariusvn commented 1 year ago

Yeah, this needs IOS testing as it can maybe break the whole download feature.

On android, i did test it a lot and it works perfectly

mariusvn commented 1 year ago

@GaelleJoubert have you got any update on the IOS testing ? thanks !

GaelleJoubert commented 1 year ago

I have not had time to do it yet, but It is planned very probably tomorrow :) I'll let you know as soon as I have done it.

mariusvn commented 1 year ago

thanks for the update

GaelleJoubert commented 1 year ago

Ok, I just used this branch in my app, which do download offline regions.

I tested it on my android phone (Android 13 - Pixel 6a), and on my Iphone ( Iphone 8 , IOS 16.3.1), and evreything seems to work well ! :)

I've try to do several dowload at the same time, it works well. I've try to delete regions, it works well as well. I am listening to on event to display a progress bar, and change the icon on finished, and it work well.

So everything seems good to me !

mariusvn commented 1 year ago

nice, looks like we can merge it @m0nac0

m0nac0 commented 1 year ago

Thank you to the two of the you!