Skip to content

The drawing tools button causes warning messages in the console #128

@Ettapp

Description

@Ettapp

will be edited for more informations

src/app/editor/editor.component

private updateTool(tool: Command & KindTool) {

    // Personalized operation on command
    switch (tool.command) {

      case "move":
        this.drawEdit.enableDraw(false);
        this.mapComponent.map.enableMapNavigation();
        break;

      case "select":
        this.drawEdit.enableDraw(false);
        this.drawEdit.enableEdit(true);
        this.mapComponent.map.disableMapNavigation();
        break;

      case "delete":
        this.drawEdit.enableDraw(false);
        this.drawEdit.enableDelete(true);
        this.mapComponent.map.disableMapNavigation();
        break;

      case "fill":
        this.drawEdit.changeTexture(
          this.toolbarMapComponent.changeFillTool());
        break;

      case "print":
        if (!this.flagSavable)
          this.modalYesNoComponent.open();
        else 
          window.print();
            
        break;

      case "open":
        this.modalMapComponent.open();
        break;
      case "save":
        this.modalSaveMapComponent.open();
        break;
      default:
        console.warn("action buttons not implemented");

    }

    // Global operation on kind
    switch (tool.kind) {
      case "draw" :
        this.mapComponent.map.disableMapNavigation();
        const drawTool = tool as DrawTool;
        this.drawEdit.enableDraw(true, drawTool.drawType);
        this.drawEdit.enableDelete(false);
        this.drawEdit.enableEdit(false);
      break;

      case "action" :
        this.drawEdit.enableDraw(false);
        this.drawEdit.enableDelete(false);
        this.drawEdit.enableEdit(false);
      break;
    }

  }
tool: {
  command : "draw_circle",
  drawType : {
    kind : "circle",
  }
  image : "dist/assets/305da58222a2fb9657dedcf576df0df8.png",
  kind : "draw",
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions