These are chat archives for openseadragon/openseadragon

Jun 2016
Justin MacCarthy
Jun 24 2016 08:03 UTC
Is there an example of adding multiple overlays using addOverlay api ? I want to hight several items on the page , I have the pixel co-ords from the original image, any example on that ?
Jun 24 2016 08:04 UTC
@macarthy Just call addOverlay multiple times?
Justin MacCarthy
Jun 24 2016 08:13 UTC
@foobarable, that seems to be way I guess.
Im not sure I understand the placement , if I want rectangle draw at 100,100 pixels in the original image with height and width of 50px what does the call look like?
Antoine Vandecreme
Jun 24 2016 13:06 UTC
@macarthy by default, in viewport coordinates, your original image will have a width of 1 and height of it aspect ratio
so to convert 100,100 pixels to viewport coordinates, you need to know the width and height of the original image
OSD can do that for you as well with tiledImage.imageToViewportCoordinates
Jun 24 2016 15:03 UTC
@iangilman I used the option to set alternative default controls when creating the viewer like: 'zoom-in': 'zoominElementId', 'zoom-out': 'zoomoutElementId'
then I grouped those elements in a div with id zoom
and did:
  $scope.osd.addControl('zoom', {'anchor': OpenSeadragon.ControlAnchor.TOP_LEFT });
that's it
it works
at first I wasn't able to correctly style with CSS because when you add an html element with addControl certain attributes like padding are set to 0
the solution is just to use a container, like 'zoom' to group the controls and use it in add controls and add the CSS styles in the contained elements