Riron / ionic-img-viewer

Ionic 2+ component providing a Twitter inspired experience to visualize pictures.
MIT License
283 stars 119 forks source link

TypeError: imageElement.getBoundingClientRect is not a function #110

Open chrisgeek opened 6 years ago

chrisgeek commented 6 years ago

Please provide you version information :

Dependency Version
ionic 3.9.2
angular 5.0.1
ionic-img-viewer 2.9.0

I get this error when using ion-img tag and not img. It works perfectly when using img tag only.

BobaFett58 commented 6 years ago

I have the same issue.

chrisgeek commented 6 years ago

I had to use a popover to get the zoom effect.

devfelipereis commented 6 years ago

Same here.

SnehaSSD commented 6 years ago

Any solution for this ?

kevingrabher commented 6 years ago

I believe this happens if you don't pass the necessary object or set the #

Try the following:

html <img src="youtimageurl.png" #imageToView (click)="openImage(imageToView)"/>

ts openImage(imageToView){ const viewer = this.imageViewerCtrl.create(imageToView, {fullResImage: fullSizePicture}) viewer.present(); }

You can remove ", {fullResImage: fullSizePicture}" if you are not loading a different fullsize image

hitmacreed commented 5 years ago

this can be solved by doing this if u are using ion-img tag <ion-img src="cat.png" imageViewer="cat.png"></ion-img>