Skip to content

Commit

Permalink
Merge pull request #13 from mejackreed/update-examples
Browse files Browse the repository at this point in the history
updates examples, adds support for new profile
  • Loading branch information
mejackreed committed Jan 2, 2015
2 parents 7180e4d + 331c046 commit 14c5ec0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions examples/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
<head>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../leaflet-iiif.js"></script>
</head>
<body>
<div id="map">
<a href="https://github.com/mejackreed/Leaflet-IIIF"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>
</div>
<script src="iiif-example.js"></script>
</body>
Expand Down
14 changes: 9 additions & 5 deletions examples/iiif-example.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var map, stanfordMlk, klokanDemo, princetonMap, iiifLayers;
var map, stanfordMlk, apostle, princetonMap, iiifLayers;

map = L.map('map', {
center: [0, 0],
Expand All @@ -10,14 +10,18 @@ stanfordMlk = L.tileLayer.iiif('https://stacks.stanford.edu/image/iiif/hg676jb49
attribution: '<a href="http://searchworks.stanford.edu/view/hg676jb4964">Martin Luther King Jr. & Joan Baez march to integrate schools, Grenada, MS, 1966</a>'
}).addTo(map);

princetonMap = L.tileLayer.iiif('http://libimages.princeton.edu/loris2/pudl0076%2Fmap_pownall%2F00000001.jp2/info.json');
princetonMap = L.tileLayer.iiif('http://libimages.princeton.edu/loris2/pudl0076%2Fmap_pownall%2F00000001.jp2/info.json', {
attribution: '<a href="http://arks.princeton.edu/ark:/88435/02870w62c">The provinces of New York and New Jersey, with part of Pensilvania, and the Province of Quebec : drawn by Major Holland, Surveyor General, of the Northern District in America. Corrected and improved, from the original materials, by Governr. Pownall, Member of Parliament, 1776</a>'
});

klokanDemo = L.tileLayer.iiif('http://iiif.klokantech.com/demo.jp2/info.json');
apostle = L.tileLayer.iiif('http://ids.lib.harvard.edu/ids/iiif/25286610/info.json', {
attribution: '<a href="http://via.lib.harvard.edu/via/deliver/deepcontentItem?recordId=olvwork576793%2CVIT.BB%3A4906794">Apostle: Anonymous sculptor of Florence, 15th century (1401-1500)</a>'
});

iiifLayers = {
'Martin Luther King Jr. & Joan Baez ...': stanfordMlk,
'Princeton Map': princetonMap,
'Klokan Tech Demo': klokanDemo
'The provinces of New York and N...': princetonMap,
'Apostle: Anonymous sculptor of Florence, 15th century (1401-1500)': apostle
};

L.control.layers(iiifLayers).addTo(map);
5 changes: 3 additions & 2 deletions examples/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#map {
height: 700px;
html, body, #map{
height: 100%;
margin: 0;
}
3 changes: 3 additions & 0 deletions leaflet-iiif.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ L.TileLayer.Iiif = L.TileLayer.extend({
case 'http://library.stanford.edu/iiif/image-api/1.1/compliance.html':
_this.quality = 'native';
break;
case 'http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1':
_this.quality = 'native';
break;
case 'http://iiif.io/api/image/2/level2.json':
_this.quality = 'default';
break;
Expand Down

0 comments on commit 14c5ec0

Please sign in to comment.