Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting style as a json object directly for web #1279

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

srmncnk
Copy link
Contributor

@srmncnk srmncnk commented Feb 24, 2023

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.

Copy link
Collaborator

@felix-ht felix-ht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check that this still works with normal style urls?

@srmncnk
Copy link
Contributor Author

srmncnk commented Mar 31, 2023

@felix-ht Yes, it works.

Copy link
Collaborator

@felix-ht felix-ht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@felix-ht felix-ht merged commit 622146f into flutter-mapbox-gl:master Apr 14, 2023
felix-mittermeier pushed a commit to Ocell-io/flutter-mapbox-gl that referenced this pull request Apr 20, 2023
Co-authored-by: Simon Irmančnik <simon@naviter.com>
sandrews-inc pushed a commit to Get-Phil/flutter-mapbox-gl that referenced this pull request May 15, 2023
Co-authored-by: Simon Irmančnik <simon@naviter.com>
FreeGrow added a commit to FreeGrow/maps that referenced this pull request Sep 21, 2023
@aardrop
Copy link
Contributor

aardrop commented Nov 4, 2023

@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)

@srmncnk
Copy link
Contributor Author

srmncnk commented Nov 7, 2023

@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.

@aardrop
Copy link
Contributor

aardrop commented Nov 13, 2023

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.

@srmncnk
Copy link
Contributor Author

srmncnk commented Nov 13, 2023

I suggest you use Maputnik to test the style. Anything that renders there will render here as well.

@aardrop
Copy link
Contributor

aardrop commented Nov 13, 2023

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?
Screenshot 2023-11-13 at 3 10 54 PM

@aardrop
Copy link
Contributor

aardrop commented Nov 13, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants