trevorpowell / mapbox-gl-js-cordova-offline-example

Example Cordova project using https://github.com/trevorpowell/mapbox-gl-js-cordova-offline
18 stars 7 forks source link

combining online and offline maps? #3

Open rvijgen opened 8 years ago

rvijgen commented 8 years ago

Hi,

Would it be possible to combine online and offline sources. I currently have the library running using offline sources as described in the documentation, but when I try to add an online map box source, I can't get it to work. If this is possible, how would you go about it?

best, Richard

trevorpowell commented 8 years ago

It is possible. The fork here overrides the online loading of tiles used in Mapbox GL JS with offline loading from a local MBTiles file. Instead of overriding, we'd have to add a param in the layer maybe that would specify online/offline. Then maintain both methods of loading tiles and use that param to switch between them.

rvijgen commented 8 years ago

Hi Trevor,

thank you for you suggestion, that sounds like a good idea, is there a specific function that I can look at to achieve such functionality?

best, Richard

On 16 Feb 2016, at 17:04, Trevor Powell notifications@github.com wrote:

It is possible. The fork here https://github.com/trevorpowell/mapbox-gl-js-cordova-offline overrides the online loading of tiles used in Mapbox GL JS with offline loading from a local MBTiles file. Instead of overriding, we'd have to add a param in the layer maybe that would specify online/offline. Then maintain both methods of loading tiles and use that param to switch between them.

— Reply to this email directly or view it on GitHub https://github.com/trevorpowell/mapbox-gl-js-cordova-offline-example/issues/3#issuecomment-184746171.

trevorpowell commented 8 years ago

I can try to work on adding that when I have some free time. Otherwise, feel free to fork the repository and submit a pull request.