diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 9033ccd79c..5bed2b8408 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -2867,9 +2867,9 @@ while `_clearLayersOutsideContextMode` switches the layer off): the user switching CCTV off inside Contacts closes the panel as anywhere else. A panel opened by hand while the layer is off stays open, and its meta line reads the catalog count, not the last active camera. -The CCTV layer control `focusNearestToPoint(lat, lon, options)` selects the -nearest catalog camera to a valid WGS84 point and optionally flies to it. -`focus: false` selects without flying; no current UI action calls this method. +The CCTV control `focusNearestToPoint(lat, lon, options)` selects the catalog +camera nearest a WGS84 point and flies to it unless `focus: false`. No UI action +calls it yet. ## UI disposal diff --git a/src/layers/cctv/controls.js b/src/layers/cctv/controls.js index 980005feec..5daa130e75 100644 --- a/src/layers/cctv/controls.js +++ b/src/layers/cctv/controls.js @@ -336,13 +336,13 @@ export function createControls({ state: layerState, services, parts, source }) { }, /** - * Selects the camera nearest an explicit WGS84 point and optionally flies. + * Selects the camera nearest a WGS84 point and optionally flies to it. * @param {number} lat Latitude in degrees. * @param {number} lon Longitude in degrees. * @param {Object} [options={}] * @param {boolean} [options.focus=true] Whether to fly after selection. * @param {number} [options.durationSec] Fly-to duration in seconds. - * @returns {string|null} The nearest camera ID, or null if none found. + * @returns {string|null} Camera ID, or null (invalid point, empty catalog). */ focusNearestToPoint(lat, lon, options = {}) { const nearest = parts.navigation.nearestCameraIdToPoint(lat, lon); diff --git a/src/layers/cctv/navigation.js b/src/layers/cctv/navigation.js index 61f0b489a6..aa5ba463e5 100644 --- a/src/layers/cctv/navigation.js +++ b/src/layers/cctv/navigation.js @@ -9,10 +9,10 @@ export function createNavigation({ source, }) { /** - * Find the catalog camera nearest one WGS84 point. + * Nearest catalog camera to a WGS84 point. * @param {number} lat Latitude in degrees. * @param {number} lon Longitude in degrees. - * @returns {string|null} Camera ID of the nearest camera, or null. + * @returns {string|null} Camera ID, or null (invalid point, empty catalog). */ function nearestCameraIdToPoint(lat, lon) { const latitude = Number(lat);