openseadragon/openseadragon — pull request #298 by avandecreme (2013-11-30 23:13:38+00:00)
Title: Layers support

Following the discussion on #13 I just merged this work https://github.com/josh1093/openseadragon/compare/master...layers into the current version, and it is still working :)

You can get an example here: http://avandecreme.github.io/openseadragon-debug-site/
Not the best dataset for this feature but I had nothing better at hand.

Obviously, a lot of work remains to do before merging but I wanted to share that first step in order to discuss how we want to neatly integrate the layers support.

I think the addLayer method should have an options parameter like this:
```javascript
var options = {
tileSource: tileURL or tileSource object,
opacity: opacity of the layer's canvas (default to 1)
}
```
This method should return something allowing to later remove the layer via a Viewer.removeLayer but I am not sure what that thing would be. The drawer associated with the layer?

Also, it might be useful to have some sort of hierarchy to set layers order. Should we use something similar to css property z-index? Maybe even use it.