-
Notifications
You must be signed in to change notification settings - Fork 142
Getting Started: Standalone Version
Release packages for the latest versions of Annotorious are available here.
- Unzip the contents of the package on your server
- Link the Annotorious CSS file into the <head> of your Web pages
- Link the Annotorious JavaScript file into the <head> of your Web pages
Example:
<head>
<link rel="stylesheet" type="text/css" href="css/annotorious.css" />
<script type="text/javascript" src="annotorious.min.js"></script>
</head>
Once you have linked Annotorious into your Web page, you need to tell it which images should be annotatable. There are two ways you can do this:
Option 1. Add a CSS class called annotatable
to the image. This is the easiest way to add annotation functionality, and I'd always recommend using this approach unless your page loads images dynamically via JavaScript, after the page has loaded.
Example:
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/annotorious.css" />
<script type="text/javascript" src="annotorious.min.js"></script>
</head>
<body>
<img src="example.jpg" class="annotatable" />
</body>
</html>
Option 2: Annotation-enable your images via JavaScript, using anno.makeAnnotatable(img);
You can use
this approach if your page loads images dynamically via JavaScript.
Example:
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/annotorious.css" />
<script type="text/javascript" src="annotorious.min.js"></script>
<script>
function init() {
anno.makeAnnotatable(document.getElementById('myImage'));
}
</script>
</head>
<body onload="init();">
<img src="example.jpg" id="myImage" />
</body>
</html>
The Annotorious OpenLayers module is still under development. Watch this space!
Note: Instead of hosting the Annotorious source files yourself, you may also hot-link to the latest versions on the Annotorious site:
http://annotorious.github.com/latest/annotorious.min.js
http://annotorious.github.com/latest/annotorious.css