79426196

Date: 2025-02-10 06:11:51
Score: 1
Natty:
Report link

LOL... After a LOT of searching I learned that you cannot run imageToViewerCoordindates() until the DZI image has been opened!

The solution is to wait until the viewer has opened.

  viewer.addHandler('open', function(target) {
    var point = viewer.viewport.imageToViewportCoordinates(92060,40504);
    console.log("point ", point);
    var img = document.createElement("img");
    img.src = "balls/orange.gif";
    viewer.addOverlay(img, point);
  })

Now how can I offset the overlay image so it isn't the top-left corner, but the middle, or somewhere else in the image. This is variable, depending on zoom level!

Or is there a better way of doing markers?

Reasons:
  • Blacklisted phrase (0.5): how can I
  • Whitelisted phrase (-1): solution is
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Looks like a comment (1):
  • High reputation (-1):
Posted by: anthony