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

yaml to json #1

Open
farfromrefug opened this issue Nov 22, 2017 · 3 comments
Open

yaml to json #1

farfromrefug opened this issue Nov 22, 2017 · 3 comments

Comments

@farfromrefug
Copy link

Hi,

would it be hard to convert the other way?
I am using mapbox and am very interested by mapzen styles.

Thanks

@ac87
Copy link
Owner

ac87 commented Nov 23, 2017

The conversion shouldn't be difficult, the code to convert is far more straightforward than the guess work that has gone into adjusting the zoom levels the layers appear at.

I'll have a look at some point, I want to refactor the code so the read / convert / write are better separated so I could look at this at the same time.

@farfromrefug
Copy link
Author

@ac87 that s great news. I might look at it too. But somethings bugs me. In Mapzen you can use js functions in the yaml style, you can't do that in mapbox? How are those going to be translated?

@ac87
Copy link
Owner

ac87 commented Nov 27, 2017

That is a good point, you can do some really nice things with JS inside the style.

For the most part I've had to convert This kind of thing from JSON
"text-field": "{name_en}",
to
text_source: function() { feature.name_en; }

which is obviously straightforward.

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

No branches or pull requests

2 participants