Skip to content

Commit

Permalink
Adicionado o botao Complete para finalizar a ligaçao dos vertices do …
Browse files Browse the repository at this point in the history
…poligono desenhado.
  • Loading branch information
zPedroLuis committed Sep 4, 2020
1 parent 83e6a2a commit 0680c25
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
<button (click)="finish()">
Finish
</button>
<button (click)="complete()">
Complete
</button>
</div>



Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ export class EditableComponent implements OnInit {
public showBoxForm = false;
public authorized = false;
private token = '';


constructor(private as: AuthService,
constructor(private as: AuthService,
private monitorService: MonitorService,
private route: ActivatedRoute,
private dialog: MatDialog)
private dialog: MatDialog)
{

}

ngOnInit() {
Expand All @@ -52,14 +51,18 @@ export class EditableComponent implements OnInit {

public add() {
this.addPolygon.enable();

}

public complete() {
this.addPolygon.completeShape();
this.addPolygon.enable();
}

public enableEditing() {
if (!this.addPolygon) {
this.addPolygon = new L.Draw.Polygon(this.map, this.drawControl.options.polygon);
this.addPolygon.enable();
this.toggleBoxActions();
this.addPolygon = new L.Draw.Polygon(this.map, this.drawControl.options.polygon);
this.addPolygon.enable();
this.toggleBoxActions();
} else {
if (this.showActions) {
this.addPolygon.disable();
Expand All @@ -69,7 +72,6 @@ export class EditableComponent implements OnInit {
this.toggleBoxActions();
}
}


public finish() {
if (this.addPolygon) {
Expand All @@ -85,7 +87,7 @@ export class EditableComponent implements OnInit {
{
width: '360px',
height: '320px',
data: {
data: {
drawnItems: this.drawnItems
}
});
Expand All @@ -99,11 +101,11 @@ export class EditableComponent implements OnInit {
if (response) {
this.token = response.access_token;
}

} catch(err) {
this.authorized = false;
}
}
}


}

0 comments on commit 0680c25

Please sign in to comment.