-1

I am currently working on a Java backend which should generate a mapbox style. https://docs.mapbox.com/mapbox-gl-js/style-spec/

After some research I found the specification in JSON format. https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/reference/v8.json

But unfortunately I have not found a Java implementation of this specification.

My questions: Does a Java implementation of the style specification already exist? If no: What is the best way to generate Java classes from this specification?

OnlyMate
  • 23
  • 7

1 Answers1

0

A Mapobox style is by definition a JSON object adhering to the structure outlined in our Style Specification. Although it would be possible to create a Java class using the same structure, this would likely create more overhead in practice than necessary. Style objects are required to be lightweight, given that they are often manipulated programmatically and via API requests. Many developers working with Mapbox styles in Java (for example, when building with our Android SDKs) interact with styles as JSON objects. As such, we would recommend against generating Java classes from the style specification, primarily because that is not the intended structure or use case of a Mapbox style object.

If you are interested in creating a style programmatically via a Java backend, you might find our Styles API very useful, since it provides the infrastructure for creating, updating, and retrieving Mapbox styles, along with many other functionalities.