diff --git a/src/app/ui/collection-tools/leftFunctionalDomain.ts b/src/app/ui/collection-tools/leftFunctionalDomain.ts index dfbdca6..92be8fb 100644 --- a/src/app/ui/collection-tools/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools/leftFunctionalDomain.ts @@ -73,7 +73,18 @@ export class editPlaneFigureComponent implements OnInit { this.details = this.data.buildingData.details || '' this.imgWidth = this.data.buildingData.imageWidth || 0 this.imgHeight = this.data.buildingData.imageHeight || 0 - this.imgScale = Number((this.imgWidth/this.imgHeight)) + if (this.imgWidth==0 && this.imgHeight==0 && this.data.buildingData.imageUrl) { + let that = this + let img = new Image() + img.src = this.data.buildingData.imageUrl + img.onload = function () { + that.imgWidth = img.width + that.imgHeight = img.height + that.imgScale = Number((that.imgWidth/that.imgHeight)) + } + } else { + this.imgScale = Number((this.imgWidth/this.imgHeight)) + } this.eventManager.addGlobalEventListener('window', 'keydown', (event: any) => { if (event.keyCode === 13) {