Skip to content

Commit 3684064

Browse files
shri-achaMaximkaaa
authored andcommitted
chore: Formatting and modify variable names
1 parent 12174d5 commit 3684064

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

galileo/examples/vector_tiles_labels.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub(crate) fn run() {
4343
let labels_style = VectorTileStyle {
4444
rules: vec![StyleRule {
4545
layer_name: None,
46-
max_resolution:None,
46+
max_resolution: None,
4747
min_resolution: None,
4848
properties: Default::default(),
4949
symbol: VectorTileSymbol::Label(VectorTileLabelSymbol {

galileo/src/layer/vector_tile_layer/style.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ pub struct VectorTileStyle {
2323

2424
impl VectorTileStyle {
2525
/// Get a rule for the given feature.
26-
pub fn get_style_rule(&self, layer_name: &str,resolution_level: f64, feature: &MvtFeature) -> Option<&StyleRule> {
26+
pub fn get_style_rule(
27+
&self,
28+
layer_name: &str,
29+
resolution: f64,
30+
feature: &MvtFeature,
31+
) -> Option<&StyleRule> {
2732
self.rules.iter().find(|&rule| {
2833
let correct_geometry_type = match feature.geometry {
2934
MvtGeometry::Point(_)
@@ -50,10 +55,10 @@ impl VectorTileStyle {
5055
if rule.layer_name.as_ref().is_some_and(|v| v != layer_name) {
5156
return false;
5257
}
53-
if rule.max_resolution.is_some_and(|v| v < resolution_level) {
58+
if rule.max_resolution.is_some_and(|v| v < resolution) {
5459
return false;
5560
}
56-
if rule.min_resolution.is_some_and(|v| v > resolution_level) {
61+
if rule.min_resolution.is_some_and(|v| v > resolution) {
5762
return false;
5863
}
5964

@@ -108,9 +113,9 @@ fn compare_numeric(a: &galileo_mvt::MvtValue, b: &str, cmp: impl Fn(f64, f64) ->
108113
pub struct StyleRule {
109114
/// If set, a feature must belong to the set layer. If not set, layer is not checked.
110115
pub layer_name: Option<String>,
111-
/// Determins the maximum resolution
116+
/// If set, the rule will only be applied at resolutions lower than this value.
112117
pub max_resolution: Option<f64>,
113-
/// Determins the minimum resolution
118+
/// If set, the rule will only be applied at resolutions higher than this value.
114119
pub min_resolution: Option<f64>,
115120
/// Specifies a set of attributes of a feature that must have the given values for this rule to be applied.
116121
#[serde(default)]
@@ -341,8 +346,8 @@ mod tests {
341346
fn serialize_with_bincode() {
342347
let rule = StyleRule {
343348
layer_name: None,
344-
min_resolution:None,
345-
max_resolution:None,
349+
min_resolution: None,
350+
max_resolution: None,
346351
properties: vec![],
347352
symbol: VectorTileSymbol::None,
348353
};

galileo/src/tile_schema/schema.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ impl TileSchema {
5252
} else {
5353
None
5454
}
55-
} /// Width of a single tile.
55+
}
56+
57+
/// Width of a single tile.
5658
pub fn tile_width(&self) -> u32 {
5759
self.tile_width
5860
}

0 commit comments

Comments
 (0)