2026-10-08 21:04:29 +02:00
|
|
|
//! Editing the metadata, the style and the structure of the files.
|
|
|
|
|
|
2026-10-14 09:22:07 +02:00
|
|
|
use gpx_engine::api;
|
2026-10-08 21:04:29 +02:00
|
|
|
use wasm_bindgen::prelude::*;
|
|
|
|
|
|
|
|
|
|
use crate::session::*;
|
2026-10-14 09:22:07 +02:00
|
|
|
use crate::ts::Outcome;
|
2026-10-08 21:04:29 +02:00
|
|
|
|
|
|
|
|
// Edit commands
|
|
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
|
pub fn metadata(name: &str, desc: &str) -> Outcome {
|
2026-10-14 09:22:07 +02:00
|
|
|
run(|e| api::metadata(e, name, desc))
|
2026-10-08 21:04:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
|
pub fn style(color: Option<String>, opacity: Option<f64>, width: Option<f64>) -> Outcome {
|
2026-10-14 09:22:07 +02:00
|
|
|
run(|e| api::style(e, color.as_deref(), opacity, width))
|
2026-10-08 21:04:29 +02:00
|
|
|
}
|
|
|
|
|
|
2026-10-26 19:06:19 +01:00
|
|
|
/// Converts the selected routes to tracks, or the selected tracks or segments to routes.
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
|
pub fn convert() -> Outcome {
|
|
|
|
|
run(api::convert)
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-26 18:51:56 +01:00
|
|
|
#[wasm_bindgen]
|
|
|
|
|
pub fn new_route() -> Outcome {
|
|
|
|
|
run(api::new_route)
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-08 21:04:29 +02:00
|
|
|
#[wasm_bindgen]
|
|
|
|
|
pub fn new_track() -> Outcome {
|
2026-10-14 09:22:07 +02:00
|
|
|
run(api::new_track)
|
2026-10-08 21:04:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[wasm_bindgen]
|
|
|
|
|
pub fn new_track_segment() -> Outcome {
|
2026-10-14 09:22:07 +02:00
|
|
|
run(api::new_track_segment)
|
2026-10-08 21:04:29 +02:00
|
|
|
}
|