I want to load a local .mbtiles (with vector tiles) with maplibre-gl-js (in a Cordova app if it's important to know). As far as I understand, I should use the addProtocol method. That works fine as I get my console.log, but I don't know how to load the tiles then...
This is my code:
maplibregl.addProtocol('mbtiles', (params, callback) => {
console.log('I get this log.');
// but what to do here to get local mbtiles vector tiles loaded?
});
The style is defined like this:
...
"sources": {
"openmaptiles": {
"type": "vector",
"url": "mbtiles://map/data/test.mbtiles"
}
},
...
Any help / hints appreciated :)
If you need more information, just feel free to ask.
P.S. I used mapbox-gl-cordova-offline before and tried to understand how this plugin loads the tiles, but I can't figure it out yet.