From 683501097edc11a3e1d8feed698fba7c31369a82 Mon Sep 17 00:00:00 2001 From: Jack Reed Date: Sun, 19 Jul 2015 16:21:31 -0700 Subject: [PATCH] better interpretation of IIIF api versions --- leaflet-iiif.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/leaflet-iiif.js b/leaflet-iiif.js index 52e5ffa..868103f 100644 --- a/leaflet-iiif.js +++ b/leaflet-iiif.js @@ -98,23 +98,11 @@ L.TileLayer.Iiif = L.TileLayer.extend({ }else { profile = data.profile; } - switch (profile) { - case 'http://library.stanford.edu/iiif/image-api/compliance.html#level1': - _this.quality = 100; - break; - 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': + switch (true) { + case /^http:\/\/library.stanford.edu\/iiif\/image-api\/1.1\/compliance.html.*$/.test(profile): _this.quality = 'native'; break; - case 'http://iiif.io/api/image/2/level2.json': - _this.quality = 'default'; - break; - case 'http://iiif.io/api/image/2/level1.json': - _this.quality = 'default'; - break; - case 'http://iiif.io/api/image/2/level0.json': + case /^http:\/\/iiif.io\/api\/image\/2.*$/.test(profile): _this.quality = 'default'; break; }