API reference for map controls in 3DMapFi.
// Add navigation control to the top-right map.addControl(new map.NavigationControl(), 'top-right'); // Add fullscreen control to the bottom-left map.addControl(new map.FullscreenControl(), 'bottom-left'); // Add geolocate control map.addControl(new map.GeolocateControl({ positionOptions: { enableHighAccuracy: true }, trackUserLocation: true })); // Add scale control map.addControl(new map.ScaleControl({ maxWidth: 100, unit: 'metric' }));
top-left
top-right
bottom-left
bottom-right
onAdd
onRemove
class MyControl { onAdd(map) { this._container = document.createElement('div'); this._container.className = 'my-control'; this._container.innerHTML = '<button>Click me</button>'; this._container.onclick = () => alert('Custom control clicked!'); return this._container; } onRemove() { this._container.parentNode.removeChild(this._container); } } map.addControl(new MyControl(), 'top-left');
removeControl
const nav = new map.NavigationControl(); map.addControl(nav); map.removeControl(nav);