Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maxammann committed Aug 25, 2024
1 parent 89a616b commit 820ea08
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
11 changes: 6 additions & 5 deletions maplibre/src/sdf/layout/symbol_feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ use std::cmp::Ordering;

// TODO: Actual feature data with properties
#[derive(Clone)]
pub struct VectorGeometryTileFeature;
pub struct VectorGeometryTileFeature {
pub geometry: GeometryCollection,
}

#[derive(Clone)]
pub struct SymbolGeometryTileFeature {
pub feature: Box<VectorGeometryTileFeature>,
feature: Box<VectorGeometryTileFeature>,
pub geometry: GeometryCollection, // we need a mutable copy of the geometry for mergeLines()
pub formattedText: Option<TaggedString>,
pub icon: Option<expression::Image>,
Expand Down Expand Up @@ -51,11 +53,10 @@ impl SymbolGeometryTileFeature {
}

impl SymbolGeometryTileFeature {
fn new(feature: Box<SymbolGeometryTileFeature>) -> Self {
pub fn new(feature: Box<VectorGeometryTileFeature>) -> Self {
Self {
feature: Box::new(VectorGeometryTileFeature),
geometry: feature.geometry.clone(), // we need a mutable copy of the geometry for mergeLines()
//feature: feature, // we need a mutable copy of the geometry for mergeLines(),
feature: feature,
formattedText: None,
icon: None,
sortKey: 0.0,
Expand Down
14 changes: 5 additions & 9 deletions maplibre/src/sdf/layout/symbol_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1758,15 +1758,11 @@ mod tests {
}],
Box::new(SymbolGeometryTileLayer {
name: "layer".to_string(),
features: vec![SymbolGeometryTileFeature {
feature: Box::new(VectorGeometryTileFeature),
geometry: vec![GeometryCoordinates(vec![Point2D::new(1024, 1024)])],
formattedText: None,
icon: None,
sortKey: 0.0,
index: 0,
allowsVerticalWritingMode: false,
}],
features: vec![SymbolGeometryTileFeature::new(Box::new(
VectorGeometryTileFeature {
geometry: vec![GeometryCoordinates(vec![Point2D::new(1024, 1024)])],
},
))],
}),
&mut LayoutParameters {
bucketParameters: &mut parameters.clone(),
Expand Down

0 comments on commit 820ea08

Please sign in to comment.