ui-mapbox icon indicating copy to clipboard operation
ui-mapbox copied to clipboard

Failure to load style from local ~~Enable raster-only loading~~

Open discobanco opened this issue 3 years ago • 2 comments

~~In order to add new sources, at the moment, one has to wait for the mapReady event to fire (else they won't show up), and for that to happen, a token and an initial style are needed. Given that the functionality is handy and some users may not require access to mapbox specific servers (if they are using openstreetmaps for example), would it be possible to bypass the initial check?~~ ~~I'm guessing it would be an easy fix, but not sure where to start, so throwing it here, to see if someone has found a quick fix or a workaround. Thank you!~~

discobanco avatar Jan 16 '22 19:01 discobanco

~~It seems to be possible to have raster-only sources in the original API: https://docs.mapbox.com/mapbox-gl-js/example/map-tiles/~~

discobanco avatar Jan 16 '22 19:01 discobanco

So it seems one can use raster-only configuration as long as they use their own custom json style. However, the local access using ~/ seems to fail. Traced the parsed URL and it's all correct, ( return 'file://' + path.join(knownFolders.currentApp().path, input.replace('~/', '')); ) ==> I use the same exact method to load the tiles, and that works. So I'm guessing it's a problem with the call itself. My current workaround is having a hosted super-simple style json background which is the easiest thing for it to load, once that one is loaded I apply my layers pointing at local tiles: https://raw.githubusercontent.com/discobanco/phoenix-dark-style-container/main/style.json Surely there's a better way, but so far this is the only that worked! :)

discobanco avatar Jan 18 '22 05:01 discobanco