diff --git a/src/MiniMap/miniMap.js b/src/MiniMap/miniMap.js index 7604489..41456a0 100644 --- a/src/MiniMap/miniMap.js +++ b/src/MiniMap/miniMap.js @@ -1,3 +1,8 @@ +/** + * Initializes the Potree minimap to work with offline map and EPSG:4978 coordinates. + * + * @param {Potree.Viewer} viewer - The Potree viewer instance + */ export function initMiniMap(viewer) { const map = viewer.mapView.map const layers = map.getLayers() @@ -11,6 +16,12 @@ export function initMiniMap(viewer) { map.getView().setCenter(center) } +/** + * Replaces default Open Street Map layer with custom GeoJSON in order for it to work offline. + * Also removes the extent layer. + * + * @param {ol.Collection} layers - Collection of OpenLayers layers + */ function replaceMiniMapLayers(layers) { // Remove the old Open Street Map layer const oldOSMLayer = layers.item(0) @@ -30,6 +41,11 @@ function replaceMiniMapLayers(layers) { layers.remove(extentLayer) } +/** + * Overrides the minimap pointer update logic to use 3D coordinates and correct direction. + * + * @param {Potree.Viewer} viewer - The Potree viewer instance + */ function overrideMapViewUpdate(viewer) { const Vector3 = THREE.Vector3 const Vector2 = THREE.Vector2