mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-26 03:26:41 +07:00
editor - viewer buttons
This commit is contained in:
parent
1ecc2d2a92
commit
293f3cd7b9
5 changed files with 41 additions and 2 deletions
|
@ -17,6 +17,7 @@ export class Editor {
|
|||
setTotalDist,
|
||||
setActiveSticker,
|
||||
setLogo,
|
||||
setEditing,
|
||||
}) {
|
||||
this.logo = DEFAULT_LOGO;
|
||||
this.owner = null;
|
||||
|
@ -63,6 +64,7 @@ export class Editor {
|
|||
this.setActiveSticker = setActiveSticker;
|
||||
this.setLogo = setLogo;
|
||||
this.setMode = setMode;
|
||||
this.setEditing = setEditing;
|
||||
this.mode = mode;
|
||||
|
||||
map.addEventListener('mouseup', this.onClick);
|
||||
|
@ -196,11 +198,13 @@ export class Editor {
|
|||
startEditing = () => {
|
||||
this.poly.poly.enableEdit();
|
||||
this.stickers.startEditing();
|
||||
this.setEditing(true);
|
||||
};
|
||||
|
||||
stopEditing = () => {
|
||||
this.poly.poly.disableEdit();
|
||||
this.stickers.stopEditing();
|
||||
this.setEditing(false);
|
||||
};
|
||||
|
||||
dumpData = () => ({
|
||||
|
|
|
@ -92,6 +92,7 @@ export class Sticker {
|
|||
};
|
||||
|
||||
estimateAngle = e => {
|
||||
console.log('est');
|
||||
const { x, y } = this.element.getBoundingClientRect();
|
||||
const { pageX, pageY } = e;
|
||||
this.angle = Math.atan2((y - pageY), (x - pageX));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue