How can I determine the location of a mouse click on an Ajax SeaDragon scene relative to the source image that was used to generate the DeepZoom content?
Here's how to get your position on the scene in pixels or seadragon coordinates :
obj = new Seadragon.Viewer( targetId )
obj.viewer.tracker.pressHandler = function(tracker, position) {
console.log('pressHandler', position.x, position.y);
obj.location = new Seadragon.Point(
parseInt(position.x),
parseInt(position.y)
);
var pointPos = obj.view.viewport.pointFromPixel(obj.location);
};
hope this helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With