Skip to content

Commit

Permalink
Merge pull request #12 from mejackreed/layer-switcher
Browse files Browse the repository at this point in the history
adds in layer switcher for demo
  • Loading branch information
mejackreed committed Jan 2, 2015
2 parents 2cfc632 + 011f5b6 commit bfbe91b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions examples/iiif-example.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
var map = L.map('map', {
var map, stanfordMlk, klokanDemo, princetonMap, iiifLayers;

map = L.map('map', {
center: [0, 0],
crs: L.CRS.Simple,
zoom: 0
});
// Other IIIF endpoints to try
// http://iiif.klokantech.com/demo.jp2
// http://libimages.princeton.edu/loris2/pudl0076%2Fmap_pownall%2F00000001.jp2
// https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/info.json
L.tileLayer.iiif('https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/info.json', {

stanfordMlk = L.tileLayer.iiif('https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/info.json', {
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');

klokanDemo = L.tileLayer.iiif('http://iiif.klokantech.com/demo.jp2/info.json');

iiifLayers = {
'Martin Luther King Jr. & Joan Baez ...': stanfordMlk,
'Princeton Map': princetonMap,
'Klokan Tech Demo': klokanDemo
};

L.control.layers(iiifLayers).addTo(map);

0 comments on commit bfbe91b

Please sign in to comment.