code: function( data, url ) {
          // Version 2.0 and forwards
          if (data.protocol && data.protocol == 'http://iiif.io/api/image') {
              return true;
          // Version 1.1
          } else if ( data['@context'] && (
              data['@context'] == "http://library.stanford.edu/iiif/image-api/1.1/context.json" ||
              data['@context'] == "http://iiif.io/api/image/1/context.json") ) {
              // N.B. the iiif.io context is wrong, but where the representation lives so likely to be used
              return true;
  
          // Version 1.0
          } else if ( data.profile &&
              data.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html") === 0) {
              return true;
          } else if ( data.identifier && data.width && data.height ) {
              return true;
          } else if ( data.documentElement &&
              "info" == data.documentElement.tagName &&
              "http://library.stanford.edu/iiif/image-api/ns/" ==
                  data.documentElement.namespaceURI) {
              return true;
  
          // Not IIIF
          } else {
              return false;
          }
      }
docs: Determine if the data and/or url imply the image service is supported by
  this tile source.
  @function
  @param {Object|Array} data
  @param {String} optional - url