geoarrow_wasm/
transform_origin.rs

1use wasm_bindgen::prelude::*;
2
3#[wasm_bindgen]
4pub struct TransformOrigin(pub(crate) geoarrow::algorithm::geo::TransformOrigin);
5
6#[wasm_bindgen]
7impl TransformOrigin {
8    #[wasm_bindgen]
9    pub fn centroid() -> Self {
10        Self(geoarrow::algorithm::geo::TransformOrigin::Centroid)
11    }
12
13    #[wasm_bindgen]
14    pub fn center() -> Self {
15        Self(geoarrow::algorithm::geo::TransformOrigin::Center)
16    }
17
18    #[wasm_bindgen]
19    pub fn point(x: f64, y: f64) -> Self {
20        Self(geoarrow::algorithm::geo::TransformOrigin::Point(
21            geo::Point::new(x, y),
22        ))
23    }
24}