Closed srmncnk closed 1 year ago
@felix-ht Yes, it works.
@srmncnk Does this work for you, and if so how are you formatting the json? We use a stored file for our json styles but can't seem to get web to read them either as a direct string or file URL (which I note doesn't look to be set up)
@aardrop Sorry for the late reply. Since interfaces are fixed, you always have to pass a string. String can be either a url to a style or a formatted json of a style (as a string). I'm pretty sure local file URL in the style won't work though.
Thanks @srmncnk, I got that far, but I currently can't get any string json or string URL to work for Mapbox other than the basic on in the example.
For example, this public URL (I will delete it shortly after you have a second to look at it) "mapbox://styles/outway-admin/clox96ha6008n01pqdvps37ew"
and the related JSON as a string both don't work. The string URL gets ignored completely, and the json breaks the map, so nothing loads. Do you have an example of how you formatted the json?
IDK if there is anything special to consider, I can test our json all the way to your code in the repo, but once it leaves there, I don't get any errors and can't find where it's breaking.
I suggest you use Maputnik to test the style. Anything that renders there will render here as well.
That's a helpful resource and helped me solve something else, but I'm getting the following error with a string JSON object still. Is there any special formatting I need to do besides just putting the json in a string?
Through a vary annoying process, I finally found a problem. In the exported JSON from mapbox there was some unregistered character in the airport-label layer that was breaking the whole thing.
This PR enabled users to set style as a json object directly in flutter for Web.
This is already supported by the underlying mapbox_gl_dart package, the usage of it in this package is corrected.