// Generated by bench/moonbit/gen-style.mjs from MapLibre's style specification (@maplibre/maplibre-gl-style-spec 26.5.0); do not edit.
///|
/// A `vector` source (https://maplibre.org/maplibre-style-spec/sources/#vector): its properties are the
/// labelled arguments, named as the specification's in snake case.
pub fn vector_source(
url? : String,
tiles? : Array[String],
bounds? : Array[Double],
scheme? : String,
minzoom? : Double,
maxzoom? : Double,
attribution? : String,
promote_id? : Json,
volatile_? : Bool,
encoding? : String,
) -> Source {
let o : Map[String, Json] = { "type": "vector" }
put_string(o, "url", url)
put_strings(o, "tiles", tiles)
put_numbers(o, "bounds", bounds)
put_string(o, "scheme", scheme)
put_number(o, "minzoom", minzoom)
put_number(o, "maxzoom", maxzoom)
put_string(o, "attribution", attribution)
put_json(o, "promoteId", promote_id)
put_bool(o, "volatile", volatile_)
put_string(o, "encoding", encoding)
{ json: Json::object(o), }
}
///|
/// A `raster` source (https://maplibre.org/maplibre-style-spec/sources/#raster): its properties are the
/// labelled arguments, named as the specification's in snake case.
pub fn raster_source(
url? : String,
tiles? : Array[String],
bounds? : Array[Double],
minzoom? : Double,
maxzoom? : Double,
tile_size? : Double,
scheme? : String,
attribution? : String,
volatile_? : Bool,
) -> Source {
let o : Map[String, Json] = { "type": "raster" }
put_string(o, "url", url)
put_strings(o, "tiles", tiles)
put_numbers(o, "bounds", bounds)
put_number(o, "minzoom", minzoom)
put_number(o, "maxzoom", maxzoom)
put_number(o, "tileSize", tile_size)
put_string(o, "scheme", scheme)
put_string(o, "attribution", attribution)
put_bool(o, "volatile", volatile_)
{ json: Json::object(o), }
}
///|
/// A `raster-dem` source (https://maplibre.org/maplibre-style-spec/sources/#raster-dem): its properties are the
/// labelled arguments, named as the specification's in snake case.
pub fn raster_dem_source(
url? : String,
tiles? : Array[String],
bounds? : Array[Double],
minzoom? : Double,
maxzoom? : Double,
tile_size? : Double,
attribution? : String,
encoding? : String,
red_factor? : Double,
blue_factor? : Double,
green_factor? : Double,
base_shift? : Double,
volatile_? : Bool,
) -> Source {
let o : Map[String, Json] = { "type": "raster-dem" }
put_string(o, "url", url)
put_strings(o, "tiles", tiles)
put_numbers(o, "bounds", bounds)
put_number(o, "minzoom", minzoom)
put_number(o, "maxzoom", maxzoom)
put_number(o, "tileSize", tile_size)
put_string(o, "attribution", attribution)
put_string(o, "encoding", encoding)
put_number(o, "redFactor", red_factor)
put_number(o, "blueFactor", blue_factor)
put_number(o, "greenFactor", green_factor)
put_number(o, "baseShift", base_shift)
put_bool(o, "volatile", volatile_)
{ json: Json::object(o), }
}
///|
/// A `geojson` source (https://maplibre.org/maplibre-style-spec/sources/#geojson): its properties are the
/// labelled arguments, named as the specification's in snake case.
pub fn geojson_source(
data~ : Json,
maxzoom? : Double,
attribution? : String,
buffer? : Double,
filter? : Json,
tolerance? : Double,
cluster? : Bool,
cluster_radius? : Double,
cluster_max_zoom? : Double,
cluster_min_points? : Double,
cluster_properties? : Json,
line_metrics? : Bool,
generate_id? : Bool,
promote_id? : Json,
) -> Source {
let o : Map[String, Json] = { "type": "geojson" }
put_json(o, "data", Some(data))
put_number(o, "maxzoom", maxzoom)
put_string(o, "attribution", attribution)
put_number(o, "buffer", buffer)
put_json(o, "filter", filter)
put_number(o, "tolerance", tolerance)
put_bool(o, "cluster", cluster)
put_number(o, "clusterRadius", cluster_radius)
put_number(o, "clusterMaxZoom", cluster_max_zoom)
put_number(o, "clusterMinPoints", cluster_min_points)
put_json(o, "clusterProperties", cluster_properties)
put_bool(o, "lineMetrics", line_metrics)
put_bool(o, "generateId", generate_id)
put_json(o, "promoteId", promote_id)
{ json: Json::object(o), }
}
///|
/// A `image` source (https://maplibre.org/maplibre-style-spec/sources/#image): its properties are the
/// labelled arguments, named as the specification's in snake case.
pub fn image_source(coordinates~ : Json, url? : String) -> Source {
let o : Map[String, Json] = { "type": "image" }
put_string(o, "url", url)
put_json(o, "coordinates", Some(coordinates))
{ json: Json::object(o), }
}
///|
/// A `video` source (https://maplibre.org/maplibre-style-spec/sources/#video): its properties are the
/// labelled arguments, named as the specification's in snake case.
pub fn video_source(urls~ : Array[String], coordinates~ : Json) -> Source {
let o : Map[String, Json] = { "type": "video" }
put_strings(o, "urls", Some(urls))
put_json(o, "coordinates", Some(coordinates))
{ json: Json::object(o), }
}