Browse Source

[完善] 修改底图兼容老数据

develop
陈鹏飞 4 years ago
parent
commit
084e7caf0b
  1. 11
      src/app/ui/collection-tools/leftFunctionalDomain.ts

11
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
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) {

Loading…
Cancel
Save