Open
Description
Now that we have concepts as Runtime Styling and Data Driven Styling due to support of expressions, layers, etc.
We can start thinking about introducing a builder like pattern to compose a style object.
Ideally this comes after but #757 but can be added independent.
For reference on how this looks in Kotlin code:
style(styleUri = Style.TRAFFIC_DAY) {
+imageSource("imag") {
url(IMAGE_URL)
coordinates(
listOf(
listOf(-35.859375, 58.44773280389084),
listOf(-16.171875, 58.44773280389084),
listOf(-16.171875, 54.7246201949245),
listOf(-35.859375, 54.7246201949245)
)
)
}
+geoJsonSource(id = "earthquakes") {
url(GEOJSON_URL)
cluster(false)
}
+circleLayer(layerId = "earthquakeCircle", sourceId = "earthquakes") {
circleRadius(get { literal("mag") })
circleColor(rgb(255.0, 0.0, 0.0))
circleOpacity(0.3)
circleStrokeColor(Color.WHITE)
}
}