You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
Currently we have a DSL for building layers and defining their styles. This is fine, but requires defining a multiplatform-compatible implementation of style expressions which all need to be mapped to the platform-specific implementations at run time.
Alternatively, we could look at making use of code generation to avoid most of this work needing to be done at runtime. Layers could be defined in .json files which would be converted by the gradle plugin into the respective platform implementations directly. Those implementations could be imported immediately and used like normal, while still keeping the style definitions consistent between platforms.
Another nice advantage of using JSON to define the layers like this is that it becomes much easier to look up documentation for applying Mapbox styles, as their docs are written with a focus primarily on the JS syntax, which would be emulated directly in the JSON.
Runtime parameterization could also be accomplished by defining some kind of syntax (maybe prefixing variables with a $ character) to allow the plugin to generate a function with the specified parameters that would return an instance of the layer that has those parameters filled in.
The text was updated successfully, but these errors were encountered:
Currently we have a DSL for building layers and defining their styles. This is fine, but requires defining a multiplatform-compatible implementation of style expressions which all need to be mapped to the platform-specific implementations at run time.
Alternatively, we could look at making use of code generation to avoid most of this work needing to be done at runtime. Layers could be defined in
.json
files which would be converted by the gradle plugin into the respective platform implementations directly. Those implementations could be imported immediately and used like normal, while still keeping the style definitions consistent between platforms.Another nice advantage of using JSON to define the layers like this is that it becomes much easier to look up documentation for applying Mapbox styles, as their docs are written with a focus primarily on the JS syntax, which would be emulated directly in the JSON.
Runtime parameterization could also be accomplished by defining some kind of syntax (maybe prefixing variables with a
$
character) to allow the plugin to generate a function with the specified parameters that would return an instance of the layer that has those parameters filled in.The text was updated successfully, but these errors were encountered: