The headless profile API returned by createProfileController.
const profile = createProfileController({ map });profile.start(); // click along the ground; dblclick or Enter finishes the lineprofile.draw.cancel(); // abandon an in-progress line (Escape does the same)console.log(profile.run?.stats.lengthM); Copy
const profile = createProfileController({ map });profile.start(); // click along the ground; dblclick or Enter finishes the lineprofile.draw.cancel(); // abandon an in-progress line (Escape does the same)console.log(profile.run?.stats.lengthM);
Readonly
The shared draw controller (start/cancel/clear the line).
The latest ProfileRun, or null before a line is finished.
null
Clear the line + run.
Unbind everything (widget teardown).
Begin drawing a new profile line.
The headless profile API returned by createProfileController.
Example