Skip to content

Commit

Permalink
refactor(#13): remove unused tools
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSolberg committed Oct 26, 2025
1 parent c4f9d26 commit 2cf1feb
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
Expand Up @@ -4,11 +4,14 @@
* @param {Potree.Viewer} viewer - The Potree viewer instance
*/
export function initMiniMap(viewer) {
if (!viewer.mapView) return;
const map = viewer.mapView.map
const layers = map.getLayers()

replaceMiniMapLayers(layers)

removeTileTools(map)

overrideMapViewUpdate(viewer)

// Transform minimap center [lon, lat] from EPSG:4326 to EPSG:3857
Expand Down Expand Up @@ -41,6 +44,19 @@ function replaceMiniMapLayers(layers) {
layers.remove(extentLayer)
}

/**
* Removes the tools for downloading and showing/hiding tiles, denoted D and T in the minimap.
*
* @param {ol.Map} map - The OpenLayers map instance
*/
function removeTileTools(map) {
map.getControls().forEach(control => {
if (control.constructor && control.constructor.name === 'DownloadSelectionControl') {
map.removeControl(control);
}
});
}

/**
* Overrides the minimap pointer update logic to use 3D coordinates and correct direction.
*
Expand Down

0 comments on commit 2cf1feb

Please sign in to comment.