Allow configuring the size of pins

This commit is contained in:
Manuel Thalmann 2024-04-28 18:32:43 +02:00
parent 4caca606a3
commit 32904e238f

View file

@ -38,6 +38,17 @@ let
type = colorType; type = colorType;
default = "red"; default = "red";
}; };
size = lib.mkOption {
type = lib.types.enum [
"tiny"
"small"
"medium"
"large"
];
default = "medium";
};
}; };
}; };
}; };
@ -72,6 +83,7 @@ in
users = { users = {
manuel.departure = { manuel.departure = {
location = "Switzerland"; location = "Switzerland";
style.size = "small";
}; };
ganondorf.departure = { ganondorf.departure = {
@ -105,9 +117,19 @@ in
paramForMarker = paramForMarker =
marker: marker:
let let
size = {
tiny = "tiny";
small = "small";
medium = "mid";
large = null;
}.${marker.style.size};
attributes = attributes =
lib.optional (marker.style.label != null) lib.optional
"label:${marker.style.label}" (marker.style.label != null)
"label:${marker.style.label}"
++ lib.optional
(size != null)
"size:${size}"
++ [ ++ [
"color:${marker.style.color}" "color:${marker.style.color}"
"$(${config.scripts.geocode}/bin/geocode ${ "$(${config.scripts.geocode}/bin/geocode ${