diff --git a/wasm/html_demo/index.js b/wasm/html_demo/index.js index 56f0a31..cd3a7db 100644 --- a/wasm/html_demo/index.js +++ b/wasm/html_demo/index.js @@ -187,7 +187,8 @@ async function file_selected(el) { let window_lrms = window.Alpine.store('lrms') window_lrms.selectedFeature = curves_features[lrm_id]; - window_lrms.pkStart = projection.measure.anchor_name + '+' + Math.round(projection.measure.scale_offset); + let offset = Math.round(projection.measure.scale_offset) + window_lrms.pkStart = projection.measure.anchor_name + '+' + String(offset).padStart(3, "0"); window_lrms.startMeasure = projection.measure; let point = lrs.resolve(lrm_id, projection.measure) diff --git a/wasm/src/lib.rs b/wasm/src/lib.rs index 16fde4d..1bb0e20 100644 --- a/wasm/src/lib.rs +++ b/wasm/src/lib.rs @@ -25,7 +25,9 @@ pub struct Point { #[wasm_bindgen] impl Point { - /// Build a new [`LrmMeasure`] from an [`Anchor`] `name` and the `offset` on the [`LrmScale`]. + /// Build a new geographical point. + /// + /// When using spherical coordinates, longitude is x and latitude y #[wasm_bindgen(constructor)] pub fn new(x: f64, y: f64) -> Self { Self { x, y }