Skip to content

Commit

Permalink
docs(#13): add function documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSolberg committed Oct 26, 2025
1 parent a7ab9cd commit c4f9d26
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/MiniMap/miniMap.js
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit c4f9d26

Please sign in to comment.