import { UiElement } from '../../ui/UiElement.js';
export { FitToScreenButton };
/**
* Simple button to fit map height to the screen
*
* @author rhess <robin.hess@awi.de>
*
* @memberof vef.map.tools
*/
class FitToScreenButton extends UiElement {
constructor(map, position) {
super();
this.map = map;
this.position = position || "top-left";
// initialize element
const element = this.getElement();
element.classList.add("vef-tool");
element.innerHTML = "<i class='fas fa-expand'></i>"
element.title = "Zoom to full extent";
element.addEventListener("click", () => this.map.fitToScreen());
this.map.addTool(this, this.position);
}
}