+
Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Code generation for layer styling #1

@dellisd

Description

@dellisd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载