-
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Hello,
I've started using (and updating) imgViewer2
And it works great for my needs.
I would really like to add a button to rotate the image in increments of 90 degrees, but I can't get it to work..
I've found this little snippet of code, and I'm sure it would help me, but my experience in this area is limited. Is there anyone here that could help me out?
PS: if so, I'll promise to share my improvements :)
L.rotateImageLayer = function(url, bounds, options) {
return new L.RotateImageLayer(url, bounds, options);
};
// A quick extension to allow image layer rotation.
L.rotateImageLayer = L.ImageOverlay.extend({
options: {rotation: 90},
_animateZoom: function(e){
L.ImageOverlay.prototype._animateZoom.call(this, e);
var img = this._image;
img.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.rotation + 'deg)';
},
_reset: function(){
L.ImageOverlay.prototype._reset.call(this);
var img = this._image;
img.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.rotation + 'deg)';
}
});
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels