Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a new extension : 'extended-toolbar.js' #44

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

massimobrero
Copy link
Contributor

This extension adds a new toolbar that improves access to several IIPMooViewer functions : annotation creation, zoom, rotation, reset view, export image of current view, etc.

A demo page 'index-extended-toolbar-demo.html' shows an example of a viewer with the extended toolbar extension loaded. It's still necessary to modify the lines
var server = '/fcgi-bin/iipsrv.fcgi';
and
var image = '/path/to/image.tif';
to match your server and image.

The buttons to be included in the toolbar are simply set in an array of strings where each string correspond to a button. The accepted strings are :
newAnnotation // old method to create annotation
drawNewAnnotation // new method to create annotation - coming soon...
rotateclockwise
rotateanticlockwise
toggleNavigationWindow
toggleAnnotations
getRegionalURL
zoomIn
zoomOut
reset
toggleFullscreen

The extension is loaded with this line :

<script type="text/javascript" src="src/extended-toolbar.js"></script>

The toolbar is inserted in a div with an id of your choice.

The toolbar can be displayed horizontally, vertically as well as inside or outside of the viewer.

To create a toolbar, you call the function createExtendedToolbar. The arguments are the div id (string), the position (inside/outside - string), the orientation (vertical/horizontal - string) and the buttons (see list above - string array).

Example : in order to create a vertical toolbar inside the viewer with buttons allowing to create annotations, and to rotate the image, one would declare :

var buttons = ['newAnnotation', 'rotateanticlockwise', 'rotateclockwise'];
var position = 'inside'; // inside or outside
var orientation = 'vertical'; // vertical or horizontal
iipmooviewer.createExtendedToolbar('mytoolbar', position, orientation, buttons);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant