ABAPlan / abaplan-core

Core ABAPlan project
MIT License
4 stars 2 forks source link

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

Closed Ettapp closed 6 years ago

Ettapp commented 6 years ago

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",
}
Ettapp commented 6 years ago

Done with #130