This commit is contained in:
vcoppe committed 2026-10-08 21:04:29 +02:00
1 parent b085a1d476
commit 42a55e6759
51 files changed
+5756 -3854

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
//! Editing the metadata, the style and the structure of the files.
use gpx_engine::{self as engine, Command};
use wasm_bindgen::prelude::*;
use crate::ts::Outcome;
use crate::session::*;
// Edit commands
#[wasm_bindgen]
pub fn metadata(name: &str, desc: &str) -> Outcome {
edit(Command::Metadata(engine::Metadata { name, desc }))
}
#[wasm_bindgen]
pub fn style(color: Option<String>, opacity: Option<f64>, width: Option<f64>) -> Outcome {
edit(Command::Style(engine::Style {
color: color.as_deref(),
opacity,
width,
}))
}
#[wasm_bindgen]
pub fn new_track() -> Outcome {
edit(Command::NewTrack(engine::NewTrack))
}
#[wasm_bindgen]
pub fn new_track_segment() -> Outcome {
edit(Command::NewTrackSegment(engine::NewTrackSegment))
}