@lipagas/fleetops-engine
Version:
Fleet & Transport Management Extension for Fleetbase
35 lines (27 loc) • 819 B
JavaScript
import Component from '@glimmer/component';
import { action } from '@ember/object';
export default class MapContainerToolbarComponent extends Component {
calculatePosition(trigger) {
let { width } = trigger.getBoundingClientRect();
let style = {
marginTop: '0px',
left: `${width + 13}px`,
top: '0px',
};
return { style };
}
onAction(actionName, ...params) {
if (typeof this[actionName] === 'function') {
this[actionName](...params);
}
if (typeof this.args[actionName] === 'function') {
this.args[actionName](...params);
}
}
onZoomOut() {
this.args.map?.zoomOut();
}
onZoomIn() {
this.args.map?.zoomIn();
}
}